From f4e3a339541ef98fc1f131efd75cbe176645f48a Mon Sep 17 00:00:00 2001 From: Maximilian Attems Date: Fri, 10 Sep 2004 05:24:54 -0400 Subject: [PATCH] [PATCH] scsi/mesh: replace schedule_timeout() with msleep() Description: Use msleep() instead of schedule_timeout() to guarantee the task delays for the desired time. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: James Bottomley --- drivers/scsi/mesh.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index 1700d4e6ce58e..721f40dddab44 100644 --- a/drivers/scsi/mesh.c +++ b/drivers/scsi/mesh.c @@ -388,8 +388,7 @@ static void mesh_init(struct mesh_state *ms) mesh_flush_io(mr); /* Wait for bus to come back */ - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout((init_reset_delay * HZ) / 1000); + msleep(init_reset_delay); } /* Reconfigure controller */ @@ -1749,12 +1748,10 @@ static void set_mesh_power(struct mesh_state *ms, int state) return; if (state) { pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 1); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); + msleep(200); } else { pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 0); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/100); + msleep(10); } } @@ -1772,8 +1769,7 @@ static int mesh_suspend(struct macio_dev *mdev, u32 state) spin_lock_irqsave(ms->host->host_lock, flags); while(ms->phase != idle) { spin_unlock_irqrestore(ms->host->host_lock, flags); - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ/100); + msleep(10); spin_lock_irqsave(ms->host->host_lock, flags); } ms->phase = sleeping; -- 2.53.0