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

Commit fa6a954f authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: dwc3: Process event buffer when pullup is disabled



Commit c8ba6a8b ("usb: dwc3: Disable ep0 and interrupts when
clearing run/stop") added functionality to ignore processing of
event buffer if pullup is not enabled. In some cases, it is
observed that pullup is disabled but controller has raised few
endpoint complete events. dwc3_msm_suspend() API aborts USB LPM
sequence if USB event buffer is not empty which would results
into no APPS power collpase. Fix this issue by processing event
buffer when pullup is disabled which clears event buffer.

Change-Id: I45e9ea15c6a2351b8af970f0afef66df609595f6
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 0d88d69d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -3361,6 +3361,12 @@ static void dwc3_process_event_entry(struct dwc3 *dwc,
		return;
	}

	/* If run/stop is cleared don't process any more events */
	if (!dwc->pullups_connected) {
		dbg_print_reg("SKIP_EVT_PULLUP", event->raw);
		return;
	}

	/* Endpoint IRQ, handle it and return early */
	if (event->type.is_devspec == 0) {
		/* depevt */
@@ -3524,12 +3530,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
		temp_cnt += dwc->ev_buffs[i]->count;
	}

	/* If run/stop is cleared don't process any more events */
	if (!dwc->pullups_connected) {
		dev_warn(dwc->dev, "IRQ received but run/stop is cleared\n");
		ret = IRQ_HANDLED;
	}

	spin_unlock(&dwc->lock);

	dwc->irq_start_time[dwc->irq_dbg_index] = start_time;