From: domen@coderock.org
To: James.Bottomley@SteelEye.com
Cc: linux-scsi@vger.kernel.org, Nishanth Aravamudan <nacc@us.ibm.com>,
domen@coderock.org
Subject: [patch 2/2] scsi/lpfc_scsi: use msleep() instead of schedule_timeout()
Date: Thu, 14 Jul 2005 23:43:22 +0200 [thread overview]
Message-ID: <20050714214322.441591000@homer> (raw)
[-- Attachment #1: msleep-drivers_scsi_lpfc_lpfc_scsi --]
[-- Type: text/plain, Size: 2164 bytes --]
From: Nishanth Aravamudan <nacc@us.ibm.com>
Replace schedule_timeout() with msleep() to guarantee the
task delays as expected.
Patch is compile-tested.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
lpfc_scsi.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
Index: quilt/drivers/scsi/lpfc/lpfc_scsi.c
===================================================================
--- quilt.orig/drivers/scsi/lpfc/lpfc_scsi.c
+++ quilt/drivers/scsi/lpfc/lpfc_scsi.c
@@ -24,6 +24,7 @@
#include <linux/pci.h>
#include <linux/interrupt.h>
+#include <linux/delay.h>
#include <scsi/scsi.h>
#include <scsi/scsi_device.h>
@@ -885,8 +886,7 @@ __lpfc_abort_handler(struct scsi_cmnd *c
while (cmnd->host_scribble)
{
spin_unlock_irq(phba->host->host_lock);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(LPFC_ABORT_WAIT*HZ);
+ msleep(LPFC_ABORT_WAIT * 1000);
spin_lock_irq(phba->host->host_lock);
if (++loop_count
> (2 * phba->cfg_nodev_tmo)/LPFC_ABORT_WAIT)
@@ -952,8 +952,7 @@ __lpfc_reset_lun_handler(struct scsi_cmn
if (pnode->nlp_state != NLP_STE_MAPPED_NODE) {
spin_unlock_irq(phba->host->host_lock);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout( HZ/2);
+ msleep(500);
spin_lock_irq(phba->host->host_lock);
}
if ((pnode) && (pnode->nlp_state == NLP_STE_MAPPED_NODE))
@@ -1011,8 +1010,7 @@ __lpfc_reset_lun_handler(struct scsi_cmn
cmnd->device->id, cmnd->device->lun,
LPFC_CTX_LUN))) {
spin_unlock_irq(phba->host->host_lock);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(LPFC_RESET_WAIT*HZ);
+ msleep(LPFC_RESET_WAIT * 1000);
spin_lock_irq(phba->host->host_lock);
if (++loopcnt
@@ -1110,8 +1108,7 @@ __lpfc_reset_bus_handler(struct scsi_cmn
&phba->sli.ring[phba->sli.fcp_ring],
0, 0, LPFC_CTX_HOST))) {
spin_unlock_irq(phba->host->host_lock);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(LPFC_RESET_WAIT*HZ);
+ msleep(LPFC_RESET_WAIT * 1000);
spin_lock_irq(phba->host->host_lock);
if (++loopcnt
--
reply other threads:[~2005-07-14 21:43 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=20050714214322.441591000@homer \
--to=domen@coderock.org \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-scsi@vger.kernel.org \
--cc=nacc@us.ibm.com \
/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