Re: [PATCH 1/3] usbcore: Add quirk for 255-bytes initial config read
Greg KH <[email protected]>
| Newsgroups | org.kernel.vger.linux-input,org.kernel.vger.linux-usb,org.kernel.vger.stable |
|---|---|
| Message-ID | <2026072612-ungreased-repulsive-d992@gregkh> |
On Sun, Jul 26, 2026 at 06:50:38PM +0530, Ishaan Dandekar wrote: > From: Nikhil Solanke <[email protected]> > > Certain third-party USB game controllers exposing (or spoofing) an Xbox > 360-compatible interface (VID:PID 045e:028e) fail to enumerate under Linux. > The device disconnects from the bus without responding to the initial > GET_DESCRIPTOR(CONFIGURATION) request, and the kernel logs 'unable to read > config index 0 descriptor/start: -71'. > > The device then falls back to a secondary Android HID mode (with a > different VID:PID), losing XInput functionality including rumble support. > The failure reproduces across multiple machines, host controller types, and > kernel versions including current mainline and LTS. The device enumerates > correctly and remains in XInput mode under Windows. Notably, the device > enumerates correctly in Android mode when the same 9-byte request > is issued for that mode's configuration descriptor, confirming the firmware > bug is specific to the XInput mode. > > usbmon traces from Linux and Wireshark/USBPcap traces from Windows are > identical up to the point of failure, with no visible protocol-level > difference explaining the divergence. The root cause was identified when > Michal Pecio discovered via a QEMU bus-level capture that Windows does not > use wLength=9 for the initial config descriptor request; it uses > wLength=255. Alan Stern subsequently confirmed this with a bus > analyzer on a different USB 2.0 device, and Michal verified the behavior > goes back to Windows 95 OSR2.1. > > So, add a new quirk flag USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE which causes > usb_get_configuration() to issue a 255 byte sized configuration request > instead of USB_DT_CONFIG_SIZE (9) for the initial > GET_DESCRIPTOR(CONFIGURATION) request, mimicking long-standing Windows > behavior. > > Suggested-by: Alan Stern <[email protected]> > Suggested-by: Michal Pecio <[email protected]> > Closes: https://lore.kernel.org/linux-usb/CAFgddh+JWdT4LLwMc5qjM8q_pBu-fRo2qADR5ovAKoGHWMQrRw@mail.gmail.com/ > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: [email protected] > Signed-off-by: Nikhil Solanke <[email protected]> > --- > .../admin-guide/kernel-parameters.txt | 10 +++++ > drivers/usb/core/config.c | 39 +++++++++++++++---- > drivers/usb/core/quirks.c | 4 ++ > include/linux/usb/quirks.h | 3 ++ > 4 files changed, 49 insertions(+), 7 deletions(-) Cool, but you can't send on someone else's patch without also signing off on it :) thanks, greg k-h