From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 379EF2DB78B for ; Tue, 28 Jul 2026 01:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785203965; cv=none; b=NbIO+zJJBSNAUj2TpJtlMCDNPQ4TRKnlBRdimXng6OUGjtxK3KKp8HJSwqmM9eUSZATY7R2uIRvdlYIZ1yVue3MtWZ4yKJ11D8xuT2SO49T/cx095eKro+xwXx3cHv20gNCQIwW3XOzE7b38282kgr4wyotw7+IJUHG4EgwTucM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785203965; c=relaxed/simple; bh=CawxVQkJNWG9UC33bH4B6QtHE3fIWQSW2rF6KQwMMb4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RLqMznN83o6hbR52ymFNHDZixDn4Je6dTjASt8M9selmI18fIN3n2qXBU7MhmO0kx7YvX3dOipU9gPCY5fpK6mGNCEPpVLxfbzK5XwyGC+alFopSwvujQYXWrp5aUkS4uOxUSszLYSiVSoncBGNxDhf//VyNMmwe9A81O1Prono= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rowland.harvard.edu; spf=fail smtp.mailfrom=g.harvard.edu; dkim=pass (2048-bit key) header.d=rowland.harvard.edu header.i=@rowland.harvard.edu header.b=nj62HUlQ; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=g.harvard.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rowland.harvard.edu header.i=@rowland.harvard.edu header.b="nj62HUlQ" Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-51c2a76536bso34357341cf.1 for ; Mon, 27 Jul 2026 18:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rowland.harvard.edu; s=google; t=1785203963; x=1785808763; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=xsIjQv5H0VfbYXJqKAEeCyOCnADFtFqc7MMDYt9Qh0Q=; b=nj62HUlQgh8z7YtRj9LjYQ2IGqVAX+3wuTr5HVhWuDT3J8RQ03uR18aHDmiSHZFrdH t6uyVfkYMh/Czg5fx0WGJertLzsbNPLaT2/bZsQKeSVyT2MFulWqnLEl/VGl44X3dqlA wSTgXoe+1hd+cvsdyUcQLHMarIJnX35XMi8MRn0UKyvehUJfkM+EnXifyqNTA7pAkbIL T1rL4whG/PkOKQCQQ0UssCifs56RwaSc0p8Vhg45bvFc9RZopFQ+lYHIMlOzjFcTjKav srWVa2yBqzjSJlpJ7JkI0BgdsqpxdDsQNJti23XtEr6OveOn0DvbMyAWM2txYlpfrmqU y1rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785203963; x=1785808763; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=xsIjQv5H0VfbYXJqKAEeCyOCnADFtFqc7MMDYt9Qh0Q=; b=o1w6xXlPjgg2/EU7tEIXzqL6AxeTdRvctdx+HUQJzsoTPjVbegXSwYU/l3VcMD6i/Y qOR5fZPvDMIK6VNlbLovRlKjw1RZrqJualz6uWYFb9odXk2qODsxK/OCbHlMJEuZtZls B+So/nzw1yGf5cBeU8A6Td8PmuJhgNpTCHEc1dLfjyD5klmyY3GG4+N0WClEVG0VWfm+ tmlm+j4ySnR8Zukwf01gyrDcZ+ZGQo0YO4waQHW8on/fAmrVswt0xB5A0eWxCU/YsPTC 529S4dGAF7YPjrK58kkuWbK9ovqOhu1oPIsmTkKg3k65VxFQehg+qgHcIP71QGtqVuc/ LOlw== X-Forwarded-Encrypted: i=1; AHgh+RrZW19JxwAG4yWxMRs7Sk7RJlb8/dzh4KR9W2TLpCStKnfJ0pzBnd5ryekocWe35ylt67ScItgy45to4lw=@vger.kernel.org X-Gm-Message-State: AOJu0YxQ9c7f8BQXCd1TsL3EVG2HGlizhBGSiansgjQFMlnP8bp4cXFX nJrAhc04KbSETl4cRQ3HZWHssbpVzUB9W7uTWhkk9T04L8lSiU27MQqtgSjRBXWi2g== X-Gm-Gg: AR+sD11KHC6l3D6tZsnOQdTBqF6Qlj/tfe+J2hZTDjO/zxEI00IXRdCXhZ4AFaTnJoC dhR/pBj3upaGjdeOy+HKm4tDSJTwrLTM3Xk0OZfS0GF2kHG7x65vGoj06ZIocdW1djQna14ZgJx zGUum7XSiH4cvlzv3WI0ENNd7PsqnmUfQJ8z319bUnXindSi8M6wdNNA6b/yMo08zTDuKmQGBhE UCY8mfrQ04vSG+avanVVJ7Hi/LliW2sRfJXgWJRnEZ/lCRYtixRPJfsfdQp1fE6V/EuJXgT+zQm Hrug+D2WcKM7yk/qxfTh36qnKsI0Ssm9hv3NaqrbvXqPLAVrai81PtT9vlMIhefbDNuzAfry/nQ i6u+1T98AWDOltpYIN42G0h0QX1LF9B/GHmIMDfAMH+cUSX5M7uwfu+8d6wwNcnP+W1TpsnEEB4 nl6PE= X-Received: by 2002:ac8:7fcd:0:b0:51a:8835:58cb with SMTP id d75a77b69052e-529d71d8c6emr3037201cf.54.1785203962951; Mon, 27 Jul 2026 18:59:22 -0700 (PDT) Received: from rowland.harvard.edu ([2601:19b:d01:d210::883a]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-907e85215d7sm78094896d6.9.2026.07.27.18.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 18:59:22 -0700 (PDT) Date: Mon, 27 Jul 2026 21:59:19 -0400 From: Alan Stern To: Nikhil Solanke Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, michal.pecio@gmail.com, corbet@lwn.net, skhan@linuxfoundation.org, stable@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v4 1/2] usb: core: Add quirk for 255-bytes initial config read Message-ID: References: <20260727195434.14626-1-nikhilsolanke5@gmail.com> <20260727195434.14626-2-nikhilsolanke5@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260727195434.14626-2-nikhilsolanke5@gmail.com> 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 > Suggested-by: Michal Pecio > Closes: https://lore.kernel.org/linux-usb/CAFgddh+JWdT4LLwMc5qjM8q_pBu-fRo2qADR5ovAKoGHWMQrRw@mail.gmail.com/ > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: stable@vger.kernel.org > Signed-off-by: Nikhil Solanke > --- 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 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