Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e8f2630 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Ajay Agarwal
Browse files

USB: core: Add USB_DEVICE_ERROR uevent for enumeration timeout



Some userspace modules expect USB driver to send event to userspace, when
usb device enumeration failure with device descriptor read errors.
Add USB_DEVICE_ERROR uevent in the USB driver to explicitly send the ERROR
uevent for such case.

Change-Id: I7128869ff0700ab90d4c949de24cd03c5c90e22e
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent b0ba6e47
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4294,6 +4294,8 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
	enum usb_device_speed	oldspeed = udev->speed;
	const char		*speed;
	int			devnum = udev->devnum;
	char			*error_event[] = {
				"USB_DEVICE_ERROR=Device_No_Response", NULL };

	/* root hub ports have a slightly longer reset period
	 * (from USB 2.0 spec, section 7.1.7.5)
@@ -4467,6 +4469,8 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
				if (r != -ENODEV)
					dev_err(&udev->dev, "device descriptor read/64, error %d\n",
							r);
				kobject_uevent_env(&udev->parent->dev.kobj,
						KOBJ_CHANGE, error_event);
				retval = -EMSGSIZE;
				continue;
			}
@@ -4519,6 +4523,8 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
				dev_err(&udev->dev,
					"device descriptor read/8, error %d\n",
					retval);
			kobject_uevent_env(&udev->parent->dev.kobj,
						KOBJ_CHANGE, error_event);
			if (retval >= 0)
				retval = -EMSGSIZE;
		} else {