mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.4 PATCH:] Lengthen SCSI timeouts to deal with broken hardware
@ 2003-09-30 17:09 linas
  2003-09-30 17:16 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: linas @ 2003-09-30 17:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc64-dev



[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));

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

end of thread, other threads:[~2003-09-30 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-30 17:09 [2.4 PATCH:] Lengthen SCSI timeouts to deal with broken hardware linas
2003-09-30 17:16 ` Jeff Garzik
2003-09-30 18:12   ` linas

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®