Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4c3da1c authored by Sriharsha Allenki's avatar Sriharsha Allenki
Browse files

usb: dwc3: Fix continuous spurious interrupts



The controller may keep the interrupt line asserted
even when the software acknowledged the interrupt
by reading the GEVNTCOUNT and writing the processed
bytes. This can lead to a storm of spurious interrupts
and software hogging the CPU.
The databook (DWC3 3.00A - Section 6.3.57) suggests
to read the GEVNTCOUNT in this case of continuous interrupts.
Hence, fix the same by reading the GEVNTCOUNT when the
controller is being halted and interrupts are seen.

Change-Id: Ifc7b29d51ebb75cc79ab410379646c0c0337bdc0
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent 43f98ecf
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -3754,7 +3754,15 @@ static irqreturn_t dwc3_check_event_buf(struct dwc3_event_buffer *evt)

	/* Controller is being halted, ignore the interrupts */
	if (!dwc->pullups_connected) {
		dbg_event(0xFF, "NO_PULLUP", 0);
		/*
		 * Even with controller halted, there is a possibility
		 * that the interrupt line is kept asserted.
		 * As per the databook (3.00A - 6.3.57) read the GEVNTCOUNT
		 * to ensure that the interrupt line is de-asserted.
		 */
		count = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0));
		count &= DWC3_GEVNTCOUNT_MASK;
		dbg_event(0xFF, "NO_PULLUP", count);
		return IRQ_HANDLED;
	}