All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] q35: turn off power_controller_present when acpi hotplug is enabled
@ 2021-11-16  9:04 Gerd Hoffmann
  2021-11-16 19:26 ` Igor Mammedov
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2021-11-16  9:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Richard Henderson,
	Gerd Hoffmann, Paolo Bonzini, imammedo

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 <kraxel@redhat.com>
---
 hw/i386/pc_q35.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index e1e100316d93..869ca4c130f0 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -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 */
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] q35: turn off power_controller_present when acpi hotplug is enabled
  2021-11-16  9:04 [PATCH] q35: turn off power_controller_present when acpi hotplug is enabled Gerd Hoffmann
@ 2021-11-16 19:26 ` Igor Mammedov
  2021-11-17  8:22   ` Gerd Hoffmann
  0 siblings, 1 reply; 3+ messages in thread
From: Igor Mammedov @ 2021-11-16 19:26 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Eduardo Habkost, Michael S. Tsirkin, Richard Henderson,
	qemu-devel, Paolo Bonzini

On Tue, 16 Nov 2021 10:04:33 +0100
Gerd Hoffmann <kraxel@redhat.com> 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 <kraxel@redhat.com>
> ---
>  hw/i386/pc_q35.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index e1e100316d93..869ca4c130f0 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -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);

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?

> +        } else {
> +            /* 6.1 default: acpi-hotplug=on native-hotplug=off */
> +            object_register_sugar_prop(TYPE_PCIE_SLOT, "x-native-hotplug",
> +                                       "false", true);
> +        }
>      }
>  
>      /* irq lines */



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] q35: turn off power_controller_present when acpi hotplug is enabled
  2021-11-16 19:26 ` Igor Mammedov
@ 2021-11-17  8:22   ` Gerd Hoffmann
  0 siblings, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2021-11-17  8:22 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Eduardo Habkost, Michael S. Tsirkin, Richard Henderson,
	qemu-devel, Paolo Bonzini

On Tue, Nov 16, 2021 at 08:26:41PM +0100, Igor Mammedov wrote:
> On Tue, 16 Nov 2021 10:04:33 +0100
> Gerd Hoffmann <kraxel@redhat.com> 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 <kraxel@redhat.com>
> > ---
> >  hw/i386/pc_q35.c | 13 ++++++++++---
> >  1 file changed, 10 insertions(+), 3 deletions(-)
> > 
> > diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> > index e1e100316d93..869ca4c130f0 100644
> > --- a/hw/i386/pc_q35.c
> > +++ b/hw/i386/pc_q35.c
> > @@ -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);
> 
> that will also turn off COMPAT_PROP_PCP on ports attached to PXBs,
> where ACPI hotplug is not used and native one is active.

Oh, wasn't aware of that detail.

> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-17  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16  9:04 [PATCH] q35: turn off power_controller_present when acpi hotplug is enabled Gerd Hoffmann
2021-11-16 19:26 ` Igor Mammedov
2021-11-17  8:22   ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.