Add extra hub_port_reset for MTK USB virtual hub MTK's USB virtual hub is at a wrong state after a software reset. Thus hub_port_init times out while waiting for the descriptor, causing a >4s delay per TPU engine initialization. Adding an extra hub_port_reset seems to put the hub back to the correct state, and cuts the response time to <1s to get the descriptor after the reset. Change-Id: If1e17fe2a71f49784ee0b9e8fc0b16f7d06753ec
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index fa28f23..2c31a47 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c
@@ -4645,6 +4645,16 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, continue; } + // Extra reset is required for musbfsh-hdrc on software reset. + if (udev->config && + strncmp(driver_name, "musbfsh-hdrc", strlen(driver_name)) == 0) { + dev_info(&udev->dev, "%s %d: extra reset for musbfsh-hdrc\n", + __func__, __LINE__); + retval = hub_port_reset(hub, port1, udev, delay, false); + if (retval < 0) /* error or disconnect */ + goto fail; + } + /* Retry on all errors; some devices are flakey. * 255 is for WUSB devices, we actually need to use * 512 (WUSB1.0[4.8.1]).