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

Commit 292c5777 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: Skip check for U3 when handling Function Suspend"

parents 3060f932 073d2892
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -1203,7 +1203,7 @@ static void gsi_set_clear_dbell(struct usb_ep *ep,
*
* @usb_ep - pointer to usb_ep instance to access DWC3 regs
*/
static bool gsi_check_ready_to_suspend(struct usb_ep *ep)
static bool gsi_check_ready_to_suspend(struct usb_ep *ep, bool f_suspend)
{
	u32	timeout = 1500;
	u32	reg = 0;
@@ -1219,12 +1219,14 @@ static bool gsi_check_ready_to_suspend(struct usb_ep *ep)
			return false;
		}
	}

	/* Check for U3 only if we are not handling Function Suspend */
	if (!f_suspend) {
		reg = dwc3_readl(dwc->regs, DWC3_DSTS);
		if (DWC3_DSTS_USBLNKST(reg) != DWC3_LINK_STATE_U3) {
			dev_err(mdwc->dev, "Unable to suspend GSI ch\n");
			return false;
		}
	}

	return true;
}
@@ -1249,7 +1251,7 @@ static int dwc3_msm_gsi_ep_op(struct usb_ep *ep,
	struct dwc3_msm *mdwc = dev_get_drvdata(dwc->dev->parent);
	struct usb_gsi_request *request;
	struct gsi_channel_info *ch_info;
	bool block_db;
	bool block_db, f_suspend;

	switch (op) {
	case GSI_EP_OP_PREPARE_TRBS:
@@ -1309,7 +1311,8 @@ static int dwc3_msm_gsi_ep_op(struct usb_ep *ep,
		break;
	case GSI_EP_OP_CHECK_FOR_SUSPEND:
		dev_dbg(mdwc->dev, "EP_OP_CHECK_FOR_SUSPEND\n");
		ret = gsi_check_ready_to_suspend(ep);
		f_suspend = *((bool *)op_data);
		ret = gsi_check_ready_to_suspend(ep, f_suspend);
		break;
	default:
		dev_err(mdwc->dev, "%s: Invalid opcode GSI EP\n", __func__);