diff --git a/patches.suse/xhci-also-avoid-the-XHCI_ZERO_64B_REGS-quirk-with-a-.patch b/patches.suse/xhci-also-avoid-the-XHCI_ZERO_64B_REGS-quirk-with-a-.patch new file mode 100644 index 0000000..cc14fb7 --- /dev/null +++ b/patches.suse/xhci-also-avoid-the-XHCI_ZERO_64B_REGS-quirk-with-a-.patch @@ -0,0 +1,57 @@ +From ecaa4902439298f6b0e29f47424a86b310a9ff4f Mon Sep 17 00:00:00 2001 +From: D Scott Phillips +Date: Thu, 30 Mar 2023 17:30:54 +0300 +Subject: [PATCH] xhci: also avoid the XHCI_ZERO_64B_REGS quirk with a + passthrough iommu +Git-commit: ecaa4902439298f6b0e29f47424a86b310a9ff4f +References: git-fixes +Patch-mainline: v6.3-rc6 + +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 +Signed-off-by: Oliver Neukum +--- + 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 +@@ -21,6 +21,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -237,6 +238,7 @@ int xhci_reset(struct xhci_hcd *xhci) + 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; + +@@ -254,7 +256,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) || !dev->iommu_group) ++ domain = iommu_get_domain_for_dev(dev); ++ if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !dev->iommu_group || ++ domain->type == IOMMU_DOMAIN_IDENTITY) + return; + + xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n"); diff --git a/series.conf b/series.conf index b56e973..f029b0f 100644 --- a/series.conf +++ b/series.conf @@ -63256,6 +63256,7 @@ patches.suse/ring-buffer-Fix-race-while-reader-and-writer-are-on-the-same-page.patch patches.suse/ftrace-Mark-get_lock_parent_ip-__always_inline.patch patches.suse/scsi-qla2xxx-Fix-memory-leak-in-qla2x00_probe_one.patch + patches.suse/xhci-also-avoid-the-XHCI_ZERO_64B_REGS-quirk-with-a-.patch patches.suse/cgroup-cpuset-Wake-up-cpuset_attach_wq-tasks-in-cpuset_cancel_attach.patch patches.suse/cifs-fix-negotiate-context-parsing.patch patches.suse/powerpc-papr_scm-Update-the-NUMA-distance-table-for-.patch