All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: James.Bottomley@SteelEye.com
Cc: Kernel-Janitors <kernel-janitors@lists.osdl.org>,
	linux-scsi@vger.kernel.org
Subject: [KJ] [PATCH 11/14] scsi/lpfc_scsi: use msleep() instead of
Date: Sat, 09 Jul 2005 00:14:58 +0000	[thread overview]
Message-ID: <20050709001458.GQ2596@us.ibm.com> (raw)
In-Reply-To: <20050709000324.GD2596@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2200 bytes --]

From: Nishanth Aravamudan <nacc@us.ibm.com>

Description: 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>

---

 lpfc_scsi.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff -urp 2.6.13-rc2-kj/drivers/scsi/lpfc/lpfc_scsi.c 2.6.13-rc2-kj-dev/drivers/scsi/lpfc/lpfc_scsi.c
--- 2.6.13-rc2-kj/drivers/scsi/lpfc/lpfc_scsi.c	2005-07-06 07:57:19.000000000 -0700
+++ 2.6.13-rc2-kj-dev/drivers/scsi/lpfc/lpfc_scsi.c	2005-07-06 19:20:41.000000000 -0700
@@ -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 * HZ);
 		spin_lock_irq(phba->host->host_lock);
 
 		if (++loopcnt

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

WARNING: multiple messages have this Message-ID (diff)
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: James.Bottomley@SteelEye.com
Cc: Kernel-Janitors <kernel-janitors@lists.osdl.org>,
	linux-scsi@vger.kernel.org
Subject: [KJ] [PATCH 11/14] scsi/lpfc_scsi: use msleep() instead of schedule_timeout()
Date: Fri, 8 Jul 2005 17:14:58 -0700	[thread overview]
Message-ID: <20050709001458.GQ2596@us.ibm.com> (raw)
In-Reply-To: <20050709000324.GD2596@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2200 bytes --]

From: Nishanth Aravamudan <nacc@us.ibm.com>

Description: 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>

---

 lpfc_scsi.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff -urp 2.6.13-rc2-kj/drivers/scsi/lpfc/lpfc_scsi.c 2.6.13-rc2-kj-dev/drivers/scsi/lpfc/lpfc_scsi.c
--- 2.6.13-rc2-kj/drivers/scsi/lpfc/lpfc_scsi.c	2005-07-06 07:57:19.000000000 -0700
+++ 2.6.13-rc2-kj-dev/drivers/scsi/lpfc/lpfc_scsi.c	2005-07-06 19:20:41.000000000 -0700
@@ -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 * HZ);
 		spin_lock_irq(phba->host->host_lock);
 
 		if (++loopcnt

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2005-07-09  0:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-09  0:03 [PATCH 1/14] sound/pci: fix-up sleeping paths Nishanth Aravamudan
2005-07-09  0:03 ` Nishanth Aravamudan
2005-07-09  0:04 ` [PATCH 2/14] sound/ppc: " Nishanth Aravamudan
2005-07-09  0:04   ` Nishanth Aravamudan
2005-07-09  0:07   ` Nishanth Aravamudan
2005-07-09  0:04 ` [PATCH 3/14] sound/usb: " Nishanth Aravamudan
2005-07-09  0:04   ` Nishanth Aravamudan
2005-07-09  0:08   ` Nishanth Aravamudan
2005-07-09  0:06 ` [PATCH 1/14] sound/pci: " Nishanth Aravamudan
2005-07-09  0:11 ` [KJ] [PATCH 7/14] mips: replace timespectojiffies() with Nishanth Aravamudan
2005-07-09  0:11   ` [PATCH 7/14] mips: replace timespectojiffies() with timespec_to_jiffies() Nishanth Aravamudan
2005-07-11 14:12   ` [KJ] Re: [PATCH 7/14] mips: replace timespectojiffies() with Ralf Baechle
2005-07-11 14:12     ` [PATCH 7/14] mips: replace timespectojiffies() with timespec_to_jiffies() Ralf Baechle
2005-07-09  0:14 ` Nishanth Aravamudan [this message]
2005-07-09  0:14   ` [KJ] [PATCH 11/14] scsi/lpfc_scsi: use msleep() instead of schedule_timeout() Nishanth Aravamudan
2005-07-10 16:20   ` [KJ] [PATCH 11/14] scsi/lpfc_scsi: use msleep() instead of Domen Puncer
2005-07-10 16:20     ` [KJ] [PATCH 11/14] scsi/lpfc_scsi: use msleep() instead of schedule_timeout() Domen Puncer
2005-07-11  5:38     ` [KJ] [PATCH 11/14] scsi/lpfc_scsi: use msleep() instead of Nishanth Aravamudan
2005-07-11  5:38       ` [KJ] [PATCH 11/14] scsi/lpfc_scsi: use msleep() instead of schedule_timeout() Nishanth Aravamudan
2005-07-09  0:15 ` [KJ] [PATCH 12/14] scsi/osst: use msleep() instead of Nishanth Aravamudan
2005-07-09  0:15   ` [KJ] [PATCH 12/14] scsi/osst: use msleep() instead of schedule_timeout() Nishanth Aravamudan
2005-07-09  0:16 ` [KJ] [PATCH 13/14] scsi/qla2xxx: use msleep{, Nishanth Aravamudan
2005-07-09  0:16   ` [KJ] [PATCH 13/14] scsi/qla2xxx: use msleep{, interruptible}() instead of schedule_timeout() Nishanth Aravamudan
  -- strict thread matches above, loose matches on Subject: below --
2005-07-09  0:06 [KJ] Re: [PATCH 1/14] sound/pci: fix-up sleeping paths Nishanth Aravamudan
2005-07-09  0:06 ` Nishanth Aravamudan
2005-07-09  0:07 [KJ] Re: [PATCH 2/14] sound/ppc: " Nishanth Aravamudan
2005-07-09  0:07 ` Nishanth Aravamudan
2005-07-09  0:08 [KJ] Re: [PATCH 3/14] sound/usb: " Nishanth Aravamudan
2005-07-09  0:08 ` Nishanth Aravamudan

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=20050709001458.GQ2596@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=kernel-janitors@lists.osdl.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.