Skip to contentSkip to conversation

acpi: Fixed incorrect ACPI generation for pci bridges

PATCH Applied Marcel Apfelbaum 2 participants 2 messages Mar 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: Fixed incorrect ACPI generation for pci bridges

Commit 8dcf525abc5dff785251a881f9764dd961065c0d appended description for all occupied non hotpluggable PCI slots. However the bridge devices are already added to SSDT, adding them again will create an incorrect SSDT table.

Fixed by skipping the pci bridge devices, marking them as 'system'.

---
 hw/i386/acpi-build.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +2 -1
index 7ecfd70..60abb57 100644
@@ -841,7 +841,8 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
         pc = PCI_DEVICE_GET_CLASS(pdev);
         dc = DEVICE_GET_CLASS(pdev);
 
-        if (pc->class_id == PCI_CLASS_BRIDGE_ISA) {
+        if (pc->class_id == PCI_CLASS_BRIDGE_ISA ||
+            pc->is_bridge) { /* DSDT or SSDT above */
             set_bit(slot, slot_device_system);
         }
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 8 lines · Marcel Apfelbaum

Commit 8dcf525abc5dff785251a881f9764dd961065c0d appended description for all occupied non hotpluggable PCI slots. However the bridge devices are already added to SSDT, adding them again will create an incorrect SSDT table.

Fixed by skipping the pci bridge devices, marking them as 'system'.

Applied.
I tweaked the commit log and comment a bit.

Quoted 20 lines
---
 hw/i386/acpi-build.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +2 -1
index 7ecfd70..60abb57 100644
@@ -841,7 +841,8 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
         pc = PCI_DEVICE_GET_CLASS(pdev);
         dc = DEVICE_GET_CLASS(pdev);
 
-        if (pc->class_id == PCI_CLASS_BRIDGE_ISA) {
+        if (pc->class_id == PCI_CLASS_BRIDGE_ISA ||
+            pc->is_bridge) { /* DSDT or SSDT above */
             set_bit(slot, slot_device_system);
         }
 
Signature · 1 line
1.8.3.1