Skip to contentSkip to conversation

ACPI / PCI: Bail early in acpi_pci_add_bus() if there is no ACPI handle

PATCH Applied Vitaly Kuznetsov 3 participants 3 messages Sep 14, 2017 – Sep 26, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / PCI: Bail early in acpi_pci_add_bus() if there is no ACPI handle

Hyper-V instances support PCI pass-through which is implemented through PV pci-hyperv driver. When a device is passed through a new root PCI bus is created in the guest. The bus sits on top of VMBus and has no associated information in ACPI. acpi_pci_add_bus() in this case proceeds all the way to acpi_evaluate_dsm() with reports

    ACPI: \: failed to evaluate _DSM (0x1001)

While acpi_pci_slot_enumerate() and acpiphp_enumerate_slots() are protected against ACPI_HANDLE() being NULL and do nothing acpi_evaluate_dsm() is not and gives us the error. It seems the correct fix is to not do anything in acpi_pci_add_bus() in such cases.

---
 drivers/pci/pci-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci-acpi.c +1 -1
index a8da543b3814..4708eb9df71b 100644
@@ -624,7 +624,7 @@ void acpi_pci_add_bus(struct pci_bus *bus)
 	union acpi_object *obj;
 	struct pci_host_bridge *bridge;
 
-	if (acpi_pci_disabled || !bus->bridge)
+	if (acpi_pci_disabled || !bus->bridge || !ACPI_HANDLE(bus->bridge))
 		return;
 
 	acpi_pci_slot_enumerate(bus);
Signature · 1 line
2.13.5
#1 lore raw
Quoted 6 lines · Vitaly Kuznetsov

Hyper-V instances support PCI pass-through which is implemented through PV pci-hyperv driver. When a device is passed through a new root PCI bus is created in the guest. The bus sits on top of VMBus and has no associated information in ACPI. acpi_pci_add_bus() in this case proceeds all the way to acpi_evaluate_dsm() with reports

Quoted 8 lines
    ACPI: \: failed to evaluate _DSM (0x1001)

While acpi_pci_slot_enumerate() and acpiphp_enumerate_slots() are protected against ACPI_HANDLE() being NULL and do nothing acpi_evaluate_dsm() is not and gives us the error. It seems the correct fix is to not do anything in acpi_pci_add_bus() in such cases.

Applied to pci/acpi for v4.15, thanks!

Rafael, let me know if you have any objections or if you'd rather take it yourself.

Quoted 24 lines
---
 drivers/pci/pci-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci-acpi.c +1 -1
index a8da543b3814..4708eb9df71b 100644
@@ -624,7 +624,7 @@ void acpi_pci_add_bus(struct pci_bus *bus)
 	union acpi_object *obj;
 	struct pci_host_bridge *bridge;
 
-	if (acpi_pci_disabled || !bus->bridge)
+	if (acpi_pci_disabled || !bus->bridge || !ACPI_HANDLE(bus->bridge))
 		return;
 
 	acpi_pci_slot_enumerate(bus);
Signature · 6 lines
2.13.5

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 14 lines · CEST Bjorn Helgaas
Quoted 13 lines · Vitaly Kuznetsov

Hyper-V instances support PCI pass-through which is implemented through PV pci-hyperv driver. When a device is passed through a new root PCI bus is created in the guest. The bus sits on top of VMBus and has no associated information in ACPI. acpi_pci_add_bus() in this case proceeds all the way to acpi_evaluate_dsm() with reports

    ACPI: \: failed to evaluate _DSM (0x1001)

While acpi_pci_slot_enumerate() and acpiphp_enumerate_slots() are protected against ACPI_HANDLE() being NULL and do nothing acpi_evaluate_dsm() is not and gives us the error. It seems the correct fix is to not do anything in acpi_pci_add_bus() in such cases.

Quoted 6 lines
Quoted 1 line

Applied to pci/acpi for v4.15, thanks!

Rafael, let me know if you have any objections or if you'd rather take it yourself.

No objections, all is fine.

Thanks,
Rafael