From: janitor@sternwelten.at
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@SteelEye.com, janitor@sternwelten.at
Subject: [patch 1/7] scsi/mesh: replace schedule_timeout() with msleep()
Date: Wed, 01 Sep 2004 21:54:42 +0200 [thread overview]
Message-ID: <E1C2bBr-0005pP-9L@sputnik> (raw)
I would appreciate any comments from the janitor@sternweltens list.
Description: Use msleep() instead of schedule_timeout() to
guarantee the task delays for the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
---
linux-2.6.9-rc1-bk7-max/drivers/scsi/mesh.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff -puN drivers/scsi/mesh.c~msleep-drivers_scsi_mesh drivers/scsi/mesh.c
--- linux-2.6.9-rc1-bk7/drivers/scsi/mesh.c~msleep-drivers_scsi_mesh 2004-09-01 19:35:45.000000000 +0200
+++ linux-2.6.9-rc1-bk7-max/drivers/scsi/mesh.c 2004-09-01 19:35:45.000000000 +0200
@@ -388,8 +388,7 @@ static void mesh_init(struct mesh_state
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_s
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
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;
_
reply other threads:[~2004-09-01 19:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1C2bBr-0005pP-9L@sputnik \
--to=janitor@sternwelten.at \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox