Re: [PATCH v4 1/2] usb: core: Add quirk for 255-bytes initial config read
From: Alan Stern
Date: Mon Jul 27 2026 - 22:05:18 EST
On Tue, Jul 28, 2026 at 01:24:33AM +0530, Nikhil Solanke wrote:
> 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 <stern@xxxxxxxxxxxxxxxxxxx>
> Suggested-by: Michal Pecio <michal.pecio@xxxxxxxxx>
> Closes: https://lore.kernel.org/linux-usb/CAFgddh+JWdT4LLwMc5qjM8q_pBu-fRo2qADR5ovAKoGHWMQrRw@xxxxxxxxxxxxxx/
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Nikhil Solanke <nikhilsolanke5@xxxxxxxxx>
> ---
Your patches basically looks fine to me. Just a couple of things to
note...
Personally, I prefer to see comments that don't extend beyond the
80-column limit. But there's no hard rule about this, it's just my own
preference -- you don't have to change anything if you don't want to.
Also, it's odd that you add the quirk flag to the kernel without adding
a new quirk entry for the Xbox 360-compatible devices. That doesn't
have to be done in this patch, though; it can be done in a follow-up.
(But note that without a followup this patch doesn't actually fix
anything, since a true fix would require user intervention.)
Finally, a really minor nit: The two patches in this series are
completely independent; either one can be applied without the other.
That means they don't really belong in a series, that is, they should be
submitted as two separate patches. Obviously that doesn't matter at all
in practice; it's just a matter of principle.
Anyway, for both patches 1 and 2:
Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
If you want to rewrite and resubmit them along the lines mentioned
above, you can add my Acked-by to the new submissions.
Alan Stern