public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] stex: adjust command timeout in slave_config routine
@ 2006-08-30  9:29 Ed Lin
  2006-09-01  7:08 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Ed Lin @ 2006-08-30  9:29 UTC (permalink / raw)
  To: linux-scsi; +Cc: linux-kernel, akpm, promise_linux, james.Bottomley, jeff

From: "Ed Lin" <ed.lin@promise.com>

- remove unsuitable waiting code and unnecessary handling code
  from reset routine

- adjust command timeout in slave_config routine to achieve intended
  effect of removed waiting code

Signed-off-by: Ed Lin <ed.lin@promise.com>
---
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index fceae17..cb17415 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -519,6 +519,7 @@ stex_slave_config(struct scsi_device *sd
 {
 	sdev->use_10_for_rw = 1;
 	sdev->use_10_for_ms = 1;
+	sdev->timeout = 60 * HZ;
 	return 0;
 }
 
@@ -938,37 +939,11 @@ static void stex_hard_reset(struct st_hb
 static int stex_reset(struct scsi_cmnd *cmd)
 {
 	struct st_hba *hba;
-	int tag;
-	int i = 0;
 	unsigned long flags;
 	hba = (struct st_hba *) &cmd->device->host->hostdata[0];
 
-wait_cmds:
-	spin_lock_irqsave(hba->host->host_lock, flags);
-	for (tag = 0; tag < MU_MAX_REQUEST; tag++)
-		if ((hba->tag & (1 << tag)) && hba->ccb[tag].req != NULL)
-			break;
-	spin_unlock_irqrestore(hba->host->host_lock, flags);
-	if (tag < MU_MAX_REQUEST) {
-		ssleep(1);
-		if (++i < 10)
-			goto wait_cmds;
-	}
-
 	hba->mu_status = MU_STATE_RESETTING;
 
-	spin_lock_irqsave(hba->host->host_lock, flags);
-
-	for (tag = 0; tag < MU_MAX_REQUEST; tag++)
-		if ((hba->tag & (1 << tag)) && hba->ccb[tag].req != NULL) {
-			stex_free_tag((unsigned long *)&hba->tag, tag);
-			stex_unmap_sg(hba, hba->ccb[tag].cmd);
-			hba->ccb[tag].cmd->result = DID_RESET << 16;
-			hba->ccb[tag].cmd->scsi_done(hba->ccb[tag].cmd);
-		}
-
-	spin_unlock_irqrestore(hba->host->host_lock, flags);
-
 	if (hba->cardtype == st_shasta)
 		stex_hard_reset(hba);
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [patch 1/3] stex: adjust command timeout in slave_config routine
@ 2006-08-28 14:23 Ed Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Ed Lin @ 2006-08-28 14:23 UTC (permalink / raw)
  To: linux-scsi; +Cc: linux-kernel, akpm, promise_linux, james.Bottomley, jeff

From: "Ed Lin" <ed.lin@promise.com>

- remove unsuitable waiting code and unnecessary handling code
  from reset routine

- adjust command timeout in slave_config routine to achieve intended
  effect of removed waiting code
---
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index fceae17..cb17415 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -519,6 +519,7 @@ stex_slave_config(struct scsi_device *sd
 {
 	sdev->use_10_for_rw = 1;
 	sdev->use_10_for_ms = 1;
+	sdev->timeout = 60 * HZ;
 	return 0;
 }
 
@@ -938,37 +939,11 @@ static void stex_hard_reset(struct st_hb
 static int stex_reset(struct scsi_cmnd *cmd)
 {
 	struct st_hba *hba;
-	int tag;
-	int i = 0;
 	unsigned long flags;
 	hba = (struct st_hba *) &cmd->device->host->hostdata[0];
 
-wait_cmds:
-	spin_lock_irqsave(hba->host->host_lock, flags);
-	for (tag = 0; tag < MU_MAX_REQUEST; tag++)
-		if ((hba->tag & (1 << tag)) && hba->ccb[tag].req != NULL)
-			break;
-	spin_unlock_irqrestore(hba->host->host_lock, flags);
-	if (tag < MU_MAX_REQUEST) {
-		ssleep(1);
-		if (++i < 10)
-			goto wait_cmds;
-	}
-
 	hba->mu_status = MU_STATE_RESETTING;
 
-	spin_lock_irqsave(hba->host->host_lock, flags);
-
-	for (tag = 0; tag < MU_MAX_REQUEST; tag++)
-		if ((hba->tag & (1 << tag)) && hba->ccb[tag].req != NULL) {
-			stex_free_tag((unsigned long *)&hba->tag, tag);
-			stex_unmap_sg(hba, hba->ccb[tag].cmd);
-			hba->ccb[tag].cmd->result = DID_RESET << 16;
-			hba->ccb[tag].cmd->scsi_done(hba->ccb[tag].cmd);
-		}
-
-	spin_unlock_irqrestore(hba->host->host_lock, flags);
-
 	if (hba->cardtype == st_shasta)
 		stex_hard_reset(hba);
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-01  7:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-30  9:29 [PATCH 1/3] stex: adjust command timeout in slave_config routine Ed Lin
2006-09-01  7:08 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2006-08-28 14:23 [patch " Ed Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox