lkml.org 
[lkml]   [2006]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/3] stex: adjust command timeout in slave_config routine
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);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-30 11:33    [W:0.046 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site