From a881000cd1d5df26f512e4ce7a1a1a6161a8b636 Mon Sep 17 00:00:00 2001 From: Yunzhi Li Date: Fri, 28 Aug 2015 09:43:44 +0800 Subject: libpayload: usb: dwc2: fix hub hot-plug bug When disconnect is detected in dwc2_split_transfer() the split configuration registers should be cleared before return. BRANCH=None BUG=chrome-os-partner:44534 TEST=On Jerry, usb hot plug works with devices behind hubs Signed-off-by: Patrick Georgi Original-Commit-Id: 37594d8b4490b6d393d19d17d8e497db7de8817d Original-Change-Id: Ie1eecec067305874513c6ceb95df4240dc393cd6 Original-Signed-off-by: Yunzhi Li Original-Reviewed-on: https://chromium-review.googlesource.com/295625 Original-Reviewed-by: David Hendricks Original-Reviewed-by: Julius Werner Original-Commit-Queue: Lin Huang Original-Tested-by: Lin Huang Original-(cherry picked from commit d543e14cdc73bd549dd553c8d1d07672a1307981) Original-Reviewed-on: https://chromium-review.googlesource.com/299700 Original-Commit-Ready: David Hendricks Original-Tested-by: David Hendricks Change-Id: Ib4604097743f2f9d763b29ee27f3bc1788a85a62 Reviewed-on: http://review.coreboot.org/11661 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- payloads/libpayload/drivers/usb/dwc2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'payloads/libpayload/drivers') diff --git a/payloads/libpayload/drivers/usb/dwc2.c b/payloads/libpayload/drivers/usb/dwc2.c index 30e00fba64..0941eb64d1 100644 --- a/payloads/libpayload/drivers/usb/dwc2.c +++ b/payloads/libpayload/drivers/usb/dwc2.c @@ -323,8 +323,10 @@ dwc2_split_transfer(endpoint_t *ep, int size, int pid, ep_dir_t dir, do { hfnum.d32 = readl(®->host.hfnum); - if (dwc2_disconnected(ep->dev->controller)) - return -HCSTAT_DISCONNECTED; + if (dwc2_disconnected(ep->dev->controller)) { + ret = -HCSTAT_DISCONNECTED; + goto out; + } } while (hfnum.frnum % 8 != 0); /* Handle Start-Split */ -- cgit v1.2.3