USB: ci13xxx_udc: Skip flushing endpoints upon failure
Flushing an endpoint involve polling ENDPTFLUSH and ENDPTSTAT registers. The worst case timeout is 100 msec for each endpoint. The reason for failure is unknown. When flushing an endpoint fails, successive flushing of remaining endpoints are also failing. Hence skip flushing remaining endpoints. Reset this condition upon USB bus reset. (cherry picked from commit 2a630fb9b83b31e607ef61f3b61959cc1b095349) CRs-Fixed: 445916 Change-Id: I54cf860c0d290ffa3fc0d7e41af32b4be48937ef Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:
committed by
Iliyan Malchev
parent
837790d42e
commit
374c1baf93
@@ -416,7 +416,7 @@ static int hw_ep_flush(int num, int dir)
|
||||
int n = hw_ep_bit(num, dir);
|
||||
struct ci13xxx_ep *mEp = &_udc->ci13xxx_ep[n];
|
||||
|
||||
if (list_empty(&mEp->qh.queue))
|
||||
if (_udc->skip_flush || list_empty(&mEp->qh.queue))
|
||||
return 0;
|
||||
|
||||
start = ktime_get();
|
||||
@@ -432,6 +432,7 @@ static int hw_ep_flush(int num, int dir)
|
||||
__func__, num,
|
||||
dir ? "IN" : "OUT");
|
||||
debug_ept_flush_info(num, dir);
|
||||
_udc->skip_flush = true;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -2181,6 +2182,7 @@ __acquires(udc->lock)
|
||||
if (retval)
|
||||
goto done;
|
||||
|
||||
_udc->skip_flush = false;
|
||||
retval = hw_usb_reset();
|
||||
if (retval)
|
||||
goto done;
|
||||
|
||||
@@ -160,6 +160,9 @@ struct ci13xxx {
|
||||
int softconnect; /* is pull-up enable allowed */
|
||||
unsigned long dTD_update_fail_count;
|
||||
struct usb_phy *transceiver; /* Transceiver struct */
|
||||
bool skip_flush; /* skip flushing remaining EP
|
||||
upon flush timeout for the
|
||||
first EP. */
|
||||
};
|
||||
|
||||
struct ci13xxx_platform_data {
|
||||
|
||||
Reference in New Issue
Block a user