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

Commit 0da65f62 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: dwc3-msm: Don't configure DBM for GSI endpoints



On some platforms, USB endpoints are configured as GSI endpoints.
In this case, it is not required to configure USB endpoint as DBM endpoint.
Otherwise it might cause USB functionality failure. Hence add a proper
check so that skip configuring USB endpoints as DBM endpoints in case
of GSI endpoints.

Change-Id: I8548744b816a5e2b8807d1d633743c270deedb8d
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 1c10389d
Loading
Loading
Loading
Loading
+15 −16
Original line number Diff line number Diff line
@@ -1358,7 +1358,7 @@ int msm_ep_config(struct usb_ep *ep, struct usb_request *request,
	mdwc->original_ep_ops[dep->number] = ep->ops;

	/* Set new usb ops as we like */
	new_ep_ops = kzalloc(sizeof(struct usb_ep_ops), GFP_ATOMIC);
	new_ep_ops = kzalloc(sizeof(struct usb_ep_ops), gfp_flags);
	if (!new_ep_ops) {
		dev_err(mdwc->dev,
			"%s: unable to allocate mem for new usb ep ops\n",
@@ -1370,16 +1370,16 @@ int msm_ep_config(struct usb_ep *ep, struct usb_request *request,
	new_ep_ops->gsi_ep_op = dwc3_msm_gsi_ep_op;
	ep->ops = new_ep_ops;

	if (!mdwc->dbm || !request || (dep->endpoint.ep_type == EP_TYPE_GSI))
		return 0;

	/*
	 * Configure the DBM endpoint if required.
	 */
	if (mdwc->dbm) {
	bam_pipe = request->udc_priv & MSM_PIPE_ID_MASK;
	producer = ((request->udc_priv & MSM_PRODUCER) ? true : false);
		disable_wb = ((request->udc_priv & MSM_DISABLE_WB) ?
								true : false);
		internal_mem = ((request->udc_priv & MSM_INTERNAL_MEM) ?
								true : false);
	disable_wb = ((request->udc_priv & MSM_DISABLE_WB) ? true : false);
	internal_mem = ((request->udc_priv & MSM_INTERNAL_MEM) ? true : false);
	ioc = ((request->udc_priv & MSM_ETD_IOC) ? true : false);

	ret = dbm_ep_config(mdwc->dbm, dep->number, bam_pipe, producer,
@@ -1389,7 +1389,6 @@ int msm_ep_config(struct usb_ep *ep, struct usb_request *request,
			"error %d after calling dbm_ep_config\n", ret);
		return ret;
	}
	}

	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -2330,7 +2330,7 @@ skip_string_id_alloc:
		if (!ep)
			goto fail;
		gsi->d_port.in_ep = ep;
		msm_ep_config(gsi->d_port.in_ep, NULL, GFP_ATOMIC);
		msm_ep_config(gsi->d_port.in_ep, NULL, GFP_KERNEL);
		ep->driver_data = cdev;	/* claim */
	}

@@ -2340,7 +2340,7 @@ skip_string_id_alloc:
		if (!ep)
			goto fail;
		gsi->d_port.out_ep = ep;
		msm_ep_config(gsi->d_port.out_ep, NULL, GFP_ATOMIC);
		msm_ep_config(gsi->d_port.out_ep, NULL, GFP_KERNEL);
		ep->driver_data = cdev;	/* claim */
	}