Re: usb-storage: Wait less time for settling when a memory device is connected

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

 



On Fri, Mar 06, 2009 at 07:38:04PM +0100, Martin Bammer wrote:
> Sorry, didn't know about checkpatch.pl and linux-usb@xxxxxxxxxxxxxxxx
> Also I didn't see that delay_use is a module parameter.
> So the patch didn't exactly do what it should. Now here is a new patch
> which should work. The reason for the checks against manufacturer,
> product and serial number is to detect memory devices. These devices are
> ready for partition scanning much earlier than harddrives. So the scan
> delay is set to a shorter time for these devices.

Are you sure they are always ready for partition scanning faster than
harddrives?  How do you know that?

> +	/* Shorten delay time for memory sticks/cards */
> +	if ((us->pusb_dev->descriptor.iManufacturer == 1)
> +	    && (us->pusb_dev->descriptor.iProduct == 2)
> +	    && (us->pusb_dev->descriptor.iSerialNumber == 3)

This change isn't doing what you are thinking it is doing :)

Hint, look at the USB spec at www.usb.org for these fields to see what I
mean...

I do not think there is a real way to properly detect the difference
between a usb storage device that is flash, and one that is a rotating
media that needs longer to spin up.

But, if you are annoyed at this longer delay, just use the module
parameter, it can be set from the kernel boot line, or modules.conf if
you want it to be always changed.

Also note that some distros already do this for you...

thanks,

greg k-h
--
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