From: Greg Kroah-Hartman Date: Sun, 9 Mar 2025 21:22:36 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v5.4.291~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7dd3b34dcf6480a1b8b712d9e2f9255d3f5d1b24;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: usb-xhci-enable-the-trb-overfetch-quirk-on-via-vl805.patch xhci-pci-fix-indentation-in-the-pci-device-id-definitions.patch --- diff --git a/queue-6.6/series b/queue-6.6/series index 93a073c982..16ee83ea7a 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -110,3 +110,5 @@ usb-gadget-set-self-powered-based-on-maxpower-and-bmattributes.patch usb-gadget-fix-setting-self-powered-state-on-suspend.patch usb-gadget-check-bmattributes-only-if-configuration-is-valid.patch kbuild-userprogs-use-correct-lld-when-linking-through-clang.patch +xhci-pci-fix-indentation-in-the-pci-device-id-definitions.patch +usb-xhci-enable-the-trb-overfetch-quirk-on-via-vl805.patch diff --git a/queue-6.6/usb-xhci-enable-the-trb-overfetch-quirk-on-via-vl805.patch b/queue-6.6/usb-xhci-enable-the-trb-overfetch-quirk-on-via-vl805.patch new file mode 100644 index 0000000000..a5a33fd747 --- /dev/null +++ b/queue-6.6/usb-xhci-enable-the-trb-overfetch-quirk-on-via-vl805.patch @@ -0,0 +1,100 @@ +From c133ec0e5717868c9967fa3df92a55e537b1aead Mon Sep 17 00:00:00 2001 +From: Michal Pecio +Date: Tue, 25 Feb 2025 11:59:27 +0200 +Subject: usb: xhci: Enable the TRB overfetch quirk on VIA VL805 + +From: Michal Pecio + +commit c133ec0e5717868c9967fa3df92a55e537b1aead upstream. + +Raspberry Pi is a major user of those chips and they discovered a bug - +when the end of a transfer ring segment is reached, up to four TRBs can +be prefetched from the next page even if the segment ends with link TRB +and on page boundary (the chip claims to support standard 4KB pages). + +It also appears that if the prefetched TRBs belong to a different ring +whose doorbell is later rung, they may be used without refreshing from +system RAM and the endpoint will stay idle if their cycle bit is stale. + +Other users complain about IOMMU faults on x86 systems, unsurprisingly. + +Deal with it by using existing quirk which allocates a dummy page after +each transfer ring segment. This was seen to resolve both problems. RPi +came up with a more efficient solution, shortening each segment by four +TRBs, but it complicated the driver and they ditched it for this quirk. + +Also rename the quirk and add VL805 device ID macro. + +Signed-off-by: Michal Pecio +Link: https://github.com/raspberrypi/linux/issues/4685 +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=215906 +CC: stable@vger.kernel.org +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20250225095927.2512358-2-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-mem.c | 3 ++- + drivers/usb/host/xhci-pci.c | 10 +++++++--- + drivers/usb/host/xhci.h | 2 +- + 3 files changed, 10 insertions(+), 5 deletions(-) + +--- a/drivers/usb/host/xhci-mem.c ++++ b/drivers/usb/host/xhci-mem.c +@@ -2364,7 +2364,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, + * and our use of dma addresses in the trb_address_map radix tree needs + * TRB_SEGMENT_SIZE alignment, so we pick the greater alignment need. + */ +- if (xhci->quirks & XHCI_ZHAOXIN_TRB_FETCH) ++ if (xhci->quirks & XHCI_TRB_OVERFETCH) ++ /* Buggy HC prefetches beyond segment bounds - allocate dummy space at the end */ + xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, + TRB_SEGMENT_SIZE * 2, TRB_SEGMENT_SIZE * 2, xhci->page_size * 2); + else +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -38,6 +38,8 @@ + #define PCI_DEVICE_ID_EJ168 0x7023 + #define PCI_DEVICE_ID_EJ188 0x7052 + ++#define PCI_DEVICE_ID_VIA_VL805 0x3483 ++ + #define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31 + #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 + #define PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI 0x9cb1 +@@ -480,8 +482,10 @@ static void xhci_pci_quirks(struct devic + pdev->device == 0x3432) + xhci->quirks |= XHCI_BROKEN_STREAMS; + +- if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) ++ if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == PCI_DEVICE_ID_VIA_VL805) { + xhci->quirks |= XHCI_LPM_SUPPORT; ++ xhci->quirks |= XHCI_TRB_OVERFETCH; ++ } + + if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && + pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) { +@@ -529,11 +533,11 @@ static void xhci_pci_quirks(struct devic + + if (pdev->device == 0x9202) { + xhci->quirks |= XHCI_RESET_ON_RESUME; +- xhci->quirks |= XHCI_ZHAOXIN_TRB_FETCH; ++ xhci->quirks |= XHCI_TRB_OVERFETCH; + } + + if (pdev->device == 0x9203) +- xhci->quirks |= XHCI_ZHAOXIN_TRB_FETCH; ++ xhci->quirks |= XHCI_TRB_OVERFETCH; + } + + if (pdev->vendor == PCI_DEVICE_ID_CADENCE && +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -1657,7 +1657,7 @@ struct xhci_hcd { + #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42) + #define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43) + #define XHCI_RESET_TO_DEFAULT BIT_ULL(44) +-#define XHCI_ZHAOXIN_TRB_FETCH BIT_ULL(45) ++#define XHCI_TRB_OVERFETCH BIT_ULL(45) + #define XHCI_ZHAOXIN_HOST BIT_ULL(46) + #define XHCI_WRITE_64_HI_LO BIT_ULL(47) + #define XHCI_CDNS_SCTX_QUIRK BIT_ULL(48) diff --git a/queue-6.6/xhci-pci-fix-indentation-in-the-pci-device-id-definitions.patch b/queue-6.6/xhci-pci-fix-indentation-in-the-pci-device-id-definitions.patch new file mode 100644 index 0000000000..3253721eb0 --- /dev/null +++ b/queue-6.6/xhci-pci-fix-indentation-in-the-pci-device-id-definitions.patch @@ -0,0 +1,42 @@ +From 0309ed83791c079f239c13e0c605210425cd1a61 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Wed, 6 Nov 2024 12:14:48 +0200 +Subject: xhci: pci: Fix indentation in the PCI device ID definitions + +From: Andy Shevchenko + +commit 0309ed83791c079f239c13e0c605210425cd1a61 upstream. + +Some of the definitions are missing the one TAB, add it to them. + +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20241106101459.775897-23-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-pci.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -28,8 +28,8 @@ + #define SPARSE_CNTL_ENABLE 0xC12C + + /* Device for a quirk */ +-#define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73 +-#define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000 ++#define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73 ++#define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000 + #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 0x1009 + #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 0x1100 + #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400 +@@ -38,8 +38,8 @@ + #define PCI_DEVICE_ID_EJ168 0x7023 + #define PCI_DEVICE_ID_EJ188 0x7052 + +-#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31 +-#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 ++#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31 ++#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 + #define PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI 0x9cb1 + #define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5 + #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI 0xa12f