q35: turn off power_controller_present when acpi hotplug is enabled
PATCH 1/1 q35: turn off power_controller_present when acpi hotplug is enabled
Disable power control for pcie slots in case acpi hotplug is enabled (6.2+ only for compatibility reasons). This makes sure we don't get unpleasant surprises with pci devices not being functional due to slot power being turned off.
--- hw/i386/pc_q35.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
hw/i386/pc_q35.c +10 -3
@@ -247,9 +247,16 @@ static void pc_q35_init(MachineState *machine)"x-keep-pci-slot-hpc" , NULL); -if (!keep_pci_slot_hpc && acpi_pcihp) { -object_register_sugar_prop (TYPE_PCIE_SLOT ,"x-native-hotplug" , -"false" , true); +if (acpi_pcihp) { +if (keep_pci_slot_hpc) { +/* 6.2+ default: acpi-hotplug=on native-hotplug=on power-ctrl=off */ +object_register_sugar_prop (TYPE_PCIE_SLOT ,COMPAT_PROP_PCP , +"false" , true); + }else { +/* 6.1 default: acpi-hotplug=on native-hotplug=off */ +object_register_sugar_prop (TYPE_PCIE_SLOT ,"x-native-hotplug" , +"false" , true); + } }/* irq lines */
Signature · 1 line
2.33.1
Quoted 16 lines · On Tue, 16 Nov 2021 10:04:33 +0100 Gerd Hoffmann <[email protected]> wrote:
Disable power control for pcie slots in case acpi hotplug is enabled (6.2+ only for compatibility reasons). This makes sure we don't get unpleasant surprises with pci devices not being functional due to slot power being turned off.
Signed-off-by Gerd Hoffmann <[email protected]>--- hw/i386/pc_q35.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)hw/i386/pc_q35.c +0
-0@@ -247,9 +247,16 @@ static void pc_q35_init(MachineState *machine) "x-keep-pci-slot-hpc",
hw/i386/pc_q35.c static void pc_q35_init(MachineState *machine) · line 254
Quoted 10 lines
hw/i386/pc_q35.c +5
-3NULL); -if (!keep_pci_slot_hpc && acpi_pcihp) { -object_register_sugar_prop (TYPE_PCIE_SLOT ,"x-native-hotplug" , -"false" , true); +if (acpi_pcihp) { +if (keep_pci_slot_hpc) { +/* 6.2+ default: acpi-hotplug=on native-hotplug=on power-ctrl=off */ +object_register_sugar_prop (TYPE_PCIE_SLOT ,COMPAT_PROP_PCP , +"false" , true);
that will also turn off COMPAT_PROP_PCP on ports attached to PXBs, where ACPI hotplug is not used and native one is active. So question is if it's expected behavior?
Quoted 8 lines
hw/i386/pc_q35.c +5
-0+ }else { +/* 6.1 default: acpi-hotplug=on native-hotplug=off */ +object_register_sugar_prop (TYPE_PCIE_SLOT ,"x-native-hotplug" , +"false" , true); + } }/* irq lines */
Quoted 21 lines · Igor Mammedov
Quoted 18 lines · On Tue, 16 Nov 2021 10:04:33 +0100 Gerd Hoffmann <[email protected]> wrote:
Disable power control for pcie slots in case acpi hotplug is enabled (6.2+ only for compatibility reasons). This makes sure we don't get unpleasant surprises with pci devices not being functional due to slot power being turned off.
Signed-off-by Gerd Hoffmann <[email protected]>--- hw/i386/pc_q35.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)hw/i386/pc_q35.c +0
-0@@ -247,9 +247,16 @@ static void pc_q35_init(MachineState *machine)"x-keep-pci-slot-hpc" , NULL);
Quoted 11 lines
hw/i386/pc_q35.c static void pc_q35_init(MachineState *machine) · line 254
Quoted 8 lines
hw/i386/pc_q35.c +5
-3-if (!keep_pci_slot_hpc && acpi_pcihp) { -object_register_sugar_prop (TYPE_PCIE_SLOT ,"x-native-hotplug" , -"false" , true); +if (acpi_pcihp) { +if (keep_pci_slot_hpc) { +/* 6.2+ default: acpi-hotplug=on native-hotplug=on power-ctrl=off */ +object_register_sugar_prop (TYPE_PCIE_SLOT ,COMPAT_PROP_PCP , +"false" , true);that will also turn off
COMPAT_PROP_PCPon ports attached to PXBs, where ACPI hotplug is not used and native one is active.
Oh, wasn't aware of that detail.
Quoted 1 line
So question is if it's expected behavior?
Nope. When native hotplug is used slot power control should be enabled.
Not sure how to handle that best though ...
take care,
Gerd