On Fri, 25 Jun 2004, Daniel Drake wrote:

> Hi,
> 
> Alan Stern wrote:
> > From things I've seen in the past, I'll guess that the device reports "No 
> > medium present" until it finishes initializing, which might require a few 
> > seconds.  Since the usb-storage and other drivers try probing the device 
> > right away, they are forced to assume that there are no partitions and no 
> > data -- until something tells them to take a second look.
> > 
> > It's not clear what the best solution to this is.  But here's something 
> > you can try that might confirm my guess.  Make sure all hotplug support is 
> > turned off so that drivers aren't loaded automatically.  Make sure 
> > usb-storage isn't loaded and plug in the device.  Then maybe 30 seconds 
> > later modprobe usb-storage and see if it detects the disk partitions.
> 
> That would make sense. And yes - you are right, if given time to warm up, the 
> device will report sda1 when you load the usb-storage module. I can think of a 
> few userspace workarounds to get around this, are there any acceptable ways 
> you can think of doing this in the kernel?
> 
> I can get you the complete logs if required.

There is an appropriate place in the kernel to insert a delay.  The
problem is, how do we recognize that a delay is needed, as opposed to
believing that the device really _does_ have no medium present?  It might
depend on the exact error code sent back by the device -- and yes, seeing
the full log from a connection that fails to locate the partitions would
help.

Also, it would help to know how long the delay has to be.  You could try
experimenting with cycling the power on your device, then plugging it in,
then loading usb-storage after some variable number of seconds.  Will it
work with a delay as short as 5 seconds?  1 second?  Tell us what you can 
live with.

If the required delay time is short enough, we can just always use it 
without much penalty.  But if it's longer, then we'd need to have some way 
of recognizing which devices need the delay and which don't.  Maybe a 
blacklist entry would work, for the relatively small number of devices 
that really do need a delay.

Alan Stern





-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to