Skip to contentSkip to conversation

usbcore: Add quirk for 255-byte initial config read

PATCH In review Nikhil Solanke 3 participants 9 messages Jul 17 – Jul 27

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover usbcore: Add quirk for 255-byte initial config read

This series adds a quirk for USB devices that fail enumeration when the initial GET_DESCRIPTOR(CONFIGURATION) request uses wLength=9.

Patch 1 adds USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE which causes usb_get_configuration() to use wLength=255 for the initial config descriptor request, mirroring long-standing Windows behavior.

Patch 2 splits announce_device() to log device identity before enumeration, improving failure diagnosis.

Nikhil Solanke (2):
usbcore: Add quirk for 255-bytes initial config read
USB: hub: Split announce_device() to log device identity before
enumeration

 .../admin-guide/kernel-parameters.txt         | 10 +++++
 drivers/usb/core/config.c                     | 39 +++++++++++++++----
 drivers/usb/core/hub.c                        | 16 ++++++--
 drivers/usb/core/quirks.c                     |  4 ++
 include/linux/usb/quirks.h                    |  3 ++
 5 files changed, 61 insertions(+), 11 deletions(-)
Signature · 1 line
2.55.0
#1 lore raw

PATCH 1/2 usbcore: Add quirk for 255-bytes initial config read

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.

---
 .../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(-)
Documentation/admin-guide/kernel-parameters.txt +10 -0
index b5493a7f8f22..14121458a0c0 100644
@@ -8169,6 +8169,16 @@ Kernel parameters
 				q = USB_QUIRK_FORCE_ONE_CONFIG (Device
 					claims zero configurations,
 					forcing to 1);
+				r = USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE (Device
+					fails during initialization when asked for
+					9-bytes configuration descriptor request.
+					Ask for 255-bytes request instead to mirror
+					Windows' behavior. This quirk is originally
+					meant to fix some quirky gamepads that refuse
+					to connect in their XInput mode. But it can
+					also potentially fix issues with other USB
+					devices that work on Windows but not on
+					Linux);
 			Example: quirks=0781:5580:bk,0a5c:5834:gij
 
 	usbhid.mousepoll=
drivers/usb/core/config.c +32 -7
index 45e20c6d76c0..442c15f92ccd 100644
@@ -912,6 +912,17 @@ int usb_get_configuration(struct usb_device *dev)
 	unsigned char *bigbuffer;
 	struct usb_config_descriptor *desc;
 	int result;
+	size_t usb_config_req_size;
+
+	/*
+	 * Devices with quirky firmware will stall or reset when the initial
+	 * config descriptor request uses wLength=9. If the quirk is set, use
+	 * 255 instead, mirroring the behavior of Windows.
+	 */
+	if (dev->quirks & USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE)
+		usb_config_req_size = 255;
+	else
+		usb_config_req_size = USB_DT_CONFIG_SIZE;
 
 	if (ncfg > USB_MAXCONFIG) {
 		dev_notice(ddev, "too many configurations: %d, "
@@ -938,15 +949,19 @@ int usb_get_configuration(struct usb_device *dev)
 	if (!dev->rawdescriptors)
 		return -ENOMEM;
 
-	desc = kmalloc(USB_DT_CONFIG_SIZE, GFP_KERNEL);
+	desc = kmalloc(usb_config_req_size, GFP_KERNEL);
 	if (!desc)
 		return -ENOMEM;
 
 	for (cfgno = 0; cfgno < ncfg; cfgno++) {
-		/* We grab just the first descriptor so we know how long
-		 * the whole configuration is */
+		/*
+		 * Normally we request only the configuration descriptor header
+		 * so we can determine the total configuration length. For
+		 * devices with USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE set, try to
+		 * grab the full descriptor set instead.
+		 */
 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
-		    desc, USB_DT_CONFIG_SIZE);
+		    desc, usb_config_req_size);
 		if (result < 0) {
 			dev_err(ddev, "unable to read config index %d "
 			    "descriptor/%s: %d\n", cfgno, "start", result);
@@ -956,9 +971,8 @@ int usb_get_configuration(struct usb_device *dev)
 			dev->descriptor.bNumConfigurations = cfgno;
 			break;
 		} else if (result < 4) {
-			dev_err(ddev, "config index %d descriptor too short "
-			    "(expected %i, got %i)\n", cfgno,
-			    USB_DT_CONFIG_SIZE, result);
+			dev_err(ddev, "config index %d descriptor too short (asked for %zu, got %i, need at least %i)\n",
+			    cfgno, usb_config_req_size, result, 4);
 			result = -EINVAL;
 			goto err;
 		}
@@ -972,6 +986,16 @@ int usb_get_configuration(struct usb_device *dev)
 			goto err;
 		}
 
+		/*
+		 * If the device returns the full configuration descriptor set,
+		 * skip the second read. Otherwise, send a second request
+		 * asking for the full set.
+		 */
+		if (result >= length) {
+			memcpy(bigbuffer, desc, length);
+			goto store_and_parse;
+		}
+
 		if (dev->quirks & USB_QUIRK_DELAY_INIT)
 			msleep(200);
 
@@ -989,6 +1013,7 @@ int usb_get_configuration(struct usb_device *dev)
 			length = result;
 		}
 
+store_and_parse:
 		dev->rawdescriptors[cfgno] = bigbuffer;
 
 		result = usb_parse_configuration(dev, cfgno,
drivers/usb/core/quirks.c +4 -0
index 87ee2d938bc0..f5a60ccf21d3 100644
@@ -142,6 +142,10 @@ static int quirks_param_set(const char *value, const struct kernel_param *kp)
 				break;
 			case 'q':
 				flags |= USB_QUIRK_FORCE_ONE_CONFIG;
+				break;
+			case 'r':
+				flags |= USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE;
+				break;
 			/* Ignore unrecognized flag characters */
 			}
 		}
include/linux/usb/quirks.h +3 -0
index b3cc7beab4a3..a4043b33c2c2 100644
@@ -81,4 +81,7 @@
 /* Device claims zero configurations, forcing to 1 */
 #define USB_QUIRK_FORCE_ONE_CONFIG		BIT(18)
 
+/* Use a 255 bytes config descriptor request mirroring windows behavior */
+#define USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE	BIT(19)
+
 #endif /* __LINUX_USB_QUIRKS_H */
Signature · 1 line
2.55.0
#2 lore raw

Re: [PATCH 1/2] usbcore: Add quirk for 255-bytes initial config read

Quoted 30 lines · Nikhil Solanke

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.

Quoted 7 lines

---

The code looks generally correct now. Some small issues noted below.

Quoted 14 lines
 .../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(-)
Documentation/admin-guide/kernel-parameters.txt +0 -0
index b5493a7f8f22..14121458a0c0 100644
@@ -8169,6 +8169,16 @@ Kernel parameters
 				q = USB_QUIRK_FORCE_ONE_CONFIG (Device
 					claims zero configurations,
 					forcing to 1);

Documentation/admin-guide/kernel-parameters.txt Kernel parameters · line 8181

Quoted 10 lines
Documentation/admin-guide/kernel-parameters.txt +10 -0
+				r = USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE (Device
+					fails during initialization when asked for
+					9-bytes configuration descriptor request.
+					Ask for 255-bytes request instead to mirror
+					Windows' behavior. This quirk is originally
+					meant to fix some quirky gamepads that refuse
+					to connect in their XInput mode. But it can
+					also potentially fix issues with other USB
+					devices that work on Windows but not on
+					Linux);

I still think this text is needlessly long. Could be:

r = USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE (Device
doesn't respond to 9-byte configuration descriptor requests, ask for 255 bytes like Windows does. Required by some gamepads);

Quoted 8 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
 			Example: quirks=0781:5580:bk,0a5c:5834:gij
 
 	usbhid.mousepoll=
drivers/usb/core/config.c +0 -0
index 45e20c6d76c0..442c15f92ccd 100644

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 918

Quoted 7 lines
drivers/usb/core/config.c +4 -0
@@ -912,6 +912,17 @@ int usb_get_configuration(struct usb_device *dev)
 	unsigned char *bigbuffer;
 	struct usb_config_descriptor *desc;
 	int result;
+	size_t usb_config_req_size;
+
+	/*
+	 * Devices with quirky firmware will stall or reset when the initial

Has anyone actually seen a device that stalls?

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 921

Quoted 3 lines
drivers/usb/core/config.c +3 -0
+	 * config descriptor request uses wLength=9. If the quirk is set, use
+	 * 255 instead, mirroring the behavior of Windows.
+	 */

If the USB_DT_CONFIG_SIZE constant is moved here then it could make sense to also move the related comment and merge with this one. Say,

/*
* We start with grabbing the first descriptor so we know how
* long the whole configuration is. Some devices don't respond,
* request 255 bytes instead, mirroring the behavior of Windows. */

Quoted 15 lines
drivers/usb/core/config.c +5 -1
+	if (dev->quirks & USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE)
+		usb_config_req_size = 255;
+	else
+		usb_config_req_size = USB_DT_CONFIG_SIZE;
 
 	if (ncfg > USB_MAXCONFIG) {
 		dev_notice(ddev, "too many configurations: %d, "
@@ -938,15 +949,19 @@ int usb_get_configuration(struct usb_device *dev)
 	if (!dev->rawdescriptors)
 		return -ENOMEM;
 
-	desc = kmalloc(USB_DT_CONFIG_SIZE, GFP_KERNEL);
+	desc = kmalloc(usb_config_req_size, GFP_KERNEL);
 	if (!desc)
 		return -ENOMEM;

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 962

Quoted 10 lines
drivers/usb/core/config.c +6 -2
 
 	for (cfgno = 0; cfgno < ncfg; cfgno++) {
-		/* We grab just the first descriptor so we know how long
-		 * the whole configuration is */
+		/*
+		 * Normally we request only the configuration descriptor header
+		 * so we can determine the total configuration length. For
+		 * devices with USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE set, try to
+		 * grab the full descriptor set instead.
+		 */

... and then this comment wouldn't really be necessary, or it could be shorter like

		/* First request for an initial prefix */

Also, the full descriptor set may be up to 65535 bytes long and in some classes like UVC it commonly exceeds 255 bytes

Quoted 7 lines
drivers/usb/core/config.c +1 -1
 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
-		    desc, USB_DT_CONFIG_SIZE);
+		    desc, usb_config_req_size);
 		if (result < 0) {
 			dev_err(ddev, "unable to read config index %d "
 			    "descriptor/%s: %d\n", cfgno, "start", result);

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 975

Quoted 8 lines
drivers/usb/core/config.c +2 -3
@@ -956,9 +971,8 @@ int usb_get_configuration(struct usb_device *dev)
 			dev->descriptor.bNumConfigurations = cfgno;
 			break;
 		} else if (result < 4) {
-			dev_err(ddev, "config index %d descriptor too short "
-			    "(expected %i, got %i)\n", cfgno,
-			    USB_DT_CONFIG_SIZE, result);
+			dev_err(ddev, "config index %d descriptor too short (asked for %zu, got %i, need at least %i)\n",
+			    cfgno, usb_config_req_size, result, 4);

There is no need to use %i if you always pass a constant 4.

There is probably no need to print "need at least 4" at all. Users don't care that we request 9 or 255 bytes but tolarate just 4.

No compliant device will ever respond with less than 9, so it's not clear if accepting 4 is even necessary for some very bad devices, or was merely done out of paranoia. It's an irrelevant detail.

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 993

Quoted 12 lines
drivers/usb/core/config.c +5 -0
 			result = -EINVAL;
 			goto err;
 		}
@@ -972,6 +986,16 @@ int usb_get_configuration(struct usb_device *dev)
 			goto err;
 		}
 
+		/*
+		 * If the device returns the full configuration descriptor set,
+		 * skip the second read. Otherwise, send a second request
+		 * asking for the full set.
+		 */

There is already a comment about "getting the whole thing" a few lines above, so half of this is redundant.

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 998

Quoted 5 lines
drivers/usb/core/config.c +5 -0
+		if (result >= length) {
+			memcpy(bigbuffer, desc, length);
+			goto store_and_parse;
+		}
+

Even if no device currently uses both quirks, I think this belongs after the msleep() below, to minimize interaction between the quirks.

Quoted 41 lines
drivers/usb/core/config.c +1 -0
 		if (dev->quirks & USB_QUIRK_DELAY_INIT)
 			msleep(200);
 
@@ -989,6 +1013,7 @@ int usb_get_configuration(struct usb_device *dev)
 			length = result;
 		}
 
+store_and_parse:
 		dev->rawdescriptors[cfgno] = bigbuffer;
 
 		result = usb_parse_configuration(dev, cfgno,
drivers/usb/core/quirks.c +4 -0
index 87ee2d938bc0..f5a60ccf21d3 100644
@@ -142,6 +142,10 @@ static int quirks_param_set(const char *value, const struct kernel_param *kp)
 				break;
 			case 'q':
 				flags |= USB_QUIRK_FORCE_ONE_CONFIG;
+				break;
+			case 'r':
+				flags |= USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE;
+				break;
 			/* Ignore unrecognized flag characters */
 			}
 		}
include/linux/usb/quirks.h +3 -0
index b3cc7beab4a3..a4043b33c2c2 100644
@@ -81,4 +81,7 @@
 /* Device claims zero configurations, forcing to 1 */
 #define USB_QUIRK_FORCE_ONE_CONFIG		BIT(18)
 
+/* Use a 255 bytes config descriptor request mirroring windows behavior */
+#define USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE	BIT(19)
+
 #endif /* __LINUX_USB_QUIRKS_H */
Signature · 1 line
2.55.0
#3 lore raw

Re: [PATCH 1/2] usbcore: Add quirk for 255-bytes initial config read

Quoted 6 lines · Michal Pecio
Quoted 6 lines
drivers/usb/core/config.c +0 -0
index 45e20c6d76c0..442c15f92ccd 100644
@@ -912,6 +912,17 @@ int usb_get_configuration(struct usb_device *dev)
      unsigned char *bigbuffer;
Quoted 9 lines

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 918

Quoted 6 lines
drivers/usb/core/config.c +4 -0
      struct usb_config_descriptor *desc;
      int result;
+     size_t usb_config_req_size;
+
+     /*
+      * Devices with quirky firmware will stall or reset when the initial

Has anyone actually seen a device that stalls?

Regarding the "stall" wording, I was referring to the condition where they fail with -EPIPE error when these devices are connected through external usb hubs. The directly connected devices I've tested typically fail with -EPROTO instead. I'm happy to reword the comment if you think that would make it clearer.

Quoted 6 lines

Even if no device currently uses both quirks, I think this belongs after the msleep() below, to minimize interaction between the quirks.

Quoted 3 lines
drivers/usb/core/config.c +0 -0
              if (dev->quirks & USB_QUIRK_DELAY_INIT)
                      msleep(200);
 

Alright I'll address this change in next revision.

For the remaining comment and log message wording, I'd prefer to keep the current version for now unless there's a strong objection. The patch has already gone through several review rounds and I'd like to avoid extending the review cycle further over comment phrasing, especially since the implementation itself now seems to be in good shape.

Thanks,
Nikhil Solanke

#4 lore raw

Re: [PATCH 1/2] usbcore: Add quirk for 255-bytes initial config read

Quoted 6 lines · Nikhil Solanke

For the remaining comment and log message wording, I'd prefer to keep the current version for now unless there's a strong objection. The patch has already gone through several review rounds and I'd like to avoid extending the review cycle further over comment phrasing, especially since the implementation itself now seems to be in good shape.

I strongly agree with Michal; the comments are overly long and contain information that the reader doesn't need to know. You don't have to use the exact wording in his suggestions, but something like it would be a big improvement.

Alan Stern

#5 lore raw

Re: [PATCH 1/2] usbcore: Add quirk for 255-bytes initial config read

Quoted 9 lines · Alan Stern
Quoted 6 lines · Nikhil Solanke

For the remaining comment and log message wording, I'd prefer to keep the current version for now unless there's a strong objection. The patch has already gone through several review rounds and I'd like to avoid extending the review cycle further over comment phrasing, especially since the implementation itself now seems to be in good shape.

Quoted 6 lines

I strongly agree with Michal; the comments are overly long and contain information that the reader doesn't need to know. You don't have to use the exact wording in his suggestions, but something like it would be a big improvement.

Alan Stern

Alright I'll do those changes too then.

Thanks,
Nikhil Solanke

#6 lore raw

Re: [PATCH 1/2] usbcore: Add quirk for 255-bytes initial config read

In reply to Nikhil Solanke
Quoted 5 lines · Nikhil Solanke

Regarding the "stall" wording, I was referring to the condition where they fail with -EPIPE error when these devices are connected through external usb hubs. The directly connected devices I've tested typically fail with -EPROTO instead. I'm happy to reword the comment if you think that would make it clearer.

Understood.

The reason you see -EPIPE is due to the marvel of technology which is "transaction translators" in USB 2.0 hubs. They report low/full-speed protocol errors with STALL handshake on the high-speed bus, even though a new ERR handshake is also defined and used for similar errors on interrupt endpoints only.

So your device doesn't stall, it just disconnects as usual. And with a USB 1.0 hub you would see -EPROTO too, but these are rare today.

My habit is to make code comments generic - I don't know what devices will use this quirk in the future, so just write something that likely applies to all of them - "break", "malfunction", "fail to respond". But I also describe precisely what problem the quirk was meant to solve in the commit, so the information can be found with "git blame".

Regards,
Michal

#7 lore raw

PATCH 2/2 USB: hub: Split announce_device() to log device identity before enumeration

In reply to Nikhil Solanke

announce_device() currently logs the device VID:PID and string descriptors only after successful enumeration. This means that if enumeration fails, no identifying information about the device appears in the kernel log, making it difficult to diagnose failures.

Split announce_device() into announce_device_ids(), which logs the VID:PID and bcdDevice immediately after the device descriptor is read, and announce_device_strings(), which logs the product, manufacturer, and serial number strings after successful enumeration. This ensures that a device's identity is always visible in the log regardless of whether enumeration succeeds or fails.

---
 drivers/usb/core/hub.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/usb/core/hub.c +12 -4
index 5262e11c12cd..d92bf887739d 100644
@@ -2401,7 +2401,7 @@ static void show_string(struct usb_device *udev, char *id, char *string)
 	dev_info(&udev->dev, "%s: %s\n", id, string);
 }
 
-static void announce_device(struct usb_device *udev)
+static void announce_device_ids(struct usb_device *udev)
 {
 	u16 bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice);
 
@@ -2410,6 +2410,10 @@ static void announce_device(struct usb_device *udev)
 		le16_to_cpu(udev->descriptor.idVendor),
 		le16_to_cpu(udev->descriptor.idProduct),
 		bcdDevice >> 8, bcdDevice & 0xff);
+}
+
+static void announce_device_strings(struct usb_device *udev)
+{
 	dev_info(&udev->dev,
 		"New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
 		udev->descriptor.iManufacturer,
@@ -2420,7 +2424,8 @@ static void announce_device(struct usb_device *udev)
 	show_string(udev, "SerialNumber", udev->serial);
 }
 #else
-static inline void announce_device(struct usb_device *udev) { }
+static inline void announce_device_ids(struct usb_device *udev) { }
+static inline void announce_device_strings(struct usb_device *udev) { }
 #endif
 
 
@@ -2651,6 +2656,9 @@ int usb_new_device(struct usb_device *udev)
 		device_init_wakeup(&udev->dev, 0);
 	}
 
+	/* Announce the device identity */
+	announce_device_ids(udev);
+
 	/* Tell the runtime-PM framework the device is active */
 	pm_runtime_set_active(&udev->dev);
 	pm_runtime_get_noresume(&udev->dev);
@@ -2672,8 +2680,8 @@ int usb_new_device(struct usb_device *udev)
 	udev->dev.devt = MKDEV(USB_DEVICE_MAJOR,
 			(((udev->bus->busnum-1) * 128) + (udev->devnum-1)));
 
-	/* Tell the world! */
-	announce_device(udev);
+	/* Announce the device's product, manufacturer and serial number */
+	announce_device_strings(udev);
 
 	if (udev->serial)
 		add_device_randomness(udev->serial, strlen(udev->serial));
Signature · 1 line
2.55.0
#8 lore raw
In reply to Nikhil Solanke

Sorry, forgot to mark this as v3. This should be [PATCH v3 0/2].

Changes from v2:
- put strings in a single line
- copy bytes from desc to bigbuffer instead of pointer aliasing.
- change tabs to spaces in documentation
- reworded some comments
- drop USB_CONFIG_WINDOWS_REQ_SIZE macro
- revert USB_DELAY_INIT to original behavior. no delay before 1st request.
- split announce_device() so we can report device ids early before vendor strings

Thanks,
Nikhil Solanke