Commit cf2f8b63 authored by Thinh Nguyen's avatar Thinh Nguyen Committed by Greg Kroah-Hartman

usb: dwc3: gadget: Remove END_TRANSFER delay

We had a 100us delay to synchronize the END_TRANSFER command completion
before giving back requests to the function drivers. Now, the controller
driver can handle cancelled TRBs with the requests' cancelled_list and
it can also wait until the END_TRANSFER completion before starting new
transfers. Synchronization can simply base on the controller's command
completion interrupt. The 100us delay is no longer needed. Remove this
arbitrary delay.
Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent da10bcdd
...@@ -2693,7 +2693,6 @@ static void dwc3_reset_gadget(struct dwc3 *dwc) ...@@ -2693,7 +2693,6 @@ static void dwc3_reset_gadget(struct dwc3 *dwc)
static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
bool interrupt) bool interrupt)
{ {
struct dwc3 *dwc = dep->dwc;
struct dwc3_gadget_ep_cmd_params params; struct dwc3_gadget_ep_cmd_params params;
u32 cmd; u32 cmd;
int ret; int ret;
...@@ -2709,16 +2708,13 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, ...@@ -2709,16 +2708,13 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
* much trouble synchronizing between us and gadget driver. * much trouble synchronizing between us and gadget driver.
* *
* We have discussed this with the IP Provider and it was * We have discussed this with the IP Provider and it was
* suggested to giveback all requests here, but give HW some * suggested to giveback all requests here.
* extra time to synchronize with the interconnect. We're using
* an arbitrary 100us delay for that.
* *
* Note also that a similar handling was tested by Synopsys * Note also that a similar handling was tested by Synopsys
* (thanks a lot Paul) and nothing bad has come out of it. * (thanks a lot Paul) and nothing bad has come out of it.
* In short, what we're doing is: * In short, what we're doing is issuing EndTransfer with
* * CMDIOC bit set and delay kicking transfer until the
* - Issue EndTransfer WITH CMDIOC bit set * EndTransfer command had completed.
* - Wait 100us
* *
* As of IP version 3.10a of the DWC_usb3 IP, the controller * As of IP version 3.10a of the DWC_usb3 IP, the controller
* supports a mode to work around the above limitation. The * supports a mode to work around the above limitation. The
...@@ -2727,8 +2723,7 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, ...@@ -2727,8 +2723,7 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
* by writing GUCTL2[14]. This polling is already done in the * by writing GUCTL2[14]. This polling is already done in the
* dwc3_send_gadget_ep_cmd() function so if the mode is * dwc3_send_gadget_ep_cmd() function so if the mode is
* enabled, the EndTransfer command will have completed upon * enabled, the EndTransfer command will have completed upon
* returning from this function and we don't need to delay for * returning from this function.
* 100us.
* *
* This mode is NOT available on the DWC_usb31 IP. * This mode is NOT available on the DWC_usb31 IP.
*/ */
...@@ -2746,9 +2741,6 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, ...@@ -2746,9 +2741,6 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
dep->flags &= ~DWC3_EP_TRANSFER_STARTED; dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
else else
dep->flags |= DWC3_EP_END_TRANSFER_PENDING; dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
if (dwc3_is_usb31(dwc) || dwc->revision < DWC3_REVISION_310A)
udelay(100);
} }
static void dwc3_clear_stall_all_ep(struct dwc3 *dwc) static void dwc3_clear_stall_all_ep(struct dwc3 *dwc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment