mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
dwc3: Don't perform set xfer resource from EP_OP_CONFIG for GSI endpoint
By default when ep0 gets enable, current code SET XFER resource command for all USB endpoints excluding USB GSI endpoint. SET XFER resource command shall fail if all resources are allocated. All allocated transfer resources are resets in controller when DEPXFERCFG cmd is send with ep0 with value as 2 OR when controller is being peformed power on reset or being restarted (i.e. device initiated disconnect and reconnect). Consider case as below: a. USB enumerated b. USB bus suspend c. USB bus reset d. USB connect done e. USB set_config() (set_alt()) f. Reenable all USB endpoint and resize tx fifo for it except ep0 and ep1 g. USB GSI endpoint operation (EP_OP_CONFIG) is sending SET XFER RESOURCE which is failing as all resources are already allocated. ep0 is disabled while clearing run stop and re-enabled when setting run stop. For USB device mode we know that ep0 enabling is prerequisite before setting run stop. Hence let ep0 enabling takes care of reallocating transfer resources for all endpoint including USB GSI endpoints. Change-Id: Ic5ab7558fadc636aaf255d62f91abf7842460659 Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
parent
8543fd31f2
commit
940ae309aa
2 changed files with 1 additions and 11 deletions
|
|
@ -1624,17 +1624,11 @@ static void gsi_configure_ep(struct usb_ep *ep, struct usb_gsi_request *request)
|
|||
|
||||
dwc3_send_gadget_ep_cmd(dep, DWC3_DEPCMD_SETEPCONFIG, ¶ms);
|
||||
|
||||
/* Set XferRsc Index for GSI EP */
|
||||
if (!(dep->flags & DWC3_EP_ENABLED)) {
|
||||
ret = dwc3_gadget_resize_tx_fifos(dwc, dep);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
memset(¶ms, 0x00, sizeof(params));
|
||||
params.param0 = DWC3_DEPXFERCFG_NUM_XFER_RES(1);
|
||||
dwc3_send_gadget_ep_cmd(dep,
|
||||
DWC3_DEPCMD_SETTRANSFRESOURCE, ¶ms);
|
||||
|
||||
dep->endpoint.desc = desc;
|
||||
dep->endpoint.comp_desc = comp_desc;
|
||||
dep->type = usb_endpoint_type(desc);
|
||||
|
|
|
|||
|
|
@ -622,11 +622,7 @@ static int dwc3_gadget_start_config(struct dwc3_ep *dep)
|
|||
for (i = 0; i < DWC3_ENDPOINTS_NUM; i++) {
|
||||
struct dwc3_ep *dep = dwc->eps[i];
|
||||
|
||||
/*
|
||||
* Don't set xfer resource with USB GSI endpoint as it is
|
||||
* performed before enabling USB GSI endpoint.
|
||||
*/
|
||||
if (!dep || dep->gsi)
|
||||
if (!dep)
|
||||
continue;
|
||||
|
||||
ret = dwc3_gadget_set_xfer_resource(dep);
|
||||
|
|
|
|||
Loading…
Reference in a new issue