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

Commit 566158ff authored by Linyu Yuan's avatar Linyu Yuan
Browse files

usb: dwc3: gadget: improve several ipc log



add gadget speed to 'BUS RESET' log, then 'UDC RESET' can be removed,
add link speed to 'CONNECT DONE' log,
add link state to 'SUSPEND INT' log,
show ep0 state when pullup during non setup phase.

Change-Id: I12c4f69796b09f0dce90ea88513a9653e7641df9
Signed-off-by: default avatarLinyu Yuan <linyyuan@codeaurora.org>
parent 1d86c274
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -2197,7 +2197,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)

	spin_lock_irqsave(&dwc->lock, flags);
	if (dwc->ep0state != EP0_SETUP_PHASE)
		dbg_event(0xFF, "EP0 is not in SETUP phase\n", 0);
		dbg_event(0xFF, "EP0 is not in SETUP phase\n", dwc->ep0state);

	/*
	 * If we are here after bus suspend notify otg state machine to
@@ -3102,7 +3102,6 @@ static void dwc3_reset_gadget(struct dwc3 *dwc)
	if (dwc->gadget.speed != USB_SPEED_UNKNOWN) {
		gadget_driver = dwc->gadget_driver;
		spin_unlock(&dwc->lock);
		dbg_event(0xFF, "UDC RESET", 0);
		usb_gadget_udc_reset(&dwc->gadget, gadget_driver);
		spin_lock(&dwc->lock);
	}
@@ -3260,7 +3259,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
			dwc3_gadget_disconnect_interrupt(dwc);
	}

	dbg_event(0xFF, "BUS RESET", 0);
	dbg_event(0xFF, "BUS RESET", dwc->gadget.speed);
	dev_dbg(dwc->dev, "Notify OTG from %s\n", __func__);
	dwc->b_suspend = false;
	dwc3_notify_event(dwc, DWC3_CONTROLLER_NOTIFY_OTG_EVENT, 0);
@@ -3310,10 +3309,10 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
	u32			reg;
	u8			speed;

	dbg_event(0xFF, "CONNECT DONE", 0);
	reg = dwc3_readl(dwc->regs, DWC3_DSTS);
	speed = reg & DWC3_DSTS_CONNECTSPD;
	dwc->speed = speed;
	dbg_event(0xFF, "CONNECT DONE", speed);

	/* Reset the retry on erratic error event count */
	dwc->retries_on_error = 0;
@@ -3555,7 +3554,7 @@ static void dwc3_gadget_suspend_interrupt(struct dwc3 *dwc,
{
	enum dwc3_link_state next = evtinfo & DWC3_LINK_STATE_MASK;

	dbg_event(0xFF, "SUSPEND INT", 0);
	dbg_event(0xFF, "SUSPEND INT", next);
	dev_dbg(dwc->dev, "%s Entry to %d\n", __func__, next);

	if (dwc->link_state != next && next == DWC3_LINK_STATE_U3) {