diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index ef2623257a71a059f5dc5067ca2b4c229397b490..45eb03aa3d18a900989a235c65412649105365de 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -5009,6 +5009,7 @@ static int __init probe_acpi_namespace_devices(void) struct device *dev; int i, ret = 0; u8 bus, devfn; + bool use_pn_dev = false; for_each_active_iommu(iommu, drhd) { for_each_active_dev_scope(drhd->devices, @@ -5034,11 +5035,8 @@ static int __init probe_acpi_namespace_devices(void) pci_device = pci_get_domain_bus_and_slot(iommu->segment, bus, devfn); - if (!pci_device) { - pr_info("cannot get the corresponding pci_device\n"); - ret = -ENODEV; - goto unlock; - } + if (!pci_device) + use_pn_dev = true; info = dmar_search_domain_by_dev_info(iommu->segment, bus, devfn); if (!info) { @@ -5071,7 +5069,11 @@ static int __init probe_acpi_namespace_devices(void) } } if (!info) - ret = acpi_device_create_direct_mappings(&pci_device->dev, dev); + if (use_pn_dev) + ret = acpi_device_create_direct_mappings(pn_dev, dev); + else + ret = acpi_device_create_direct_mappings(&pci_device->dev, + dev); else ret = acpi_device_create_direct_mappings(info->dev, dev); unlock: