mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
xhci: also avoid the XHCI_ZERO_64B_REGS quirk with a passthrough iommu
commitecaa490243upstream. 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:12de0a35c9("xhci: Add quirk to zero 64bit registers on Renesas PCIe controllers") Cc: stable <stable@kernel.org> Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com> Acked-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20230330143056.1390020-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1122474b75
commit
83637720ea
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
|
#include <linux/iommu.h>
|
||||||
#include <linux/iopoll.h>
|
#include <linux/iopoll.h>
|
||||||
#include <linux/irq.h>
|
#include <linux/irq.h>
|
||||||
#include <linux/log2.h>
|
#include <linux/log2.h>
|
||||||
@@ -225,6 +226,7 @@ int xhci_reset(struct xhci_hcd *xhci, u64 timeout_us)
|
|||||||
static void xhci_zero_64b_regs(struct xhci_hcd *xhci)
|
static void xhci_zero_64b_regs(struct xhci_hcd *xhci)
|
||||||
{
|
{
|
||||||
struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
|
struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
|
||||||
|
struct iommu_domain *domain;
|
||||||
int err, i;
|
int err, i;
|
||||||
u64 val;
|
u64 val;
|
||||||
u32 intrs;
|
u32 intrs;
|
||||||
@@ -243,7 +245,9 @@ static void xhci_zero_64b_regs(struct xhci_hcd *xhci)
|
|||||||
* an iommu. Doing anything when there is no iommu is definitely
|
* an iommu. Doing anything when there is no iommu is definitely
|
||||||
* unsafe...
|
* 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;
|
return;
|
||||||
|
|
||||||
xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n");
|
xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user