Re: [PATCH 2.6.30 1/1] usb-storage: handle unusual dev Realtek Usb Card Reader (0x0bda:0x0152)

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

 



On Mon, 13 Jul 2009, Giacomo Lozito wrote:

> >P.S.: Instead of patching the driver, you should get an equivalent
> >result by increasing the "delay_use=" module parameter for usb-storage
> >from its default value of 5 seconds up to 15 seconds.  Have you tried
> >this?
> 
> Tried just now.
> It works fine, with no patch applied,
> when delay_use is set equal to 10 (or higher than that).
> 
> Out of curiosity...
> while they lead to an equivalent result, if I guessed this correctly (not 
> really sure about how wait_event_freezable_timeout works), the difference 
> between delay_use and getmaxlun timeout lies in the fact that delay_use always 
> forces a wait for X seconds (even when un-needed), while the timeout obviously 
> is not forcefully reached if getmaxlun succeeds.
> Is that correct?

Just about.  There is one other small difference.  With the delay_use
parameters, the system will wait X seconds before sending the GetMaxLUN
request.  With the timeout, the system will send the request
immediately and then wait up to X seconds to receive a reply.  Some
devices are sensitive to when the request is sent; they get very
confused if they receive it before they are ready.

> If that is correct, I guess it would be better to raise the getmaxlun timeout.
> If, on the other hand, they both can return before the timeout is reached, 
> then it doesn't matter which one is raised.
> 
> We could also add a "delay" field in the us_data structure and allow unusual 
> devs to customize that in their init function, thus raising delay_use (or 
> getmaxlun timeout, delay could act on any of the two) only when it's known to 
> be required for a certain device.
> Looking at the code a bit, I think I can do something like that.
> 
> Or we could do nothing at all :)
> 
> What do you think it could be the best solution?

Raising the GetMaxLUN timeout seems like a reasonable thing to do.  
Under normal circumstances it won't cause any harm, and it will 
automatically help other people facing similar problems.  As opposed to 
delay_use, which has to be set manually.

Alan Stern

--
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