Repository navigation
Conversation
Backport 2d89ca89b01f ("ACPI: PCI: take native PME control on Apple
machines"), queued in linux-pm for 7.5.
On Apple machines Linux skips _OSC and assumes control of every PCIe
feature except PME, so no root port runs the PME service. A runtime
suspended device behind a suspended bridge is then never resumed by its
PME. On a MacBookPro14,3 a USB 3 device plugged into an idle USB-C port
is not detected until something else wakes the Thunderbolt xHCI.
Carried as 0779 in linux-omarchy, linux-omarchy-eevdf and
linux-omarchy-muqss.
This was referenced Nov 25, 2026
Carry 0779 onto the 7.3.7 kernels (pkgrel 2). The patch applies to v7.3.6 at offset -3 with no fuzz, and patch-7.3.7-rc2 does not touch drivers/acpi/pci_root.c.
Carry 0779 onto the 1:7.3.6-5 kernels (pkgrel 6, epoch kept). The patch applies to v7.3.6 at offset -3 with no fuzz, and no other patch in these packages touches drivers/acpi/pci_root.c.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft. It proposes a backport of an upstream fix that is queued for 7.5. The patch is unsigned, unlike the numbered series, and 0779 is a placeholder number (#3393 holds 0778). If you would rather fold upstream 2d89ca89b01f into the next signed release than merge this, that works just as well, and this PR can carry the test results.
Problem
On Apple machines,
negotiate_os_control()indrivers/acpi/pci_root.cskips_OSC, because the firmware fails it once_OSI("Darwin")has been answered. Instead it assumes control of every PCIe feature except PME (~OSC_PCI_EXPRESS_PME_CONTROL, since 7bc5a2bad0b8). As a result, portdrv never starts the PME service on any root port.A device that runtime-suspends still arms PME# and asserts it when it needs attention, but nothing services the root port interrupt. The PCI core's once-a-second PME poll can't help either: it skips a device whose upstream bridge is runtime-suspended.
On a MacBookPro14,3 this breaks USB-C hot-plug. Each of the two Alpine Ridge Thunderbolt controllers contains an xHCI. When the USB-C ports are idle, that xHCI and the downstream port in front of it runtime-suspend to D3hot. A USB 3 device plugged in then produces no kernel message at all until something else wakes the controller. omacom/omarchy#7044 (14,3) and omacom/omarchy#15537 (14,1) work around the same symptom from userspace by keeping the controllers awake.
Change
The fix is upstream 2d89ca89b01f ("ACPI: PCI: take native PME control on Apple machines") by Francisco Beltrán Millalén. Rafael Wysocki queued it in linux-pm for 7.5: https://patch.msgid.link/[email protected].
_OSCwould have requested (calculate_control()), PME included. On this machine the_OSCline goes from[PCIeHotplug SHPCHotplug AER PCIeCapability LTR DPC]to the same list plusPME.--fuzz=0.drivers/acpi/pci_root.c,drivers/pci/pcie/pme.corpciehp_core.c.0779-acpi-pci-take-native-pme-control-on-apple.patchtolinux-omarchy,linux-omarchy-eevdfandlinux-omarchy-muqss, withpkgrelbumped in each. All three variants carry the same patches apart from the scheduler ones, so leaving it out of two would make a Mac on eevdf or muqss behave differently. Onlylinux-omarchywas built and booted, on 7.2.15 and on 7.3.7 (see Testing).linux-omarchyreaches 7.5. The upstream commit hasFixes:but noCc: stable. If a stable release picks it up anyway, this patch will no longer apply and the build will fail.Side effects
Upstream also points out that this makes
pme_is_native()true for pciehp. On the Alpine Ridge hot-plug ports,pciehp_runtime_suspend()and system suspend now disable the slot interrupt. A Thunderbolt PCIe device plugged into a runtime-suspended hot-plug port then has to be noticed through PME. The carried 0605 (rescan after a PCIe tunnel is set up) may cover that case. I have no Thunderbolt PCIe device and didn't test that path. Bjorn Helgaas copied the Thunderbolt maintainers on the upstream thread, and none of them replied.x86_apple_machinecovers every Intel Mac, but the MacBookPro14,3 is the only model tested so far, by the author, by Darrell Gum and here. Darrell's Tested-by was on 7.2.5-3, together with the author's PCI/PM series and an Alpine Ridge quirk, not bisected, and hot-plug still worked across an S3 cycle. Matthew Garrett, who wrote the original_OSCskip, asked in the thread for testing on older machines. T2 Macs uselinux-t2, which this PR doesn't touch. The Macs this could newly affect onlinux-omarchyare mainly non-T2 Intel Macs.There is no switch to turn the change off except
pcie_ports=compat, which also disables pciehp and AER. Reverting means booting the previous kernel or a snapshot.Each plug-in also logs
pcieport 0000:00:01.x: PME: Spurious native interrupt!once, just before the device is resumed. The patch's original posting explains it:pcie_pme_walk_bus()does not attribute a PME from a PCIe device behind a switch, but the device is still resumed.Testing
MacBookPro14,3 (two Alpine Ridge JHL6540, firmware 529.140.2.0.0), Omarchy 4.5.0-3, kernel command line without
pcie_ports.There were two test kernels, both built with
makepkgin anarchlinuxcontainer with GCC 16.2.1:linux-omarchy7.2.15-4 recipe (b571666) with this patch appended. GCC was the same version as for the stock package.linux-omarchyrecipe at a07a101, i.e. 7.3.7-2.The branch has since followed master back to 1:7.3.6-5 (#4205; now pkgrel 6), and I haven't rebuilt for it. 7.3.7-2 was v7.3.6 plus
patch-7.3.7-rc2. Neither that patch nor the recipe patches added or dropped in the move touchpci_root.c,pme.corpciehp_core.c. The xHCI code does differ from the tested build (0612 is new, and rc2's xHCI fixes are gone), but the PME path doesn't.In both,
pkgbasewas renamed so the kernel could be installed next to the stock one and booted from its own Limine entry. The recipe's out-of-tree module packages were left out: the NVIDIA open modules, and on 7.3.7 also IPU7, v4l2loopback and OpenRazer. For 7.3.7 the headers'libcrypto.sodependency was changed toopenssl, because this machine is still on stable with OpenSSL 3.6.On 7.3.7 the boot log has the same
_OSCline, and 7.3's new summary line readsOS native features: SHPCHotplug+ PCIeHotplug+ PME+ AER+ DPC+ LTR+.Hot-plug without sleep, 7.2.15, kernel defaults.
power/control=auto, andd3cold_allowed= 1.usb 4-2(SuperSpeed,uas) 0.24 s after the root port 00:01.1 PME interrupt, andsda1appeared 0.8 s after that.O_DIRECTgave no errors.auto(the root ports were kept atonin that run), a plugged-in SSD produced no kernel message at all.Hot-plug without sleep, 7.3.7.
d3cold_allowed= 1, with the bridges atpower/control=auto. The root ports themselves stayed aton. Both xHCIs and the ports in front of them went to D3hot.usb 4-1(SuperSpeed,uas) 0.24 s after the 00:01.1 PME interrupt, andsda1appeared 0.8 s later.usb 6-2, 0.24 s after the 00:01.2 PME interrupt.O_DIRECTgave no errors.One s2idle cycle on each kernel.
suspend_statsread success 1, fail 0. There were no AER, DPC or pciehp errors. On 7.3.7 the 00:01.1 interrupt count went up by one across the cycle, with no PME message.auto(the root ports stayed aton) and plugged in the SSD. On both kernels it enumerated 0.24 s after the PME interrupt.Other warnings.
brcmfmacflowring timeout as Wi-Fi went down before sleep;hid_field_extractfrom the T1's HID sensor hub after resume.brcmfmacflowring timeout showed up again, and ahid_field_extractwarning, this time from the T1's touchpad interface before sleep (also common in stock boots). There were no USB address errors. One warning appears in no earlier boot:amdgpu: Failed to populate edc leakage registers!, at boot and again on resume, from the Radeon Pro 560. I haven't checked it on a stock 7.3.7 kernel.cursor.no_hardware_cursorsto 1 works around it. With the same Hyprland setup, the cursor is fine on stock 7.2.15.acpi_call, plus the audio codec on 7.2.15 and a locally patched Wi-Fi driver on 7.3.7. None of them deal with PCIe port services.Not tested: other Mac models, S3, Thunderbolt PCIe devices, eevdf and muqss, more than one sleep cycle per kernel, and battery drain.
Checking on another Mac
power/control=onscript;pcie_ports=compat(the oldmacbook-t1.conffrom T1 MacBook (macbook-t1.conf) still ships pcie_ports=compat, breaking Thunderbolt dock PCIe tunneling — migration 1785944594 only covers T2 omarchy#10638). With it, the port services never start and the test shows nothing.PMEin the_OSCline.power/runtime_statusreadssuspended.The omacom/omarchy#7044 and omacom/omarchy#15537 rules are harmless alongside this patch. On the 14,3 they are no longer needed once it ships; the 14,1 is untested.