Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
From: clowdyffs <alex@clowdydev.com>
Date: Sat, 19 Sep 2026 20:55:46 -0400
Subject: [PATCH] ACPICA: Preserve the parent-derived PCI bus when inspecting bridges

A PCI_Config operation region first used during a bridge's ACPI power-up
can be initialized before the PCI core restores that bridge's bus-number
registers. acpi_hw_get_pci_device_info() has already located the bridge
using its parent's secondary bus. Reading a zero Primary Bus Number and
assigning it to pci_id->bus then misdirects the following secondary-bus
read and caches the wrong region address.

On MacBookPro14,1, first-resume tracing records UPSB at 04:00.0 with
header type 1 and primary bus 0. Region derivation returns 00:00.0
successfully. The H530 region then directs 150,120 mailbox polls to the
host bridge; three exhausted firmware retry sequences cost about seven
seconds. Two downstream-bridge regions show the same address loss.

Keep the address already derived from the parent and remove the
unnecessary primary-bus read. The secondary-bus read then uses that same
correct bridge address. This changes neither the PCI power sequence nor
firmware retry limits.

Hardware validation on MacBookPro14,1 confirms correct PCI region
addresses and successful mailbox access: the three firmware retry
sequences fell from 6.939 seconds to 1.836 milliseconds. A replay of the
actual C helper also corrects two captured reset-primary cases and
preserves six comparison cases.

A separate Thunderbolt controller power-transition failure still occurs
with this correction. This change fixes PCI region address derivation.

Fixes: 95abccb576c4 ("ACPICA: Obsolete the acpi_os_derive_pci_id OSL interface")
Link: https://github.com/open-acpica/acpica/pull/1235
Assisted-by: LLM
Signed-off-by: clowdyffs <alex@clowdydev.com>
---
Linux-form carry of ACPICA commit 615f1b568156cf6a58040839f4ade773d8da7cf9.
Upstream PR #1235 is pending review, not accepted or merged. Update this
carry with upstream review and drop it once the base kernel includes the fix.
The author sign-off above is preserved from the upstream submission.

diff --git a/drivers/acpi/acpica/hwpci.c b/drivers/acpi/acpica/hwpci.c
--- a/drivers/acpi/acpica/hwpci.c
+++ b/drivers/acpi/acpica/hwpci.c
@@ -13,7 +13,6 @@

/* PCI configuration space values */
#define PCI_CFG_HEADER_TYPE_REG 0x0E
-#define PCI_CFG_PRIMARY_BUS_NUMBER_REG 0x18
#define PCI_CFG_SECONDARY_BUS_NUMBER_REG 0x19
/* PCI header values */
#define PCI_HEADER_TYPE_MASK 0x7F
@@ -358,17 +357,13 @@
return (AE_OK);
}

- /* Bridge: Get the Primary bus_number */
-
- status = acpi_os_read_pci_configuration(pci_id,
- PCI_CFG_PRIMARY_BUS_NUMBER_REG,
- &pci_value, 8);
- if (ACPI_FAILURE(status)) {
- return (status);
- }
-
+ /*
+ * Keep the bus derived from the parent bridge. The Primary Bus Number
+ * register may still contain its reset value when a region is first
+ * accessed during resume, before the PCI core restores bridge state.
+ * Replacing the derived bus would also misdirect the following read.
+ */
*is_bridge = TRUE;
- pci_id->bus = (u16)pci_value;

/* Bridge: Get the Secondary bus_number */
5 changes: 4 additions & 1 deletion pkgbuilds/linux-omarchy-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pkgbase=linux-omarchy-bore
pkgver=7.2.5
pkgrel=6
pkgrel=7
pkgdesc='Omarchy Linux (BORE CPU scheduler, ADIOS I/O scheduler)'
url='https://omarchy.org'
arch=(
Expand Down Expand Up @@ -127,6 +127,7 @@ source=(
0750-applesmc-cache-race.patch{,.sig}
0751-applesmc-key-backlight-workqueue-leak.patch{,.sig}
0770-acpi-pm-acer-swift3-sf314-56g-power-resource.patch{,.sig}
0771-acpica-preserve-parent-derived-pci-bus.patch
0800-platform-updates.patch{,.sig}
0801-amd-pmf-util-unbind-use-after-free.patch{,.sig}
0850-futex-wait-multiple.patch{,.sig}
Expand Down Expand Up @@ -310,6 +311,7 @@ b2sums=('48551bee71cd02815136fb8abe7da4464c2e17c89ef35cb0c0530c8b969fe12127ca97a
'SKIP'
'1b63569b589e994d1869e2f8eaf5d4ee225fe68862ac5c848e46544b827ca5fddb4bf060f5f39001608fd9bb284eec005f5f9b095307d3a008c9ea8957c2fad1'
'SKIP'
'ed4a4031b35dd9413510862c0ea06c1cd42839b622a7ef5e05ff432a2096a29dfbe77d0ef6db2481f6eb2f1bf59d0974a0ae28dd2c911282b61273dbc02e88a9'
'073514dabc88f0206911eb27eb36157e425849221056438340b22ee7bfa6997b58ce7dc4470b09d7ee96f6374f117d91cc19d9032401b2355d1c0aba6fc75771'
'SKIP'
'd7dffb68fd22db7ef41d1ac193dd297fb6150f034f257a44e6cb0a4848dc4a94e328c2e26d5296a72993e2db75d09e3ac46456d337a5bae767fb266082d3cc66'
Expand Down Expand Up @@ -505,6 +507,7 @@ sha256sums=('55ddf0df8325d9dad96fcff7bd93977d22e3f50af06527572af59b77c7632b78'
'SKIP'
'2e1e2a0eb039ce61c1612bf6c7ab5227b99df053bcd5592da7758715dd333fda'
'SKIP'
'5894f4b9e312d310f74b7465b953f1ecfa58328cc18b303614a2d2d4d7b8a067'
'17de1f76da3db42dc3c7829a22953cd2c6de916999d809e3fb0bbb741753ec8f'
'SKIP'
'd90cc6570a47c8754e4c5d45834e0434c0a1fcabda9b8933b1fba84e3dabc083'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
From: clowdyffs <alex@clowdydev.com>
Date: Sat, 19 Sep 2026 20:55:46 -0400
Subject: [PATCH] ACPICA: Preserve the parent-derived PCI bus when inspecting bridges

A PCI_Config operation region first used during a bridge's ACPI power-up
can be initialized before the PCI core restores that bridge's bus-number
registers. acpi_hw_get_pci_device_info() has already located the bridge
using its parent's secondary bus. Reading a zero Primary Bus Number and
assigning it to pci_id->bus then misdirects the following secondary-bus
read and caches the wrong region address.

On MacBookPro14,1, first-resume tracing records UPSB at 04:00.0 with
header type 1 and primary bus 0. Region derivation returns 00:00.0
successfully. The H530 region then directs 150,120 mailbox polls to the
host bridge; three exhausted firmware retry sequences cost about seven
seconds. Two downstream-bridge regions show the same address loss.

Keep the address already derived from the parent and remove the
unnecessary primary-bus read. The secondary-bus read then uses that same
correct bridge address. This changes neither the PCI power sequence nor
firmware retry limits.

Hardware validation on MacBookPro14,1 confirms correct PCI region
addresses and successful mailbox access: the three firmware retry
sequences fell from 6.939 seconds to 1.836 milliseconds. A replay of the
actual C helper also corrects two captured reset-primary cases and
preserves six comparison cases.

A separate Thunderbolt controller power-transition failure still occurs
with this correction. This change fixes PCI region address derivation.

Fixes: 95abccb576c4 ("ACPICA: Obsolete the acpi_os_derive_pci_id OSL interface")
Link: https://github.com/open-acpica/acpica/pull/1235
Assisted-by: LLM
Signed-off-by: clowdyffs <alex@clowdydev.com>
---
Linux-form carry of ACPICA commit 615f1b568156cf6a58040839f4ade773d8da7cf9.
Upstream PR #1235 is pending review, not accepted or merged. Update this
carry with upstream review and drop it once the base kernel includes the fix.
The author sign-off above is preserved from the upstream submission.

diff --git a/drivers/acpi/acpica/hwpci.c b/drivers/acpi/acpica/hwpci.c
--- a/drivers/acpi/acpica/hwpci.c
+++ b/drivers/acpi/acpica/hwpci.c
@@ -13,7 +13,6 @@

/* PCI configuration space values */
#define PCI_CFG_HEADER_TYPE_REG 0x0E
-#define PCI_CFG_PRIMARY_BUS_NUMBER_REG 0x18
#define PCI_CFG_SECONDARY_BUS_NUMBER_REG 0x19
/* PCI header values */
#define PCI_HEADER_TYPE_MASK 0x7F
@@ -358,17 +357,13 @@
return (AE_OK);
}

- /* Bridge: Get the Primary bus_number */
-
- status = acpi_os_read_pci_configuration(pci_id,
- PCI_CFG_PRIMARY_BUS_NUMBER_REG,
- &pci_value, 8);
- if (ACPI_FAILURE(status)) {
- return (status);
- }
-
+ /*
+ * Keep the bus derived from the parent bridge. The Primary Bus Number
+ * register may still contain its reset value when a region is first
+ * accessed during resume, before the PCI core restores bridge state.
+ * Replacing the derived bus would also misdirect the following read.
+ */
*is_bridge = TRUE;
- pci_id->bus = (u16)pci_value;

/* Bridge: Get the Secondary bus_number */
5 changes: 4 additions & 1 deletion pkgbuilds/linux-omarchy/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pkgbase=linux-omarchy
pkgver=7.2.5
pkgrel=6
pkgrel=7
pkgdesc='Omarchy Linux'
url='https://omarchy.org'
arch=(
Expand Down Expand Up @@ -126,6 +126,7 @@ source=(
0750-applesmc-cache-race.patch{,.sig}
0751-applesmc-key-backlight-workqueue-leak.patch{,.sig}
0770-acpi-pm-acer-swift3-sf314-56g-power-resource.patch{,.sig}
0771-acpica-preserve-parent-derived-pci-bus.patch
0800-platform-updates.patch{,.sig}
0801-amd-pmf-util-unbind-use-after-free.patch{,.sig}
0850-futex-wait-multiple.patch{,.sig}
Expand Down Expand Up @@ -307,6 +308,7 @@ b2sums=('48551bee71cd02815136fb8abe7da4464c2e17c89ef35cb0c0530c8b969fe12127ca97a
'SKIP'
'1b63569b589e994d1869e2f8eaf5d4ee225fe68862ac5c848e46544b827ca5fddb4bf060f5f39001608fd9bb284eec005f5f9b095307d3a008c9ea8957c2fad1'
'SKIP'
'ed4a4031b35dd9413510862c0ea06c1cd42839b622a7ef5e05ff432a2096a29dfbe77d0ef6db2481f6eb2f1bf59d0974a0ae28dd2c911282b61273dbc02e88a9'
'073514dabc88f0206911eb27eb36157e425849221056438340b22ee7bfa6997b58ce7dc4470b09d7ee96f6374f117d91cc19d9032401b2355d1c0aba6fc75771'
'SKIP'
'd7dffb68fd22db7ef41d1ac193dd297fb6150f034f257a44e6cb0a4848dc4a94e328c2e26d5296a72993e2db75d09e3ac46456d337a5bae767fb266082d3cc66'
Expand Down Expand Up @@ -500,6 +502,7 @@ sha256sums=('55ddf0df8325d9dad96fcff7bd93977d22e3f50af06527572af59b77c7632b78'
'SKIP'
'2e1e2a0eb039ce61c1612bf6c7ab5227b99df053bcd5592da7758715dd333fda'
'SKIP'
'5894f4b9e312d310f74b7465b953f1ecfa58328cc18b303614a2d2d4d7b8a067'
'17de1f76da3db42dc3c7829a22953cd2c6de916999d809e3fb0bbb741753ec8f'
'SKIP'
'd90cc6570a47c8754e4c5d45834e0434c0a1fcabda9b8933b1fba84e3dabc083'
Expand Down