[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/34] x86: pcihp: fix missing PCNT callchain when intermediat
From: |
Igor Mammedov |
Subject: |
[PATCH v2 07/34] x86: pcihp: fix missing PCNT callchain when intermediate root-port has 'hotplug=off' set |
Date: |
Thu, 2 Mar 2023 17:15:16 +0100 |
Beside BSEL numbers change (due to 2 extra root-ports in q35/miltibridge test),
following change is expected:
Scope (\_SB.PCI0)
{
...
+ Scope (S50)
+ {
+ Scope (S00)
+ {
+ Method (PCNT, 0, NotSerialized)
+ {
+ BNUM = Zero
+ DVNT (PCIU, One)
+ DVNT (PCID, 0x03)
+ }
+ }
+
+ Method (PCNT, 0, NotSerialized)
+ {
+ ^S00.PCNT
+ }
+ }
...
Method (PCNT, 0, NotSerialized)
{
+ ^S50.PCNT ()
^S13.PCNT ()
^S12.PCNT ()
^S11.PCNT ()
I practice [1] hasn't broke anything since on hardware side we unset
hotplug_handler on such intermediate port => hotplug behind it has
not been properly wired and as result not worked.
1)
Fixes: ddab4d3fae4e8 ("pcihp: compose PCNT callchain right before its user
_GPE._E01")
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/i386/acpi-build.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index b19fb4259e..c691104d47 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -517,16 +517,24 @@ static bool build_append_notfication_callback(Aml
*parent_scope,
PCIBus *sec;
QObject *bsel;
int nr_notifiers = 0;
+ GQueue *pcnt_bus_list = g_queue_new();
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)) {
+ if (pci_bus_is_root(sec)) {
continue;
}
nr_notifiers = nr_notifiers +
build_append_notfication_callback(br_scope, sec);
- aml_append(parent_scope, br_scope);
+ /*
+ * add new child scope to parent
+ * and keep track of bus that have PCNT,
+ * bus list is used later to call children PCNTs from this level PCNT
+ */
+ if (nr_notifiers) {
+ g_queue_push_tail(pcnt_bus_list, sec);
+ aml_append(parent_scope, br_scope);
+ }
}
/*
@@ -550,17 +558,13 @@ static bool build_append_notfication_callback(Aml
*parent_scope,
}
/* Notify about child bus events in any case */
- QLIST_FOREACH(sec, &bus->child, sibling) {
- if (pci_bus_is_root(sec) ||
- !object_property_find(OBJECT(sec), ACPI_PCIHP_PROP_BSEL)) {
- continue;
- }
-
+ while ((sec = g_queue_pop_head(pcnt_bus_list))) {
aml_append(method, aml_name("^S%.02X.PCNT", sec->parent_dev->devfn));
}
aml_append(parent_scope, method);
qobject_unref(bsel);
+ g_queue_free(pcnt_bus_list);
return !!nr_notifiers;
}
--
2.39.1
- [PATCH v2 13/34] tests: acpi: whitelist DSDT blobs before isolating PCI _DSM func 0 prolog, (continued)
- [PATCH v2 13/34] tests: acpi: whitelist DSDT blobs before isolating PCI _DSM func 0 prolog, Igor Mammedov, 2023/03/02
- [PATCH v2 14/34] pcihp: move PCI _DSM function 0 prolog into separate function, Igor Mammedov, 2023/03/02
- [PATCH v2 18/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02
- [PATCH v2 04/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02
- [PATCH v2 22/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02
- [PATCH v2 28/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02
- [PATCH v2 29/34] pci: move acpi-index uniqueness check to generic PCI device code, Igor Mammedov, 2023/03/02
- [PATCH v2 33/34] pcihp: move fields enabling hotplug into AcpiPciHpState, Igor Mammedov, 2023/03/02
- [PATCH v2 34/34] pcihp: add ACPI PCI hotplug specific is_hotpluggable_bus() callback, Igor Mammedov, 2023/03/02
- [PATCH v2 20/34] tests: acpi: add device with acpi-index on non-hotpluggble bus, Igor Mammedov, 2023/03/02
- [PATCH v2 07/34] x86: pcihp: fix missing PCNT callchain when intermediate root-port has 'hotplug=off' set,
Igor Mammedov <=
- [PATCH v2 12/34] pci: fix 'hotplugglable' property behavior, Igor Mammedov, 2023/03/02
- [PATCH v2 16/34] tests: acpi: whitelist DSDT before adding EDSM method, Igor Mammedov, 2023/03/02
- [PATCH v2 02/34] tests: acpi: whitelist new q35.noacpihp test and pc.hpbrroot, Igor Mammedov, 2023/03/02
- [PATCH v2 08/34] tests: acpi: whitelist pc/DSDT.hpbrroot and pc/DSDT.hpbridge tests, Igor Mammedov, 2023/03/02
- [PATCH v2 05/34] tests: acpi: whitelist q35/DSDT.multi-bridge before extending testcase, Igor Mammedov, 2023/03/02
- [PATCH v2 09/34] x86: pcihp: fix missing bridge AML when intermediate root-port has 'hotplug=off' set, Igor Mammedov, 2023/03/02
- [PATCH v2 17/34] acpi: pci: add EDSM method to DSDT, Igor Mammedov, 2023/03/02
- [PATCH v2 25/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02
- [PATCH v2 31/34] acpi: pci: move BSEL into build_append_pcihp_slots(), Igor Mammedov, 2023/03/02
- [PATCH v2 24/34] acpi: pci: describe all functions on populated slots, Igor Mammedov, 2023/03/02