[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 21/40] pcihp: compose PCNT callchain right before its user _GPE._
From: |
Igor Mammedov |
Subject: |
[PATCH 21/40] pcihp: compose PCNT callchain right before its user _GPE._E01 |
Date: |
Thu, 12 Jan 2023 15:02:53 +0100 |
it's a stepping stone to making build_append_pci_bus_devices() suitable
for AcpiDevAmlIfClass:build_dev_aml callback and lets further simplify
it by separating PCNT generation from slots descriptions.
It also makes PCNT callchain ASL much more readable since callchain
not longer cluttered by slots descriptors.
Plus, move will let next patch easily drop empty PCNT (pc/q35)
when there is nothing hotpluggable.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/i386/acpi-build.c | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 146f48e4ac..509a4c500d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -390,7 +390,6 @@ static void build_append_pci_bus_devices(Aml *parent_scope,
PCIBus *bus,
{
Aml *dev, *notify_method = NULL, *method;
QObject *bsel;
- PCIBus *sec;
int devfn;
bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL,
NULL);
@@ -496,12 +495,35 @@ static void build_append_pci_bus_devices(Aml
*parent_scope, PCIBus *bus,
aml_append(parent_scope, notify_method);
}
+ qobject_unref(bsel);
+}
+
+static void build_append_notfication_callback(Aml *parent_scope,
+ const PCIBus *bus)
+{
+ Aml *method;
+ PCIBus *sec;
+ QObject *bsel;
+
+ QLIST_FOREACH(sec, &bus->child, sibling) {
+ Aml *br_scope = aml_scope("S%.02X", sec->parent_dev->devfn);
+ if (pci_bus_is_root(sec) ||
+ !object_property_find(OBJECT(sec), ACPI_PCIHP_PROP_BSEL)) {
+ continue;
+ }
+ build_append_notfication_callback(br_scope, sec);
+ aml_append(parent_scope, br_scope);
+ }
+
/*
* Append PCNT method to notify about events on local and child buses.
+ * ps: hostbridge might not have hotplug (bsel) enabled but might have
+ * child bridges that do have bsel.
*/
method = aml_method("PCNT", 0, AML_NOTSERIALIZED);
/* If bus supports hotplug select it and notify about local events */
+ bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL,
NULL);
if (bsel) {
uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
@@ -523,7 +545,6 @@ static void build_append_pci_bus_devices(Aml *parent_scope,
PCIBus *bus,
}
aml_append(parent_scope, method);
-
qobject_unref(bsel);
}
@@ -1723,6 +1744,13 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
aml_append(dsdt, sb_scope);
if (pm->pcihp_bridge_en || pm->pcihp_root_en) {
+ Object *pci_host = acpi_get_i386_pci_host();
+ PCIBus *bus = PCI_HOST_BRIDGE(pci_host)->bus;
+
+ scope = aml_scope("\\_SB.PCI0");
+ build_append_notfication_callback(scope, bus);
+ aml_append(dsdt, scope);
+
scope = aml_scope("_GPE");
{
method = aml_method("_E01", 0, AML_NOTSERIALIZED);
--
2.31.1
- [PATCH 30/40] pci: make sure pci_bus_is_express() won't error out with "discards ‘const’ qualifier", (continued)
- [PATCH 30/40] pci: make sure pci_bus_is_express() won't error out with "discards ‘const’ qualifier", Igor Mammedov, 2023/01/12
- [PATCH 36/40] pcihp: acpi: ignore coldplugged bridges when composing hotpluggable slots, Igor Mammedov, 2023/01/12
- [PATCH 26/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 32/40] tests: acpi: whitelist DSDT before decoupling PCI hotplug code from basic slots description, Igor Mammedov, 2023/01/12
- [PATCH 37/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 39/40] pcihp: generate populated non-hotpluggble slot descriptions on non-hotplug path, Igor Mammedov, 2023/01/12
- [PATCH 16/40] tests: acpi: add reboot cycle to bridge test, Igor Mammedov, 2023/01/12
- [PATCH 23/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 13/40] tests: boot_sector_test: avoid crashing if status is not available yet, Igor Mammedov, 2023/01/12
- [PATCH 28/40] pci: acpi: wire up AcpiDevAmlIf interface to generic bridge, Igor Mammedov, 2023/01/12
- [PATCH 21/40] pcihp: compose PCNT callchain right before its user _GPE._E01,
Igor Mammedov <=
- [PATCH 07/40] pci_bridge: remove whitespace, Igor Mammedov, 2023/01/12
- [PATCH 04/40] tests: acpi: extend pcihp with nested bridges, Igor Mammedov, 2023/01/12
- [PATCH 31/40] pcihp: isolate rule whether slot should be described in DSDT, Igor Mammedov, 2023/01/12
- [PATCH 24/40] whitelist DSDT before adding endpoint devices to bridge testcases, Igor Mammedov, 2023/01/12
- [PATCH 35/40] tests: acpi: whitelist DSDT blobs before removing dynamic _DSM on coldplugged bridges, Igor Mammedov, 2023/01/12
- [PATCH 33/40] pcihp: acpi: decouple hotplug and generic slots description, Igor Mammedov, 2023/01/12
- [PATCH 34/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 38/40] tests: acpi: whitelist DSDT before moving non-hotpluggble slots description from hotplug path, Igor Mammedov, 2023/01/12
- [PATCH 40/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- Re: [PATCH 00/40] x86: fixing and cleaning up ACPI PCI code part 3, Igor Mammedov, 2023/01/25