[PATCH] usb: common: Detect USB storage media with "miscellaneous" USB devices

Christian Kohlschütter christian at kohlschutter.com
Mon Sep 26 23:55:47 CEST 2022


On 26. Sep 2022, at 01:45, Marek Vasut <marex at denx.de> wrote:
> 
> On 9/25/22 16:46, Christian Kohlschütter wrote:
>> When detecting USB storage devices, we currently skip everything that is
>> not marked as "undefined device class".
>> Composite devices such as tinyusb's CDC+MSC identify as "miscellaneous"
>> (class 0xEF).
>> Introduce a new constant, USB_CLASS_MISC (0xEF), and allow the detection
>> process to proceed for USB devices with this device class.
> 
> What does Linux do with such a device , is there a specific quirk or does it simply not check the bDeviceClass at all ?

I didn't see any  relevant checks in drivers/usb/storage, however changing the bDeviceClass from "MISC" (0xEF) to "UNSPECIFIED"/"PER_INTERFACE" (0x00) causes the device to be no longer detected by either Linux or macOS, but it would work with U-Boot (i.e., without the change).

macOS' USB prober would report the USB device as "unconfigured". On Linux, using usbutils but not busybox, lsusb would actually hang.

I think it's a good idea to keep the set of permitted device classes to a minimum (0x00 / 0xEF) and abort early in all other cases. This way, we can skip the more elaborate checks in usb_storage_probe for devices that are definitely not supported.



More information about the U-Boot mailing list