mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
Revert "usb: xhci: Limit Stop Endpoint retries"
This reverts commit ae1a08850a which is
commit 42b7581376015c1bbcbe5831f043cd0ac119d028 upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: Id33b40e8d8ba8ba5c0cdb624f60a4ec630a106da
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -52,7 +52,6 @@
|
||||
* endpoint rings; it generates events on the event ring for these.
|
||||
*/
|
||||
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
@@ -1158,35 +1157,16 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id,
|
||||
return;
|
||||
case EP_STATE_STOPPED:
|
||||
/*
|
||||
* Per xHCI 4.6.9, Stop Endpoint command on a Stopped
|
||||
* EP is a Context State Error, and EP stays Stopped.
|
||||
*
|
||||
* But maybe it failed on Halted, and somebody ran Reset
|
||||
* Endpoint later. EP state is now Stopped and EP_HALTED
|
||||
* still set because Reset EP handler will run after us.
|
||||
*/
|
||||
if (ep->ep_state & EP_HALTED)
|
||||
break;
|
||||
/*
|
||||
* On some HCs EP state remains Stopped for some tens of
|
||||
* us to a few ms or more after a doorbell ring, and any
|
||||
* new Stop Endpoint fails without aborting the restart.
|
||||
* This handler may run quickly enough to still see this
|
||||
* Stopped state, but it will soon change to Running.
|
||||
*
|
||||
* Assume this bug on unexpected Stop Endpoint failures.
|
||||
* Keep retrying until the EP starts and stops again, on
|
||||
* chips where this is known to help. Wait for 100ms.
|
||||
* NEC uPD720200 sometimes sets this state and fails with
|
||||
* Context Error while continuing to process TRBs.
|
||||
* Be conservative and trust EP_CTX_STATE on other chips.
|
||||
*/
|
||||
if (!(xhci->quirks & XHCI_NEC_HOST))
|
||||
break;
|
||||
if (time_is_before_jiffies(ep->stop_time + msecs_to_jiffies(100)))
|
||||
break;
|
||||
fallthrough;
|
||||
case EP_STATE_RUNNING:
|
||||
/* Race, HW handled stop ep cmd before ep was running */
|
||||
xhci_dbg(xhci, "Stop ep completion ctx error, ctx_state %d\n",
|
||||
GET_EP_CTX_STATE(ep_ctx));
|
||||
xhci_dbg(xhci, "Stop ep completion ctx error, ep is running\n");
|
||||
|
||||
command = xhci_alloc_command(xhci, false, GFP_ATOMIC);
|
||||
if (!command) {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
* Some code borrowed from the Linux EHCI driver.
|
||||
*/
|
||||
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/pci.h>
|
||||
#ifndef __GENKSYMS__ /* ANDROID: KABI CRC preservation hack */
|
||||
#include <linux/iommu.h>
|
||||
@@ -1929,7 +1928,6 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
ep->stop_time = jiffies;
|
||||
ep->ep_state |= EP_STOP_CMD_PENDING;
|
||||
xhci_queue_stop_endpoint(xhci, command, urb->dev->slot_id,
|
||||
ep_index, 0);
|
||||
|
||||
@@ -971,7 +971,6 @@ struct xhci_virt_ep {
|
||||
/* Bandwidth checking storage */
|
||||
struct xhci_bw_info bw_info;
|
||||
struct list_head bw_endpoint_list;
|
||||
unsigned long stop_time;
|
||||
/* Isoch Frame ID checking storage */
|
||||
int next_frame_id;
|
||||
/* Use new Isoch TRB layout needed for extended TBC support */
|
||||
|
||||
Reference in New Issue
Block a user