From: "Ed Lin" <[email protected]>
- 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 <[email protected]>
---
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);
I put patches 1-2 into misc-2.6.git#stex...
Jeff