Re: Waiting for the current usb devices to be scanned, how?

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

 



On Sun, 21 Nov 2010, Michael Tokarev wrote:

> Hello.
> 
> Is there a way to trigger or wait for all the _currently_
> connected USB devices to be probed?

No, there isn't.  Some patches in this direction were posted last year 
but they never got merged.

> The most common case of this, I think, is when a system
> is booting from a USB storage device.  Initramfs loads
> the USB controller driver, which triggers USB device
> scan and discovers and initializes usb-storage and other
> devices.  But the discover is done after quite some pause,
> definitely after modprobe of the USB controller module
> returns.
> 
> Is there a way to determine that such a waiting/pause is
> in progress, and actually wait for it to complete before
> trying to see the storage devices we now have?

No, not directly.  You can do it indirectly by waiting until the khubd 
process remains idle for a prolonged period of time.

But why wait until the end?  You can look through the set of existing
storage devices at any time.  If the one you want isn't there, just
wait a little longer.

> I understand the dynamic nature of USB (and actually other)
> busses and devices, but at least the "current" device scan
> is something more or less deterministic.

"More or less" is right!  There's no way to tell in advance how long an 
individual device will take, and the scanning is done sequentially.

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