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

Commit 24ad0631 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: gadget: Unconfigure bam2bam endpoints during suspend



If remotewakeup is not enabled or allowed, USB driver disconnects
BAM2BAM connection with IPA as part of suspend and reconnect BAM2BAM
pipes during resume. As part of suspend, it is not calling
msm_ep_unconfig() before performing BAM2BAM pipes disconnection. Due to
this, after resume, configuring DBM endpoint fails and leads to USB
transfers not working. Hence fix this by unconfiguring DBM endpoint
in suspend if remotewakeup is not supported or enabled.

Change-Id: Ifc68fc91f46ca34c97c7808c4ebec152bc2e7e86
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 0940fb6a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1422,7 +1422,7 @@ int msm_ep_unconfig(struct usb_ep *ep)

	/* Restore original ep ops */
	if (!mdwc->original_ep_ops[dep->number]) {
		dev_err(mdwc->dev,
		dev_dbg(mdwc->dev,
			"ep [%s,%d] was not configured as msm endpoint\n",
			ep->name, dep->number);
		return -EINVAL;
+5 −0
Original line number Diff line number Diff line
@@ -793,6 +793,11 @@ static void rndis_qc_suspend(struct usb_function *f)
		 */
		rndis_flow_control(rndis->config, true);
		pr_debug("%s(): Disconnecting\n", __func__);
		if (rndis->xport == USB_GADGET_XPORT_BAM2BAM_IPA &&
			gadget_is_dwc3(f->config->cdev->gadget)) {
			msm_ep_unconfig(rndis->port.out_ep);
			msm_ep_unconfig(rndis->port.in_ep);
		}
	}

	bam_data_suspend(&rndis->bam_port, rndis->port_num, USB_FUNC_RNDIS,
+4 −0
Original line number Diff line number Diff line
@@ -624,6 +624,10 @@ static void frmnet_suspend(struct usb_function *f)
			pr_debug("in_ep_desc_bkup = %p, out_ep_desc_bkup = %p",
			       dev->in_ep_desc_backup, dev->out_ep_desc_backup);
			pr_debug("%s(): Disconnecting\n", __func__);
			if (gadget_is_dwc3(f->config->cdev->gadget)) {
				msm_ep_unconfig(dev->port.out);
				msm_ep_unconfig(dev->port.in);
			}
			gport_rmnet_disconnect(dev);
		}
		break;