mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-28 09:39:00 +00:00
14940aee45
Removed upstreamed: target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch target/linux/mvebu/patches-5.4/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch target/linux/mvebu/patches-5.4/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch The following patch does not apply to upstream any more and needs some more work to make it work fully again. I am not sure if we are still able to set the UART to a none standard baud rate. target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch These patches needed manually changes: target/linux/generic/pending-5.4/110-ehci_hcd_ignore_oc.patch target/linux/ipq806x/patches-5.4/0065-arm-override-compiler-flags.patch target/linux/layerscape/patches-5.4/804-crypto-0016-MLKU-114-1-crypto-caam-reduce-page-0-regs-access-to-.patch target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch All others updated automatically. Compile-tested on: malta/le, armvirt/64, lantiq/xrx200 Runtime-tested on: malta/le, armvirt/64, lantiq/xrx200 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
91 lines
3.2 KiB
Diff
91 lines
3.2 KiB
Diff
From 7bb9b7d36fa457a9fc463108d1228fd318891da4 Mon Sep 17 00:00:00 2001
|
|
From: Jonathan Bell <jonathan@raspberrypi.org>
|
|
Date: Thu, 11 Jul 2019 17:55:43 +0100
|
|
Subject: [PATCH] xhci: add quirk for host controllers that don't
|
|
update endpoint DCS
|
|
|
|
Seen on a VLI VL805 PCIe to USB controller. For non-stream endpoints
|
|
at least, if the xHC halts on a particular TRB due to an error then
|
|
the DCS field in the Out Endpoint Context maintained by the hardware
|
|
is not updated with the current cycle state.
|
|
|
|
Using the quirk XHCI_EP_CTX_BROKEN_DCS and instead fetch the DCS bit
|
|
from the TRB that the xHC stopped on.
|
|
|
|
See: https://github.com/raspberrypi/linux/issues/3060
|
|
|
|
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
|
---
|
|
drivers/usb/host/xhci-pci.c | 4 +++-
|
|
drivers/usb/host/xhci-ring.c | 26 +++++++++++++++++++++++++-
|
|
drivers/usb/host/xhci.h | 1 +
|
|
3 files changed, 29 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/usb/host/xhci-pci.c
|
|
+++ b/drivers/usb/host/xhci-pci.c
|
|
@@ -267,8 +267,10 @@ static void xhci_pci_quirks(struct devic
|
|
xhci->quirks |= XHCI_BROKEN_STREAMS;
|
|
|
|
if (pdev->vendor == PCI_VENDOR_ID_VIA &&
|
|
- pdev->device == 0x3483)
|
|
+ pdev->device == 0x3483) {
|
|
xhci->quirks |= XHCI_LPM_SUPPORT;
|
|
+ xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
|
|
+ }
|
|
|
|
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
|
|
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI)
|
|
--- a/drivers/usb/host/xhci-ring.c
|
|
+++ b/drivers/usb/host/xhci-ring.c
|
|
@@ -556,7 +556,10 @@ void xhci_find_new_dequeue_state(struct
|
|
struct xhci_virt_ep *ep = &dev->eps[ep_index];
|
|
struct xhci_ring *ep_ring;
|
|
struct xhci_segment *new_seg;
|
|
+ struct xhci_segment *halted_seg = NULL;
|
|
union xhci_trb *new_deq;
|
|
+ union xhci_trb *halted_trb;
|
|
+ int index = 0;
|
|
dma_addr_t addr;
|
|
u64 hw_dequeue;
|
|
bool cycle_found = false;
|
|
@@ -594,7 +597,28 @@ void xhci_find_new_dequeue_state(struct
|
|
hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id);
|
|
new_seg = ep_ring->deq_seg;
|
|
new_deq = ep_ring->dequeue;
|
|
- state->new_cycle_state = hw_dequeue & 0x1;
|
|
+
|
|
+ /*
|
|
+ * Quirk: xHC write-back of the DCS field in the hardware dequeue
|
|
+ * pointer is wrong - use the cycle state of the TRB pointed to by
|
|
+ * the dequeue pointer.
|
|
+ */
|
|
+ if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS &&
|
|
+ !(ep->ep_state & EP_HAS_STREAMS))
|
|
+ halted_seg = trb_in_td(xhci, cur_td->start_seg,
|
|
+ cur_td->first_trb, cur_td->last_trb,
|
|
+ hw_dequeue & ~0xf, false);
|
|
+ if (halted_seg) {
|
|
+ index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) /
|
|
+ sizeof(*halted_trb);
|
|
+ halted_trb = &halted_seg->trbs[index];
|
|
+ state->new_cycle_state = halted_trb->generic.field[3] & 0x1;
|
|
+ xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n",
|
|
+ (u8)(hw_dequeue & 0x1), index,
|
|
+ state->new_cycle_state);
|
|
+ } else {
|
|
+ state->new_cycle_state = hw_dequeue & 0x1;
|
|
+ }
|
|
state->stream_id = stream_id;
|
|
|
|
/*
|
|
--- a/drivers/usb/host/xhci.h
|
|
+++ b/drivers/usb/host/xhci.h
|
|
@@ -1877,6 +1877,7 @@ struct xhci_hcd {
|
|
#define XHCI_DEFAULT_PM_RUNTIME_ALLOW BIT_ULL(33)
|
|
#define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34)
|
|
#define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35)
|
|
+#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(36)
|
|
#define XHCI_SKIP_PHY_INIT BIT_ULL(37)
|
|
#define XHCI_DISABLE_SPARSE BIT_ULL(38)
|
|
#define XHCI_NO_SOFT_RETRY BIT_ULL(40)
|