linux-stable/drivers/iommu
Mario Limonciello 46b9f2480b iommu/amd: Mark interrupt as managed
[ Upstream commit 0feda94c86 ]

On many systems that have an AMD IOMMU the following sequence of
warnings is observed during bootup.

```
pci 0000:00:00.2  can't derive routing for PCI INT A
pci 0000:00:00.2: PCI INT A: not connected
```

This series of events happens because of the IOMMU initialization
sequence order and the lack of _PRT entries for the IOMMU.

During initialization the IOMMU driver first enables the PCI device
using pci_enable_device().  This will call acpi_pci_irq_enable()
which will check if the interrupt is declared in a PCI routing table
(_PRT) entry. According to the PCI spec [1] these routing entries
are only required under PCI root bridges:
	The _PRT object is required under all PCI root bridges

The IOMMU is directly connected to the root complex, so there is no
parent bridge to look for a _PRT entry. The first warning is emitted
since no entry could be found in the hierarchy. The second warning is
then emitted because the interrupt hasn't yet been configured to any
value.  The pin was configured in pci_read_irq() but the byte in
PCI_INTERRUPT_LINE return 0xff which means "Unknown".

After that sequence of events pci_enable_msi() is called and this
will allocate an interrupt.

That is both of these warnings are totally harmless because the IOMMU
uses MSI for interrupts.  To avoid even trying to probe for a _PRT
entry mark the IOMMU as IRQ managed. This avoids both warnings.

Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/Device_Configuration.html?highlight=_prt#prt-pci-routing-table [1]
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Fixes: cffe0a2b5a ("x86, irq: Keep balance of IOAPIC pin reference count")
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20240122233400.1802-1-mario.limonciello@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:22:35 -04:00
..
Kconfig
Makefile
amd_iommu.c iommu/amd: Fix sleeping in atomic in increase_address_space() 2021-03-11 14:05:01 +01:00
amd_iommu.h
amd_iommu_debugfs.c
amd_iommu_init.c iommu/amd: Mark interrupt as managed 2024-03-26 18:22:35 -04:00
amd_iommu_proto.h
amd_iommu_quirks.c
amd_iommu_types.h iommu/amd: Set DTE[IntTabLen] to represent 512 IRTEs 2020-12-11 13:25:03 +01:00
amd_iommu_v2.c iommu/amd: Fix pci device refcount leak in ppr_notifier() 2023-01-18 11:30:30 +01:00
arm-smmu-regs.h
arm-smmu-v3.c iommu/arm-smmu-v3: fix event handling soft lockup 2022-04-15 14:15:01 +02:00
arm-smmu.c
dma-iommu.c
dmar.c iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() 2022-12-08 11:18:34 +01:00
exynos-iommu.c iommu/exynos: Handle failed IOMMU device registration properly 2022-08-25 11:15:22 +02:00
fsl_pamu.c iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe() 2023-01-18 11:30:30 +01:00
fsl_pamu.h
fsl_pamu_domain.c
fsl_pamu_domain.h
intel-iommu.c iommu/vt-d: Clean up si_domain in the init_dmars() error path 2022-11-03 23:52:26 +09:00
intel-pasid.c
intel-pasid.h
intel-svm.c
intel_irq_remapping.c iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping() 2022-02-08 18:23:15 +01:00
io-pgtable-arm-v7s.c
io-pgtable-arm.c iommu/io-pgtable-arm: Fix table descriptor paddr formatting 2022-01-27 09:04:22 +01:00
io-pgtable.c
io-pgtable.h
iommu-debugfs.c
iommu-sysfs.c
iommu-traces.c
iommu.c
iova.c iommu/iova: Fix race between FQ timeout and teardown 2022-01-27 09:04:22 +01:00
ipmmu-vmsa.c
irq_remapping.c
irq_remapping.h
msm_iommu.c iommu/msm: Fix an incorrect NULL check on list iterator 2022-06-14 16:59:29 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mediatek: Add list_del in mtk_iommu_remove 2022-06-14 16:59:25 +02:00
mtk_iommu.h
mtk_iommu_v1.c iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() 2023-01-18 11:30:55 +01:00
of_iommu.c
omap-iommu-debug.c iommu/omap: Fix buffer overflow in debugfs 2022-10-26 13:19:35 +02:00
omap-iommu.c
omap-iommu.h
omap-iopgtable.h
qcom_iommu.c iommu/arm-smmu: qcom_iommu: Add of_node_put() when breaking out of loop 2022-08-25 11:15:23 +02:00
rockchip-iommu.c
s390-iommu.c
tegra-gart.c
tegra-smmu.c