How can I force the system not to recognize a USB2.0 flash memory device at USB1.1 speed?
A couple times per month I plug in a USB2.0 flash memory stick, but it gets recognized as a 12 megabits/second USB1.1 device:
kernel: [sss,uuu] usb 5-1: new full-speed USB device number 2 using ohci_hcd
instead of as a 480 megabits/second USB2.0 device:
kernel: [sss.uuu] usb 5-1: new high-speed USB device number 2 using ehci_hcd
Unfortunately 12Mb/s "works" very slowly. It can take a long time (many tens of seconds) after killing the application that initiated the writes before the kernel finishes pending operations, thus enabling safe removal of the device. Usually unplugging and re-plugging the flash memory stick (perhaps into a different port) is enough to achieve recognition as a USB2.0 device.
So, I would like to restrict flash memory devices to USB2.0 (or USB3). How? It would be nice if a true USB1.1 device (such as mouse or keyboard) still worked. Perhaps the "USB2.0 only" restriction could be on specific ports, although it would be best if based on device type instead of by port.
On Sat, Jun 15, 2013 at 08:24:33AM -0700, John Reiser wrote:
How can I force the system not to recognize a USB2.0 flash memory device at USB1.1 speed?
You can't - it's negotiated at the host controller level, the OS isn't involved.
On Sun, 2013-06-16 at 05:38 +0100, Matthew Garrett wrote:
On Sat, Jun 15, 2013 at 08:24:33AM -0700, John Reiser wrote:
How can I force the system not to recognize a USB2.0 flash memory
device at USB1.1 speed?
You can't - it's negotiated at the host controller level, the OS isn't involved.
You can't force it to use USB2 mode when for some reason it's negotiated something slower. But you can *detect* that it's connected as a USB1 device and refuse to mount it, surely? And then the user will unplug it and plug it in again, until it works correctly.
On Sun, Jun 16, 2013 at 10:11:42PM +0100, David Woodhouse wrote:
On Sun, 2013-06-16 at 05:38 +0100, Matthew Garrett wrote:
On Sat, Jun 15, 2013 at 08:24:33AM -0700, John Reiser wrote:
How can I force the system not to recognize a USB2.0 flash memory
device at USB1.1 speed?
You can't - it's negotiated at the host controller level, the OS isn't involved.
You can't force it to use USB2 mode when for some reason it's negotiated something slower. But you can *detect* that it's connected as a USB1 device and refuse to mount it, surely? And then the user will unplug it and plug it in again, until it works correctly.
Yeah, I guess you could write a udev rule that detected that case and flagged it such that it didn't get automounted.
On Sun, 2013-06-16 at 22:33 +0100, Matthew Garrett wrote:
On Sun, Jun 16, 2013 at 10:11:42PM +0100, David Woodhouse wrote:
On Sun, 2013-06-16 at 05:38 +0100, Matthew Garrett wrote:
On Sat, Jun 15, 2013 at 08:24:33AM -0700, John Reiser wrote:
How can I force the system not to recognize a USB2.0 flash memory
device at USB1.1 speed?
You can't - it's negotiated at the host controller level, the OS isn't involved.
You can't force it to use USB2 mode when for some reason it's negotiated something slower. But you can *detect* that it's connected as a USB1 device and refuse to mount it, surely? And then the user will unplug it and plug it in again, until it works correctly.
Yeah, I guess you could write a udev rule that detected that case and flagged it such that it didn't get automounted.
IIRC, Windows pops up one of its little yellow warnings associated with a notification tray icon when this happens - the medium is mounted but you get a warning that it's running at a slow speed. That seems reasonable.
Hi,
On 06/17/2013 10:37 PM, Adam Williamson wrote:
On Sun, 2013-06-16 at 22:33 +0100, Matthew Garrett wrote:
On Sun, Jun 16, 2013 at 10:11:42PM +0100, David Woodhouse wrote:
On Sun, 2013-06-16 at 05:38 +0100, Matthew Garrett wrote:
On Sat, Jun 15, 2013 at 08:24:33AM -0700, John Reiser wrote:
How can I force the system not to recognize a USB2.0 flash memory
device at USB1.1 speed?
You can't - it's negotiated at the host controller level, the OS isn't involved.
You can't force it to use USB2 mode when for some reason it's negotiated something slower. But you can *detect* that it's connected as a USB1 device and refuse to mount it, surely? And then the user will unplug it and plug it in again, until it works correctly.
Yeah, I guess you could write a udev rule that detected that case and flagged it such that it didn't get automounted.
IIRC, Windows pops up one of its little yellow warnings associated with a notification tray icon when this happens - the medium is mounted but you get a warning that it's running at a slow speed. That seems reasonable.
And IIRC the kernel will log a message when plugging a usb-2 device into a port which is not usb-2 capable. But if I understand correctly, that is not the issue here?
The issue seems to be that sometimes a usb-2 device connects at usb-1 speed even though plugged into a usb-2 port, right ?
That is just buggy hardware, and I don't think that warrants any special handling. I would try cleaning the contacts of both the usb-port and the usb-stick. Also if a usb-extension cable is involved, try replacing it, or taking it out of the loop all-together.
I've seen similar issue in the past and sofar it has always been bad hardware.
Sometimes things like cleaning contacts help, sometimes the contacts on the usb-port side are simply worn out / too loose.
Regards,
Hans
On Tue, 2013-06-18 at 08:26 +0200, Hans de Goede wrote:
Hi,
On 06/17/2013 10:37 PM, Adam Williamson wrote:
On Sun, 2013-06-16 at 22:33 +0100, Matthew Garrett wrote:
On Sun, Jun 16, 2013 at 10:11:42PM +0100, David Woodhouse wrote:
On Sun, 2013-06-16 at 05:38 +0100, Matthew Garrett wrote:
On Sat, Jun 15, 2013 at 08:24:33AM -0700, John Reiser wrote:
How can I force the system not to recognize a USB2.0 flash memory
device at USB1.1 speed?
You can't - it's negotiated at the host controller level, the OS isn't involved.
You can't force it to use USB2 mode when for some reason it's negotiated something slower. But you can *detect* that it's connected as a USB1 device and refuse to mount it, surely? And then the user will unplug it and plug it in again, until it works correctly.
Yeah, I guess you could write a udev rule that detected that case and flagged it such that it didn't get automounted.
IIRC, Windows pops up one of its little yellow warnings associated with a notification tray icon when this happens - the medium is mounted but you get a warning that it's running at a slow speed. That seems reasonable.
And IIRC the kernel will log a message when plugging a usb-2 device into a port which is not usb-2 capable. But if I understand correctly, that is not the issue here?
Oh yeah, that might be the Windows warning I'm remembering.
The issue seems to be that sometimes a usb-2 device connects at usb-1 speed even though plugged into a usb-2 port, right ?
AIUI, yes.
That is just buggy hardware, and I don't think that warrants any special handling. I would try cleaning the contacts of both the usb-port and the usb-stick. Also if a usb-extension cable is involved, try replacing it, or taking it out of the loop all-together.
Well, yes, those are all perfectly sensible steps: I think the idea of the OP was to alert people that this was happening precisely so they could take the sensible debugging steps :)
On 06/15/2013 09:38 PM, Matthew Garrett wrote:
On Sat, Jun 15, 2013 at 08:24:33AM -0700, John Reiser wrote:
How can I force the system not to recognize a USB2.0 flash memory device at USB1.1 speed?
You can't - it's negotiated at the host controller level, the OS isn't involved.
Thus after the host controller hardware negotiates a slow connection, then perhaps a udev rule might detect (see "lsusb -v"): bcdUSB < 2.00 bInterfaceClass = 8 Mass Storage bInterfaceProtocol = 80 Bulk (Zip) and raise a warning for me. Or perhaps I should consider working with the dbus, or (depending on the desktop environment) enhancing the auto- mounting apparatus. I really dislike USB storage at only 1.5MB/s.