Commit 97206f2c authored by Maximilian Attems's avatar Maximilian Attems Committed by Linus Torvalds

[PATCH] janitor: drivers/message: replace schedule_timeout() with msleep_interruptible()

Use msleep_interruptible() instead of schedule_timeout() under drivers/message.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4a7b9aa4
...@@ -2195,8 +2195,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) ...@@ -2195,8 +2195,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
} }
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible(1);
schedule_timeout(1 * HZ / 1000);
} else { } else {
mdelay (1); /* 1 msec delay */ mdelay (1); /* 1 msec delay */
} }
...@@ -2565,8 +2564,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2565,8 +2564,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
state = mpt_GetIocState(ioc, 1); state = mpt_GetIocState(ioc, 1);
while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) { while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) {
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible(1);
schedule_timeout(1 * HZ / 1000);
} else { } else {
mdelay(1); mdelay(1);
} }
...@@ -2833,8 +2831,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2833,8 +2831,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
/* wait 1 msec */ /* wait 1 msec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible(1);
schedule_timeout(1 * HZ / 1000);
} else { } else {
mdelay (1); mdelay (1);
} }
...@@ -2851,8 +2848,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2851,8 +2848,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
} }
/* wait 1 sec */ /* wait 1 sec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (1000);
schedule_timeout(1000 * HZ / 1000);
} else { } else {
mdelay (1000); mdelay (1000);
} }
...@@ -2952,8 +2948,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2952,8 +2948,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
return 0; return 0;
} }
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (10);
schedule_timeout(10 * HZ / 1000);
} else { } else {
mdelay (10); mdelay (10);
} }
...@@ -3004,8 +2999,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) ...@@ -3004,8 +2999,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag); SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag);
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (1000);
schedule_timeout(1000 * HZ / 1000);
} else { } else {
mdelay (1000); mdelay (1000);
} }
...@@ -3027,8 +3021,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) ...@@ -3027,8 +3021,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
return hard_reset_done; return hard_reset_done;
} }
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (10);
schedule_timeout(10 * HZ / 1000);
} else { } else {
mdelay (10); mdelay (10);
} }
...@@ -3099,8 +3092,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3099,8 +3092,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* wait 100 msec */ /* wait 100 msec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (100);
schedule_timeout(100 * HZ / 1000);
} else { } else {
mdelay (100); mdelay (100);
} }
...@@ -3207,8 +3199,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3207,8 +3199,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* wait 1 sec */ /* wait 1 sec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (1000);
schedule_timeout(1000 * HZ / 1000);
} else { } else {
mdelay (1000); mdelay (1000);
} }
...@@ -3242,8 +3233,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3242,8 +3233,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* wait 100 msec */ /* wait 100 msec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (100);
schedule_timeout(100 * HZ / 1000);
} else { } else {
mdelay (100); mdelay (100);
} }
...@@ -3337,8 +3327,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag) ...@@ -3337,8 +3327,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag)
} }
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible(1);
schedule_timeout(1 * HZ / 1000);
} else { } else {
mdelay (1); /* 1 msec delay */ mdelay (1); /* 1 msec delay */
} }
...@@ -3775,8 +3764,7 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag) ...@@ -3775,8 +3764,7 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
intstat = CHIPREG_READ32(&ioc->chip->IntStatus); intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
break; break;
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (1);
schedule_timeout(1 * HZ / 1000);
count++; count++;
} }
} else { } else {
...@@ -3825,8 +3813,7 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag) ...@@ -3825,8 +3813,7 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
intstat = CHIPREG_READ32(&ioc->chip->IntStatus); intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
if (intstat & MPI_HIS_DOORBELL_INTERRUPT) if (intstat & MPI_HIS_DOORBELL_INTERRUPT)
break; break;
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible(1);
schedule_timeout(1 * HZ / 1000);
count++; count++;
} }
} else { } else {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/i2o.h> #include <linux/i2o.h>
#include <linux/delay.h>
/* Exec OSM functions */ /* Exec OSM functions */
extern struct bus_type i2o_bus_type; extern struct bus_type i2o_bus_type;
...@@ -106,8 +107,7 @@ int i2o_device_claim_release(struct i2o_device *dev) ...@@ -106,8 +107,7 @@ int i2o_device_claim_release(struct i2o_device *dev)
if (!rc) if (!rc)
break; break;
set_current_state(TASK_UNINTERRUPTIBLE); ssleep(1);
schedule_timeout(HZ);
} }
if (!rc) if (!rc)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/i2o.h> #include <linux/i2o.h>
#include <linux/delay.h>
struct i2o_driver i2o_exec_driver; struct i2o_driver i2o_exec_driver;
...@@ -151,7 +152,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long ...@@ -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); prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE);
if (!iwait->complete) if (!iwait->complete)
schedule_timeout(timeout * HZ); msleep_interruptible(timeout * 1000);
finish_wait(&wq, &wait); finish_wait(&wq, &wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment