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

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

dwc3-msm: Log state of ID/VBUS/SUSPEND with USB log buffer



Currently driver is not logging ID/VBUS/SUSPEND state before
queueing state machine with USB log buffer. This change starts
logging this which shall help to debug issue related to receiving
events, processing the same and using with sm_work state machine.

CRs-Fixed: 1073697
Change-Id: Ic91ba821cfaf0051c6e1cb095b7e0ac53b398418
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent dfc885c1
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -2216,6 +2216,10 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc)
 */
static void dwc3_ext_event_notify(struct dwc3_msm *mdwc)
{
	struct dwc3 *dwc = platform_get_drvdata(mdwc->dwc3);

	dbg_event(0xFF, "ext_event", 0);

	/*
	 * Flush processing any pending events before handling new ones except
	 * for initial notification during bootup.
@@ -2224,26 +2228,26 @@ static void dwc3_ext_event_notify(struct dwc3_msm *mdwc)
		flush_delayed_work(&mdwc->sm_work);

	if (mdwc->id_state == DWC3_ID_FLOAT) {
		dev_dbg(mdwc->dev, "XCVR: ID set\n");
		dbg_event(0xFF, "ID set", 0);
		set_bit(ID, &mdwc->inputs);
	} else {
		dev_dbg(mdwc->dev, "XCVR: ID clear\n");
		dbg_event(0xFF, "ID clear", 0);
		clear_bit(ID, &mdwc->inputs);
	}

	if (mdwc->vbus_active && !mdwc->in_restart) {
		dev_dbg(mdwc->dev, "XCVR: BSV set\n");
		dbg_event(0xFF, "BSV set", 0);
		set_bit(B_SESS_VLD, &mdwc->inputs);
	} else {
		dev_dbg(mdwc->dev, "XCVR: BSV clear\n");
		dbg_event(0xFF, "BSV clear", 0);
		clear_bit(B_SESS_VLD, &mdwc->inputs);
	}

	if (mdwc->suspend) {
		dev_dbg(mdwc->dev, "XCVR: SUSP set\n");
		dbg_event(0xFF, "SUSP set", 0);
		set_bit(B_SUSPEND, &mdwc->inputs);
	} else {
		dev_dbg(mdwc->dev, "XCVR: SUSP clear\n");
		dbg_event(0xFF, "SUSP clear", 0);
		clear_bit(B_SUSPEND, &mdwc->inputs);
	}