* [PATCH] SCSI: increase default timeout for INQUIRY
@ 2009-03-12 15:08 Alan Stern
2009-03-12 15:12 ` Matthew Wilcox
0 siblings, 1 reply; 4+ messages in thread
From: Alan Stern @ 2009-03-12 15:08 UTC (permalink / raw)
To: James Bottomley; +Cc: Paul Wellner Bou, SCSI development list
This patch (as1224) changes the default timeout for INQUIRY commands
from 3 seconds to 20 seconds, which is the value used by Windows for
USB Mass-Storage devices. Some of these devices, like the Corsair
Flash Voyager (see Bugzilla #12188) really do need a long timeout.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
---
It's hard to see how this could cause any signficant problems, unless
somebody actually depends on INQUIRY timing out.
Index: usb-2.6/drivers/scsi/scsi_scan.c
===================================================================
--- usb-2.6.orig/drivers/scsi/scsi_scan.c
+++ usb-2.6/drivers/scsi/scsi_scan.c
@@ -115,12 +115,12 @@ MODULE_PARM_DESC(max_report_luns,
"REPORT LUNS maximum number of LUNS received (should be"
" between 1 and 16384)");
-static unsigned int scsi_inq_timeout = SCSI_TIMEOUT/HZ+3;
+static unsigned int scsi_inq_timeout = SCSI_TIMEOUT/HZ + 18;
module_param_named(inq_timeout, scsi_inq_timeout, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(inq_timeout,
"Timeout (in seconds) waiting for devices to answer INQUIRY."
- " Default is 5. Some non-compliant devices need more.");
+ " Default is 20. Some devices may need more; most need less.");
/* This lock protects only this list */
static DEFINE_SPINLOCK(async_scan_lock);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] SCSI: increase default timeout for INQUIRY
2009-03-12 15:08 [PATCH] SCSI: increase default timeout for INQUIRY Alan Stern
@ 2009-03-12 15:12 ` Matthew Wilcox
2009-03-12 15:15 ` James Bottomley
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2009-03-12 15:12 UTC (permalink / raw)
To: Alan Stern; +Cc: James Bottomley, Paul Wellner Bou, SCSI development list
On Thu, Mar 12, 2009 at 11:08:51AM -0400, Alan Stern wrote:
> It's hard to see how this could cause any signficant problems, unless
> somebody actually depends on INQUIRY timing out.
Erm, like doing a scan of a bus? With 15 devices to probe, you've
increased the time from 15 * 3 = 45 seconds to 15 * 20 = 300 seconds.
That's not cool ;-(
Maybe we could default this in the transport or something so USB can
override it.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] SCSI: increase default timeout for INQUIRY
2009-03-12 15:12 ` Matthew Wilcox
@ 2009-03-12 15:15 ` James Bottomley
2009-03-12 15:24 ` Alan Stern
0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2009-03-12 15:15 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Alan Stern, Paul Wellner Bou, SCSI development list
On Thu, 2009-03-12 at 09:12 -0600, Matthew Wilcox wrote:
> On Thu, Mar 12, 2009 at 11:08:51AM -0400, Alan Stern wrote:
> > It's hard to see how this could cause any signficant problems, unless
> > somebody actually depends on INQUIRY timing out.
>
> Erm, like doing a scan of a bus? With 15 devices to probe, you've
> increased the time from 15 * 3 = 45 seconds to 15 * 20 = 300 seconds.
> That's not cool ;-(
>
> Maybe we could default this in the transport or something so USB can
> override it.
Well, no, this is the overall command timeout. Each bus (that's
scannable) has its own timeout. For instance, on a parallel bus this is
250ms per device ... don't respond in that time, we return
DID_NO_CONNECT.
I think what Alan is saying is that some USB devices will take >5s to
respond to an initial inquiry. Remember that USB isn't actually a
scannable bus. We get told there's a device there and we have to send
an INQUIRY to classify it.
James
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] SCSI: increase default timeout for INQUIRY
2009-03-12 15:15 ` James Bottomley
@ 2009-03-12 15:24 ` Alan Stern
0 siblings, 0 replies; 4+ messages in thread
From: Alan Stern @ 2009-03-12 15:24 UTC (permalink / raw)
To: James Bottomley; +Cc: Matthew Wilcox, Paul Wellner Bou, SCSI development list
On Thu, 12 Mar 2009, James Bottomley wrote:
> On Thu, 2009-03-12 at 09:12 -0600, Matthew Wilcox wrote:
> > On Thu, Mar 12, 2009 at 11:08:51AM -0400, Alan Stern wrote:
> > > It's hard to see how this could cause any signficant problems, unless
> > > somebody actually depends on INQUIRY timing out.
> >
> > Erm, like doing a scan of a bus? With 15 devices to probe, you've
> > increased the time from 15 * 3 = 45 seconds to 15 * 20 = 300 seconds.
> > That's not cool ;-(
> >
> > Maybe we could default this in the transport or something so USB can
> > override it.
>
> Well, no, this is the overall command timeout. Each bus (that's
> scannable) has its own timeout. For instance, on a parallel bus this is
> 250ms per device ... don't respond in that time, we return
> DID_NO_CONNECT.
>
> I think what Alan is saying is that some USB devices will take >5s to
> respond to an initial inquiry. Remember that USB isn't actually a
> scannable bus. We get told there's a device there and we have to send
> an INQUIRY to classify it.
That's right. There are a few devices which take > 15 seconds to
respond to INQUIRY, but once they do respond they go on to work
correctly and at a reasonable speed. Apparently this is some sort of
initialization delay.
Obviously this isn't a huge issue, since users can set the module
parameter for themselves. But it's a lot easier if they don't have to
-- especially since they won't have to figure out what _needs_ to
changed (it isn't at all obvious from the pattern of errors).
Alan Stern
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-12 15:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-12 15:08 [PATCH] SCSI: increase default timeout for INQUIRY Alan Stern
2009-03-12 15:12 ` Matthew Wilcox
2009-03-12 15:15 ` James Bottomley
2009-03-12 15:24 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox