aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-06-06 02:19:35 -0400
committerFelipe Balbi <balbi@ti.com>2012-06-06 04:22:32 -0400
commit3336abb5b608300550136ddab7a7101b30d45fa7 (patch)
treee3f32bae199ed50cc5a8cca8c5cc313b8e52e739 /drivers/usb/dwc3
parent1e2360eadaa33c09bb72afb14f74b6c6ab2aca66 (diff)
usb: dwc3: gadget: ignore endpoint IRQs when endpoint is disabled
By the time we're disabling the endpoint, HW could already have posted more events to our event buffer. In that case, we will receive endpoint events for a disabled endpoint. In order to protect ourselves from that situation, we simply ignore endpoint interrupts whenever the endpoint is disabled. Tested-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 52d0f67e33d5..8e00756ee522 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1768,6 +1768,9 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
1768 1768
1769 dep = dwc->eps[epnum]; 1769 dep = dwc->eps[epnum];
1770 1770
1771 if (!(dep->flags & DWC3_EP_ENABLED))
1772 return;
1773
1771 dev_vdbg(dwc->dev, "%s: %s\n", dep->name, 1774 dev_vdbg(dwc->dev, "%s: %s\n", dep->name,
1772 dwc3_ep_event_string(event->endpoint_event)); 1775 dwc3_ep_event_string(event->endpoint_event));
1773 1776