summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-10-28 11:49:12 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-28 21:07:27 -0700
commit71ad2e16256686441398e6249595c753659b4553 (patch)
treec38320ed90ca9c6d89ff6ff0a3503b1b2cfcce0b /chip
parent3df0f6a8d0212013e1543072be3b79b96133fe39 (diff)
downloadchrome-ec-71ad2e16256686441398e6249595c753659b4553.tar.gz
g: usb: do not invoke reset twice
The RESETDET and USBRST USB interrupt status bits are often set together. There is no point in resetting USB twice. BRANCH=none BUG=none TEST=verified that cr50 still operates fine of Reef and ec and ap consoles are available (still intermittently). Change-Id: I467d975a3a5955b6072a2a3376de7a1501e7c6c5 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/404910 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/g/usb.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/chip/g/usb.c b/chip/g/usb.c
index 1e93b0ac04..43f10f0968 100644
--- a/chip/g/usb.c
+++ b/chip/g/usb.c
@@ -1087,7 +1087,7 @@ static void usb_init_endpoints(void)
static void usb_reset(void)
{
- CPRINTS("%s", __func__);
+ CPRINTS("%s, status %x", __func__, GR_USB_GINTSTS);
print_later("usb_reset()", 0, 0, 0, 0, 0);
/* Clear our internal state */
@@ -1101,14 +1101,6 @@ static void usb_reset(void)
usb_init_endpoints();
}
-static void usb_resetdet(void)
-{
- /* TODO: Same as normal reset, right? I think we only get this if we're
- * suspended (sleeping) and the host resets us. Try it and see. */
- print_later("usb_resetdet()", 0, 0, 0, 0, 0);
- usb_reset();
-}
-
void usb_interrupt(void)
{
uint32_t status = GR_USB_GINTSTS;
@@ -1139,10 +1131,7 @@ void usb_interrupt(void)
print_later("usb_enumdone()", 0, 0, 0, 0, 0);
#endif
- if (status & GINTSTS(RESETDET))
- usb_resetdet();
-
- if (status & GINTSTS(USBRST))
+ if (status & (GINTSTS(RESETDET) | GINTSTS(USBRST)))
usb_reset();
/* Initialize the SOF clock calibrator only on the first SOF */