From: Greg Kroah-Hartman Date: Mon, 10 Apr 2023 09:09:43 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v5.15.107~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00eb03cc18ab3e6074748cff5ec87d7f4b9b3703;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: xhci-also-avoid-the-xhci_zero_64b_regs-quirk-with-a-passthrough-iommu.patch --- diff --git a/queue-5.4/series b/queue-5.4/series index ac507608eab..66f4536f1ff 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -14,3 +14,4 @@ ipv6-fix-an-uninit-variable-access-bug-in-__ip6_make.patch gpio-davinci-add-irq-chip-flag-to-skip-set-wake.patch sunrpc-only-free-unix-grouplist-after-rcu-settles.patch nfsd-callback-request-does-not-use-correct-credentia.patch +xhci-also-avoid-the-xhci_zero_64b_regs-quirk-with-a-passthrough-iommu.patch diff --git a/queue-5.4/xhci-also-avoid-the-xhci_zero_64b_regs-quirk-with-a-passthrough-iommu.patch b/queue-5.4/xhci-also-avoid-the-xhci_zero_64b_regs-quirk-with-a-passthrough-iommu.patch new file mode 100644 index 00000000000..ef00dab4ab0 --- /dev/null +++ b/queue-5.4/xhci-also-avoid-the-xhci_zero_64b_regs-quirk-with-a-passthrough-iommu.patch @@ -0,0 +1,56 @@ +From ecaa4902439298f6b0e29f47424a86b310a9ff4f Mon Sep 17 00:00:00 2001 +From: D Scott Phillips +Date: Thu, 30 Mar 2023 17:30:54 +0300 +Subject: xhci: also avoid the XHCI_ZERO_64B_REGS quirk with a passthrough iommu + +From: D Scott Phillips + +commit ecaa4902439298f6b0e29f47424a86b310a9ff4f upstream. + +Previously the quirk was skipped when no iommu was present. The same +rationale for skipping the quirk also applies in the iommu.passthrough=1 +case. + +Skip applying the XHCI_ZERO_64B_REGS quirk if the device's iommu domain is +passthrough. + +Fixes: 12de0a35c996 ("xhci: Add quirk to zero 64bit registers on Renesas PCIe controllers") +Cc: stable +Signed-off-by: D Scott Phillips +Acked-by: Marc Zyngier +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20230330143056.1390020-2-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -9,6 +9,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -226,6 +227,7 @@ int xhci_reset(struct xhci_hcd *xhci, u6 + static void xhci_zero_64b_regs(struct xhci_hcd *xhci) + { + struct device *dev = xhci_to_hcd(xhci)->self.sysdev; ++ struct iommu_domain *domain; + int err, i; + u64 val; + u32 intrs; +@@ -244,7 +246,9 @@ static void xhci_zero_64b_regs(struct xh + * an iommu. Doing anything when there is no iommu is definitely + * unsafe... + */ +- if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !device_iommu_mapped(dev)) ++ domain = iommu_get_domain_for_dev(dev); ++ if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !domain || ++ domain->type == IOMMU_DOMAIN_IDENTITY) + return; + + xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n");