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

Commit 55bd11ba 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>
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 90d7baa9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4368,6 +4368,8 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
	const char		*speed;
	int			devnum = udev->devnum;
	const char		*driver_name;
	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)
@@ -4555,6 +4557,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;
			}
@@ -4607,6 +4611,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 {