From f14537663651d7009b66283f3c7e0ad3c5fb55d4 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Thu, 16 Oct 2014 22:17:50 +0800 Subject: [PATCH] MLK-9617-13 usb: core: otg: do quick bus reset after clear connection change This patch changes bus reset time for B host enumuration, from entering B host to the time clear USB_PORT_FEAT_C_CONNECTION, a random time after B host detect port change for A peripheral connection may not work. Signed-off-by: Li Jun (cherry picked from commit b87d3bb0672ebcfb29c7db8708c586b2d38558d1) (cherry picked from commit f3ec1858d5293de28476996a59287b7adb8e9cd2) --- drivers/usb/common/usb-otg-fsm.c | 2 -- drivers/usb/core/hub.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c index e149802e2d1d..0fb9bf9ce36d 100644 --- a/drivers/usb/common/usb-otg-fsm.c +++ b/drivers/usb/common/usb-otg-fsm.c @@ -282,8 +282,6 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state) otg_loc_conn(fsm, 0); otg_loc_sof(fsm, 1); otg_set_protocol(fsm, PROTO_HOST); - usb_bus_start_enum(fsm->otg->host, - fsm->otg->host->otg_port); otg_start_hnp_polling(fsm); break; case OTG_STATE_A_IDLE: diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 948c01fba481..1cad3ea0b048 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1109,6 +1109,10 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) need_debounce_delay = true; usb_clear_port_feature(hub->hdev, port1, USB_PORT_FEAT_C_CONNECTION); +#ifdef CONFIG_USB_OTG + if (hdev->bus->is_b_host) + usb_bus_start_enum(hdev->bus, port1); +#endif } if (portchange & USB_PORT_STAT_C_ENABLE) { need_debounce_delay = true; -- 2.17.1