From 97206f2c8ed86fe8b083f7e7677819ec72c55b49 Mon Sep 17 00:00:00 2001 From: Maximilian Attems Date: Mon, 18 Oct 2004 18:22:28 -0700 Subject: [PATCH] [PATCH] janitor: drivers/message: replace schedule_timeout() with msleep_interruptible() Use msleep_interruptible() instead of schedule_timeout() under drivers/message. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/message/fusion/mptbase.c | 39 +++++++++++--------------------- drivers/message/i2o/device.c | 4 ++-- drivers/message/i2o/exec-osm.c | 3 ++- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index c467480b958c9..d252c2bda137e 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -2195,8 +2195,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) } if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1 * HZ / 1000); + msleep_interruptible(1); } else { mdelay (1); /* 1 msec delay */ } @@ -2565,8 +2564,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) state = mpt_GetIocState(ioc, 1); while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) { if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1 * HZ / 1000); + msleep_interruptible(1); } else { mdelay(1); } @@ -2833,8 +2831,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) /* wait 1 msec */ if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1 * HZ / 1000); + msleep_interruptible(1); } else { mdelay (1); } @@ -2851,8 +2848,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) } /* wait 1 sec */ if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1000 * HZ / 1000); + msleep_interruptible (1000); } else { mdelay (1000); } @@ -2952,8 +2948,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) return 0; } if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(10 * HZ / 1000); + msleep_interruptible (10); } else { mdelay (10); } @@ -3004,8 +2999,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag); if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1000 * HZ / 1000); + msleep_interruptible (1000); } else { mdelay (1000); } @@ -3027,8 +3021,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) return hard_reset_done; } if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(10 * HZ / 1000); + msleep_interruptible (10); } else { mdelay (10); } @@ -3099,8 +3092,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) /* wait 100 msec */ if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(100 * HZ / 1000); + msleep_interruptible (100); } else { mdelay (100); } @@ -3207,8 +3199,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) /* wait 1 sec */ if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1000 * HZ / 1000); + msleep_interruptible (1000); } else { mdelay (1000); } @@ -3242,8 +3233,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) /* wait 100 msec */ if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(100 * HZ / 1000); + msleep_interruptible (100); } else { mdelay (100); } @@ -3337,8 +3327,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag) } if (sleepFlag == CAN_SLEEP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1 * HZ / 1000); + msleep_interruptible(1); } else { mdelay (1); /* 1 msec delay */ } @@ -3775,8 +3764,7 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag) intstat = CHIPREG_READ32(&ioc->chip->IntStatus); if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) break; - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1 * HZ / 1000); + msleep_interruptible (1); count++; } } else { @@ -3825,8 +3813,7 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag) intstat = CHIPREG_READ32(&ioc->chip->IntStatus); if (intstat & MPI_HIS_DOORBELL_INTERRUPT) break; - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1 * HZ / 1000); + msleep_interruptible(1); count++; } } else { diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index ff4822ed4df81..def6ea54416e1 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c @@ -15,6 +15,7 @@ #include #include +#include /* Exec OSM functions */ extern struct bus_type i2o_bus_type; @@ -106,8 +107,7 @@ int i2o_device_claim_release(struct i2o_device *dev) if (!rc) break; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ); + ssleep(1); } if (!rc) diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index ab60b49b844a1..19dcffdb21396 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c @@ -29,6 +29,7 @@ #include #include +#include struct i2o_driver i2o_exec_driver; @@ -151,7 +152,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE); if (!iwait->complete) - schedule_timeout(timeout * HZ); + msleep_interruptible(timeout * 1000); finish_wait(&wq, &wait); -- 2.53.0