From: "Ed Lin" <ed.lin@promise.com>
To: "linux-scsi" <linux-scsi@vger.kernel.org>
Cc: "linux-kernel" <linux-kernel@vger.kernel.org>,
"akpm" <akpm@osdl.org>,
"promise_linux" <promise_linux@promise.com>,
"james.Bottomley" <james.Bottomley@SteelEye.com>,
"jeff" <jeff@garzik.org>
Subject: [patch 1/3] stex: adjust command timeout in slave_config routine
Date: Mon, 28 Aug 2006 22:23:17 +0800 [thread overview]
Message-ID: <NONAMEBXDvCeqTPcaWC00000d5d@nonameb.ptu.promise.com> (raw)
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);
next reply other threads:[~2006-08-28 14:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-28 14:23 Ed Lin [this message]
2006-08-30 9:29 [PATCH " Ed Lin
2006-09-01 7:08 ` Jeff Garzik
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=NONAMEBXDvCeqTPcaWC00000d5d@nonameb.ptu.promise.com \
--to=ed.lin@promise.com \
--cc=akpm@osdl.org \
--cc=james.Bottomley@SteelEye.com \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=promise_linux@promise.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
all inboxes | Powered by JetHome®