From: Greg Kroah-Hartman Date: Wed, 3 Jul 2024 09:57:51 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.19.317~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a891062321f5e9ef36d9608afadbfcce8b6ed91e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: usb-xhci-do-not-perform-soft-retry-for-some-xhci-hosts.patch --- diff --git a/queue-4.19/series b/queue-4.19/series index 078456b8aac..a2d055ab029 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -96,13 +96,12 @@ scsi-mpt3sas-gracefully-handle-online-firmware-updat.patch scsi-mpt3sas-avoid-test-set_bit-operating-in-non-all.patch xhci-use-soft-retry-to-recover-faster-from-transacti.patch xhci-set-correct-transferred-length-for-cancelled-bu.patch +usb-xhci-do-not-perform-soft-retry-for-some-xhci-hosts.patch pinctrl-fix-deadlock-in-create_pinctrl-when-handling.patch pinctrl-rockchip-fix-pinmux-bits-for-rk3328-gpio2-b-.patch pinctrl-rockchip-fix-pinmux-bits-for-rk3328-gpio3-b-.patch pinctrl-rockchip-fix-pinmux-reset-in-rockchip_pmx_se.patch drm-amdgpu-fix-ubsan-warning-in-kv_dpm.c.patch -revert-x86-mm-numa-use-numa_no_node-when-calling-mem.patch -revert-mm-memblock-replace-dereferences-of-memblock_.patch netfilter-nf_tables-validate-family-when-identifying.patch asoc-fsl-asoc-card-set-priv-pdev-before-using-it.patch netfilter-nf_tables-fully-validate-nft_data_value-on.patch diff --git a/queue-4.19/usb-xhci-do-not-perform-soft-retry-for-some-xhci-hosts.patch b/queue-4.19/usb-xhci-do-not-perform-soft-retry-for-some-xhci-hosts.patch new file mode 100644 index 00000000000..5b7d55a6af8 --- /dev/null +++ b/queue-4.19/usb-xhci-do-not-perform-soft-retry-for-some-xhci-hosts.patch @@ -0,0 +1,76 @@ +From a4a251f8c23518899d2078c320cf9ce2fa459c9f Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka +Date: Thu, 11 Mar 2021 13:53:50 +0200 +Subject: usb: xhci: do not perform Soft Retry for some xHCI hosts + +From: Stanislaw Gruszka + +commit a4a251f8c23518899d2078c320cf9ce2fa459c9f upstream. + +On some systems rt2800usb and mt7601u devices are unable to operate since +commit f8f80be501aa ("xhci: Use soft retry to recover faster from +transaction errors") + +Seems that some xHCI controllers can not perform Soft Retry correctly, +affecting those devices. + +To avoid the problem add xhci->quirks flag that restore pre soft retry +xhci behaviour for affected xHCI controllers. Currently those are +AMD_PROMONTORYA_4 and AMD_PROMONTORYA_2, since it was confirmed +by the users: on those xHCI hosts issue happen and is gone after +disabling Soft Retry. + +[minor commit message rewording for checkpatch -Mathias] + +Fixes: f8f80be501aa ("xhci: Use soft retry to recover faster from transaction errors") +Cc: # 4.20+ +Reported-by: Bernhard +Tested-by: Bernhard +Signed-off-by: Stanislaw Gruszka +Signed-off-by: Mathias Nyman +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202541 +Link: https://lore.kernel.org/r/20210311115353.2137560-2-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-pci.c | 5 +++++ + drivers/usb/host/xhci-ring.c | 3 ++- + drivers/usb/host/xhci.h | 1 + + 3 files changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -280,6 +280,11 @@ static void xhci_pci_quirks(struct devic + pdev->device == 0x9026) + xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT; + ++ if (pdev->vendor == PCI_VENDOR_ID_AMD && ++ (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2 || ++ pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4)) ++ xhci->quirks |= XHCI_NO_SOFT_RETRY; ++ + if (xhci->quirks & XHCI_RESET_ON_RESUME) + xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, + "QUIRK: Resetting on resume"); +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -2291,7 +2291,8 @@ static int process_bulk_intr_td(struct x + td->urb->actual_length = sum_trb_lengths(xhci, ep_ring, ep_trb); + goto finish_td; + case COMP_USB_TRANSACTION_ERROR: +- if ((ep_ring->err_count++ > MAX_SOFT_RETRY) || ++ if (xhci->quirks & XHCI_NO_SOFT_RETRY || ++ (ep_ring->err_count++ > MAX_SOFT_RETRY) || + le32_to_cpu(slot_ctx->tt_info) & TT_SLOT) + break; + *status = 0; +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -1880,6 +1880,7 @@ struct xhci_hcd { + #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) + #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) + #define XHCI_DISABLE_SPARSE BIT_ULL(38) ++#define XHCI_NO_SOFT_RETRY BIT_ULL(40) + + unsigned int num_active_eps; + unsigned int limit_active_eps;