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

Commit c92a72a8 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: composite: Send stall when no config is active



Whenever composition switch happens, android driver stops data transfers &
removes configuation before disabling pullup. Due to this, there is small
window during which pullup is active and device ends up sending device
descriptor with zero confiurations in certain scenarios of Host PC reboot.
Hence fix the issue by stalling control endpoint in this scenario.

Change-Id: I3d3c0321d9311617c6ee492c55809f36de6ae412
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent cfd42c3b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1628,6 +1628,12 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
		case USB_DT_DEVICE:
			cdev->desc.bNumConfigurations =
				count_configs(cdev, USB_DT_DEVICE);
			if (cdev->desc.bNumConfigurations == 0) {
				pr_err("%s:config is not active. send stall\n",
								__func__);
				break;
			}

			cdev->desc.bMaxPacketSize0 =
				cdev->gadget->ep0->maxpacket;
			if (gadget_is_superspeed(gadget)) {