From: linas@austin.ibm.com
To: linux-kernel@vger.kernel.org
Cc: linuxppc64-dev@lists.linuxppc.org
Subject: [2.4 PATCH:] Lengthen SCSI timeouts to deal with broken hardware
Date: Tue, 30 Sep 2003 12:09:44 -0500 [thread overview]
Message-ID: <20030930120944.A31772@forte.austin.ibm.com> (raw)
[PATCH: 2.4] Lengthen SCSI timeouts to deal with broken hardware
Hi,
The following patch lengthens some scsi timeouts to deal with some
misbehaving hardware. The device in question is an Achip ARC765-based
ide-to-scsi converter that is used to attach IDE DVD-ROMS to scsi
chains. This device can take a very long time (10-15 seconds) to
get back to a normal state after a bus reset, causing the scsi layer
to timeout on commands issued after the reset.
We measured these timeouts using a SCSI bus analyzer. Our guess is
that the slow IDE-CDROM behind this device is helping make the response
times exceptionally large.
The patch below is minimalistic, and not at all fancy. Its also marked
as a __powerpc64__ patch, because this device commonly ships with ppc64
machines. Precisely speaking, though, this is not an architecture
specific problem, anyone with this Achip/Acard will see the (hardware)
bug. I suspect this is a rare, obscure device on non-ppc64 machines.
I've made the patch a __powerpc64__ patch so as to limit impact and
complaints and reasons for rejecting this patch.
--linas
--- drivers/scsi/scsi_obsolete.c.orig 2003-09-29 17:47:26.000000000 -0500
+++ drivers/scsi/scsi_obsolete.c 2003-09-29 17:51:40.000000000 -0500
@@ -118,10 +118,19 @@ static void scsi_dump_status(void);
#define ABORT_TIMEOUT SCSI_TIMEOUT
#define RESET_TIMEOUT SCSI_TIMEOUT
#else
+#if defined(__powerpc64__)
+/* Some Achip ARC765-based DVD-ROM's can take 15 seconds or more to reset.
+ * All commands (sense, abort) will not get a response until the reset
+ * completes. Lengthen timeouts to make up for this. */
+#define SENSE_TIMEOUT (20*HZ)
+#define RESET_TIMEOUT (2*HZ)
+#define ABORT_TIMEOUT (25*HZ)
+#else
#define SENSE_TIMEOUT (5*HZ/10)
#define RESET_TIMEOUT (5*HZ/10)
#define ABORT_TIMEOUT (5*HZ/10)
#endif
+#endif
/* Do not call reset on error if we just did a reset within 15 sec. */
--- drivers/scsi/scsi_scan.c.orig 2003-09-29 17:52:11.000000000 -0500
+++ drivers/scsi/scsi_scan.c 2003-09-29 17:56:58.000000000 -0500
@@ -23,6 +23,15 @@
#include <linux/kmod.h>
#endif
+#if defined(__powerpc64__)
+/* Some Achip ARC765-based DVD-ROM's can take 15 seconds or more to reset.
+ * All commands (sense, abort) will not get a response until the reset
+ * completes. Lengthen timeouts to make up for this. */
+#define SCSI_INQ_TIMEOUT (SCSI_TIMEOUT+25*HZ)
+#else
+#define SCSI_INQ_TIMEOUT (SCSI_TIMEOUT+4*HZ)
+#endif
+
/*
* Flags for irregular SCSI devices that need special treatment
*/
@@ -602,7 +611,7 @@ static int scan_scsis_single(unsigned in
scsi_wait_req (SRpnt, (void *) scsi_cmd,
(void *) scsi_result,
- 256, SCSI_TIMEOUT+4*HZ, 3);
+ 256, SCSI_INQ_TIMEOUT, 3);
SCSI_LOG_SCAN_BUS(3, printk("scsi: INQUIRY %s with code 0x%x\n",
SRpnt->sr_result ? "failed" : "successful", SRpnt->sr_result));
next reply other threads:[~2003-09-30 17:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-30 17:09 linas [this message]
2003-09-30 17:16 ` Jeff Garzik
2003-09-30 18:12 ` linas
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=20030930120944.A31772@forte.austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@lists.linuxppc.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 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®