[PATCH v5 3/3] usb: hub: send enumeration failure uevent

From: Akshay Gujar

Date: Wed Jul 15 2026 - 07:41:44 EST


Enumeration failure is currently only reported via kernel log.

Emit a KOBJ_CHANGE uevent with DEVICE_ENUMERATION_FAILURE=<dev_name>
when enumeration fails in hub_port_connect().

Signed-off-by: Akshay Gujar <Akshay.Gujar@xxxxxxxxxx>
---
drivers/usb/core/hub.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 5262e11c12cd3..2f2fd90aca66a 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5613,9 +5613,11 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
if (hub->hdev->parent ||
!hcd->driver->port_handed_over ||
!(hcd->driver->port_handed_over)(hcd, port1)) {
- if (status != -ENOTCONN && status != -ENODEV)
+ if (status != -ENOTCONN && status != -ENODEV) {
dev_err(&port_dev->dev,
"unable to enumerate USB device\n");
+ device_enumeration_failure_notify(&port_dev->dev);
+ }
}

done:
--
2.19.0