Re: usb_stor_control_msg() timeout argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 17 Oct 2014 12:53:45 -0400 (EDT)
Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:

> On Fri, 17 Oct 2014, Mark Knibbs wrote:
> 
> > In include/linux/usb.h, there is
> > /*
> >  * timeouts, in milliseconds, used for sending/receiving control messages
> >  * they typically complete within a few frames (msec) after they're issued
> >  * USB identifies 5 second timeouts, maybe more in a few cases, and a few
> >  * slow devices (like some MGE Ellipse UPSes) actually push that limit.
> >  */
> > #define USB_CTRL_GET_TIMEOUT    5000
> > #define USB_CTRL_SET_TIMEOUT    5000
>
> Those timeout values are used with usb_control_msg(), which takes 
> timeout values in milliseconds.
>
> > However several callers of usb_stor_control_msg() have timeout argument
> > specified as n*HZ, for example in drivers/usb/storage/transport.c:
> > ...
>
> This is because usb_stor_control_msg accepts timeout values in jiffies.
>
> > I'm just wondering whether those callers should have timeouts in ms (so
> > 3*HZ -> 3000), or whether the definitions of USB_CTRL_GET/SET_TIMEOUT
> > should be 5*HZ? Or is HZ always 1000 these days?
>
> No, no, and no.

Ah, thanks. Given that, it seems my recent patch
"[PATCH] storage: Replace magic number with define in usb_stor_euscsi_init()"
which replaced 5000 with USB_CTRL_SET_TIMEOUT wasn't correct, though that
patch wouldn't change the compiled code.

It looks like the 5000 timeout in usb_stor_euscsi_init() should be replaced
by 5*HZ then?


Mark
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux