Skip to content

Commit

Permalink
usb: dwc3: gadget: ignore endpoint IRQs when endpoint is disabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Balbi committed Jun 6, 2012
1 parent 1e2360e commit 3336abb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,9 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,

dep = dwc->eps[epnum];

if (!(dep->flags & DWC3_EP_ENABLED))
return;

dev_vdbg(dwc->dev, "%s: %s\n", dep->name,
dwc3_ep_event_string(event->endpoint_event));

Expand Down

0 comments on commit 3336abb

Please sign in to comment.