[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/4] acpi: pcihp: disable power control on PCIe slot
|
From: |
Igor Mammedov |
|
Subject: |
[PATCH 3/4] acpi: pcihp: disable power control on PCIe slot |
|
Date: |
Thu, 24 Feb 2022 12:44:10 -0500 |
Previous patch [1] fixed unconditional power handling on a PCIe
slot, and make it honor PCI_EXP_SLTCAP_PCP capability.
Use COMPAT_PROP_PCP to disable power control (PCI_EXP_SLTCAP_PCP)
on PCIe slot when its plug callbacks are wired to ACPI pcihp,
which effectively leaves stop always powered.
PS:
See [1] for detailed description of the issue [2] and how it's
being addressed.
1) "pcie: update slot power status only is power control is enabled"
2)
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2053584
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/acpi/pcihp.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 6befd23e16..bc47d1bf64 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -32,6 +32,7 @@
#include "hw/pci/pci_bridge.h"
#include "hw/pci/pci_host.h"
#include "hw/pci/pcie_port.h"
+#include "hw/pci-bridge/xio3130_downstream.h"
#include "hw/i386/acpi-build.h"
#include "hw/acpi/acpi.h"
#include "hw/pci/pci_bus.h"
@@ -329,6 +330,15 @@ void acpi_pcihp_device_pre_plug_cb(HotplugHandler
*hotplug_dev,
GINT_TO_POINTER(pdev->acpi_index),
g_cmp_uint32, NULL);
}
+
+ /*
+ * since acpi_pcihp manages hotplug, disable PCI-E power control on slot
+ */
+ if (object_dynamic_cast(OBJECT(dev), TYPE_PCIE_ROOT_PORT) ||
+ object_dynamic_cast(OBJECT(dev), TYPE_XIO3130_DOWNSTREAM)) {
+ object_property_set_bool(OBJECT(dev), COMPAT_PROP_PCP, false,
+ &error_abort);
+ }
}
void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,
--
2.31.1
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, (continued)
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Michael S. Tsirkin, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Gerd Hoffmann, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Michael S. Tsirkin, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Michael S. Tsirkin, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Michael S. Tsirkin, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Gerd Hoffmann, 2022/02/28
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/28
[PATCH 3/4] acpi: pcihp: disable power control on PCIe slot,
Igor Mammedov <=
[PATCH 4/4] q35: compat: keep hotplugged PCIe device broken after migration for 6.2-older machine types, Igor Mammedov, 2022/02/24
Re: [PATCH 0/4] Fix broken PCIe device after migration, Michael S. Tsirkin, 2022/02/24
Re: [PATCH 0/4] Fix broken PCIe device after migration, Michael S. Tsirkin, 2022/02/25