Commit f4e3a339 authored by Maximilian Attems's avatar Maximilian Attems Committed by Dave Jones

[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: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 74afc22a
...@@ -388,8 +388,7 @@ static void mesh_init(struct mesh_state *ms) ...@@ -388,8 +388,7 @@ static void mesh_init(struct mesh_state *ms)
mesh_flush_io(mr); mesh_flush_io(mr);
/* Wait for bus to come back */ /* Wait for bus to come back */
current->state = TASK_UNINTERRUPTIBLE; msleep(init_reset_delay);
schedule_timeout((init_reset_delay * HZ) / 1000);
} }
/* Reconfigure controller */ /* Reconfigure controller */
...@@ -1749,12 +1748,10 @@ static void set_mesh_power(struct mesh_state *ms, int state) ...@@ -1749,12 +1748,10 @@ static void set_mesh_power(struct mesh_state *ms, int state)
return; return;
if (state) { if (state) {
pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 1); pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 1);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(200);
schedule_timeout(HZ/5);
} else { } else {
pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 0); pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 0);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(10);
schedule_timeout(HZ/100);
} }
} }
...@@ -1772,8 +1769,7 @@ static int mesh_suspend(struct macio_dev *mdev, u32 state) ...@@ -1772,8 +1769,7 @@ static int mesh_suspend(struct macio_dev *mdev, u32 state)
spin_lock_irqsave(ms->host->host_lock, flags); spin_lock_irqsave(ms->host->host_lock, flags);
while(ms->phase != idle) { while(ms->phase != idle) {
spin_unlock_irqrestore(ms->host->host_lock, flags); spin_unlock_irqrestore(ms->host->host_lock, flags);
current->state = TASK_UNINTERRUPTIBLE; msleep(10);
schedule_timeout(HZ/100);
spin_lock_irqsave(ms->host->host_lock, flags); spin_lock_irqsave(ms->host->host_lock, flags);
} }
ms->phase = sleeping; ms->phase = sleeping;
......
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