Repository navigation
linux-omarchy: MacBookPro14,3 backlight, BCM43602 D0, Thunderbolt and fan s2idle fixes - #596
angellindo wants to merge 3 commits into
Conversation
|
Updated the description after a final checkup on 2026-09-24. The patches are unchanged, and New since the last update:
|
|
A follow-up on 0663 (BCM43602 kept in D0 across suspend), since a keep-in-D0 patch could be suspected of blocking deeper package C-states. On a MacBookPro14,3 (kernel 7.2.5-omarchy, iGPU mode) the package never goes past PC3 in s2idle. It stays at PC3 with 0663 applied, with Wi-Fi rfkilled, and with So 0663 is not the s2idle power problem on this model. The same hardware reaches PC10 under macOS (~81 % residency, powermetrics), so the blocker is elsewhere on the Linux side and is still unidentified. No change to this PR is needed. This is only so that nobody drops 0663 for the wrong reason. |
|
Short update: the PC3 limit reproduces on a stock Arch live USB, without any patch from this PR, so none of them (0663 included) cause the s2idle power draw on the 14,3. Nothing to change here. |
|
Built and booted on a second MacBookPro14,3 (Radeon Pro 555 on the panel, i7-7820HQ, BCM43602, T1). This covers "a built and booted Build. The PR head Results (two boots, 18 s2idle cycles: 17 RTC- or key-woken, plus one 3-minute lid close):
Not measured: fan speed during sleep, keyboard backlight during sleep (a test script of mine set it on after each wake, so I can't isolate T1 side: the Touch Bar stayed dark after every resume. That was not these patches: t1bridge's display driver parked the panel at suspend and never un-parked it. The fix is in standardagents/t1bridge#49. With it, the Touch Bar, Touch ID and the camera all came back after these sleeps. |
|
Thanks, @niconistal. This is the first build-and-boot of these patches as a real I'll update "Still open" with the rebase: item 1 is now done on your machine. Item 2 ( A side note, not part of this PR: on my 14,3, 5 GHz Wi-Fi also needed The PR conflicts with |
Wire two patches into the EEVDF, BORE and MuQSS recipes and bump pkgrel to 11, the same way master carries other hardware fixes (0680, 0805) in all three kernels. 0682 keeps the MacBookPro14,3 BCM43602 (14e4:43ba, subsystem 106b:0173) in D0 across suspend; it applies after 0680/0681, which touch the same brcmf_pcie_pm_enter_D3(). 0752 turns the applespi keyboard backlight off on suspend in its own drain and restores want_bl_level, so the level comes back on wake. Traced on MacBookPro14,3 over s2idle: the off packet goes out (want 0, have 0) and resume restores the level (254/254). Rebased onto 7.2.8-10: the old 0663 became 0682, since 0663/0664 now belong to btintel-pcie. Unsigned: this account does not hold 12D27D5D8C8E9BF1AABC7C7C7C64768D3DE334E7, so the new patches are listed without a .sig companion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a MacBookPro14,3 (Alpine Ridge JHL6540, native connection manager) the first s2idle after boot loses both Thunderbolt domains. tb_lc_set_sleep() sets the LC sleep bit on the host router, the router stops answering, and every tb_cfg access on resume fails with -ESHUTDOWN until reboot. Patch 0609 skips tb_lc_set_sleep() for the host router when the target is suspend-to-idle and the call is not runtime PM. S3, hibernation, runtime PM, device routers and USB4 keep the current path. Applies with --fuzz=0 after 0601-0608 (was 0664 before the 7.2.8 rebase). The same decision was tested on the stock 7.2.5-3 module through a kprobe: two s2idle cycles in one boot, no inaccessible ports, all Thunderbolt functions back at D0. The package itself is not runtime-tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
applesmc has no suspend callback. In s2idle the SMC still treats the machine as running and holds the fans at their minimum speed, about 2000 rpm on a MacBookPro14,3, for the whole sleep. Patch 0809 adds .suspend: when the target is s2idle and every fan is in automatic mode, save FS!, set manual mode and write a zero F%dTg target. .resume writes the saved FS! back. Fans the user put in manual mode, S3 and hibernation are unchanged. Applies with --fuzz=0 after 0805, whose includes it uses as context (was 0753 before the 7.2.8 rebase; 0750/0751 are gone from master). Tested as a module on 7.2.5-3: 90 s and 10 min s2idle with the fans at 0 rpm on wake and back in automatic mode within 10 s. Over 10 min the SMC maximum went from 67 to 68 C. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eff7069 to
1aac35a
Compare
|
Rebased onto
The patches now go into Built and booted on my MacBookPro14,3:
Not shown by this test:
This kernel does not carry the ACPICA fix from #544. One S3 cycle in the same boot logged 13 WARNs ( @niconistal's build-and-boot was on 7.2.5 ( |
[Medium impact] The changes affect device power behavior in the kernel suspend workflow. Fix fan recovery before merging so a failed SMC write cannot leave automatic cooling disabled after wake. Findings
SummaryAdds four suspend patches to all three
Acknowledgments excluded from findings:
Reviews (1) · Last reviewed commit: "linux-omarchy: stop MacBook fans in susp..." · Reviewed by Greptile |
| + if (fans_stopped) { | ||
| + applesmc_write_key(FANS_MANUAL, fans_manual_saved, 2); | ||
| + fans_stopped = false; |
There was a problem hiding this comment.
If the SMC write fails, applesmc_pm_resume() still clears fans_stopped. Suspend has already put every fan in manual mode with a zero target, so the computer wakes without automatic cooling. Later suspends skip recovery because the fans are already manual.
Check the restore result and provide a retry or recovery path instead of discarding the saved state. The same issue appears in the EEVDF and MuQSS copies.
|
S3 compatibility note from local MacBookPro14,3 tests on 2026-11-04. This is not a regression report against this PR's current The distinction is important because the historical number
I built a separate With the old local kprobe loaded, S3 still lost the occupied right-hand PCIe branch, even though the diagnostic capture reached The source-level interaction to keep in mind is that the new preparation runs before The left xHCI still reported Full setup, measured cycle durations, results and limitations: omacom/omarchy#11570 (comment). This note does not recommend disabling 0664 globally on an older stock kernel; it was blocked only in the separate v3 trial entry. |
|
Additional scoped MacBookPro14,3 / s2idle evidence from November 6: i7-7820HQ, Radeon Pro 560, BCM43602 I built a separate Targeted confirmation of the already documented T1 remote-wake workaround
In the real cycle, trace noirq resume was 509.362 ms, normal resume 318.591 ms, trace retention 945/945. The eight initialized selected PCI contexts stayed correctly addressed. WLAN reconnected afterward. Two The non-EC-GPE notification fingerprint matched firmware Additional host limitationThis unit also needed a separate EC-GPE07 CAN_WAKE marking: no LPS0 device was present, and the normal marking path was not taken. Without it, lid notification was not accepted as a wake before device resume. That issue is separate from these TB/WLAN patches and is being documented separately. The successful T1 policy is now installed locally with exact model/kernel/device guards. The current flag and service/udev wiring were independently checked, but automatic boot/pre-sleep execution has not yet been exercised since installation. Only one short real lid cycle with this exact successful combination is established; repeated/long sleep, battery retention, fan power, package C-states, S3, and attached Thunderbolt/USB-C-device behavior remain unvalidated here. Lock security was retained; no SOCW/FRST call, GPU-mux/fan change, or active userspace Touch Bar repair was used in this cycle. This adds independent confirmation of your existing T1 workaround and TB/WLAN stack, not a new fix or a request to merge untested parts. Prepared with AI assistance from local test records and the machine owner's visual/device confirmation. |
Status
Four MacBookPro14,3 suspend patches for
linux-omarchy,linux-omarchy-eevdfandlinux-omarchy-muqss:0682(Wi-Fi),0609(Thunderbolt),0752(keyboard backlight) and0809(fans). Until 2026-10-22 they were numbered0663,0664,0752and0753; older comments use those names. Built and booted as a 7.2.8-11 package on two MacBookPro14,3 (details below). Not signed.These four patches do not make this machine's s2idle complete. It also needs the ACPICA fix from omarchy-pkgs#544 for resume time, and one udev rule against spurious wakes. Package C-states stay at PC3. The full list, how the fixes depend on each other, and the limits found are below.
Target:
masterat172df0f8(pkgver=7.2.8,pkgrel=10).pkgrelgoes to 11 in all three flavors.linux-omarchy-boreis transitional and is not touched.Patches
All four apply with
patch -Np1 --fuzz=0in recipe order on all three flavors.0682-brcmfmac-bcm43602-keep-d0-on-suspend.patch(was0663), after0680/0681: on the successful return ofbrcmf_pcie_pm_enter_D3(), and only for PCI14e4:43basubsystem106b:0173, callpci_save_state(). The PCI core then skipspci_prepare_to_sleep()and the chip stays in D0.0609-thunderbolt-keep-tb3-host-router-awake-in-s2idle.patch(was0664): intb_switch_suspend(), skiptb_lc_set_sleep()for the host router whenpm_suspend_target_state == PM_SUSPEND_TO_IDLEand the call is not runtime PM. S3, hibernation, runtime PM, device routers and USB4 routers are unchanged.0752-applespi-backlight-off-on-suspend.patch: after the stock drain inapplespi_suspend(), send a backlight-off packet in its own drain, then restorewant_bl_level. Resume clearshave_bl_level, so the next command restores the user's level. (The first version setwant_bl_levelto 0, so the backlight stayed off after wake. The rebased commit carries only the fixed version.)0809-applesmc-stop-fans-in-s2idle.patch(was0753):applesmchas no suspend callback, so in s2idle the SMC keeps the fans at their minimum. The new.suspend, only when the target is s2idle and every fan is in automatic mode, savesFS!, sets manual mode and writes a zeroF%dTgtarget..resumewrites the savedFS!back. Applies after0805, whose includes it uses as context.All corrections on this machine
Machine: MacBookPro14,3, i7-7820HQ, Radeon Pro 560, BCM43602, Alpine Ridge JHL6540, T1. Kernel
7.2.5-3-omarchy, s2idle (SuspendState=freeze). The table covers everything needed for suspend on this machine, including the parts that are not in this PR.MMIO read failed, probe-19)0682-108)060907710771.0752(v2)0809power/wakeup=disabledon the T1 (05ac:8600)snd_hda_macbookproDKMSOn 2026-10-22, items 1, 2, 4 and 5 were rechecked with a built 7.2.8-11 package (see "Packaged build on 7.2.8").
Dependencies between the fixes
0809must apply after0805(same#includeblock inapplesmc.c).0609comes before linux-omarchy: carry ACPICA PCI bus fix for resume delays #544's ACPICA fix. Without0609, Thunderbolt is already dead after the first sleep, so resume time cannot be measured. With0609but without0771, the bridges stay alive, but the firmware spends 12 s per controller polling the host bridge (see linux-omarchy: carry ACPICA PCI bus fix for resume delays #544). Every0771measurement here was taken with0609active.0682does not depend on the others. The first-sleep rule for Thunderbolt does not apply to it, so Wi-Fi results from later sleeps in a boot are valid.0809only matters when sleeps last. Before the T1 udev rule, sleeps ended after 12, 66 and 141 s. With the fans stopped, heat comes only from the platform power in s2idle (item 7). Over 10 minutes the SMC maximum went from 67 to 68 C.0752makes a userspace hook on this machine (93-macbook-keyboard-light.conf) unnecessary. The first0752needed that hook to get the light back; v2 does not. The hook is still installed here.What was tested
0663brcmfmac.kobuilt from v7.2.5 plus0663, srcversionEEBD9EFB668A9ECC8B87A08, loaded fromupdates/state saved, noMMIO read failed, no probe-19, andwlp3s0up with HTTPS 200 after each. On 2026-09-24, 31 more s2idle cycles with the module had noMMIO read failed. Negative control, 2026-09-24 18:54: the stock module (4C9A066E261416C75B70BB5) in a 180 s s2idle. On resume,Unable to change power state from D3cold to D0,probe after resume failed, err=-19. Wi-Fi only came back after a reboot.0664thunderbolt.ko(srcversion818021460DA57E63C550EC2) plus a kprobe module that makestb_lc_set_sleep()return 0 in system sleep-108, and that includes the first sleep of each boot. Both host-router calls were skipped every time. No port inaccessible at suspend, no-108, domains0-0and1-0present after resume.0752applespi.kowith the corrected patch, srcversion045678FA169D186975E1FD4/sys/power/state, which skips the systemd-sleep hooks, so the result comes from the patch alone.0753applesmc.kobuilt from v7.2.5 plus0750,0751(reproduces the stock srcversion7323FE80015BE341E848CA7) and the same0753logics2idle_fan_rpmparameter (default 0, same behavior as this patch); it is not in this PR.Final checkup, 2026-09-24 20:27–20:31. Boot
715b2a76, battery, factory GPU mode, twosystemctl suspendcycles with an RTC alarm, all local fixes active:Timekeeping suspended for 117.029 seconds) and woke on the RTC (ACPI fixed event wakeup).0-0 1-0present,04:00.0noirq resume 0.45 s. Total noirq resume was 0.530 s in cycle 2; it was not logged for cycle 1.0752). Fans automatic at about 2160/2000 rpm after wake. Touch Bar bound and its service active. T1 wakeup still disabled. Microphone capture after resume: rms 242, peak 2267, no clipping.Packaged build on 7.2.8
2026-10-22, my MacBookPro14,3.
linux-omarchy7.2.8-11 from this branch plus #815,pkgbaserenamed to install beside stock. No #544, no out-of-tree modules (no Touch Bar, no audio).tainted=0, no WARN/BUG/Oops.0609loggedsuspend-to-idle, not setting LC sleepon both host routers; no-108;0809loggedfans stopped for suspend-to-idle; fans spinning after wake;0752: backlight level 50 before and after;brcmferrors;tb_cfg_read/tb_cfg_write) and a pciehp re-probe of the Wi-Fi. linux-omarchy: carry ACPICA PCI bus fix for resume delays #544 is not in this kernel. I expect this is the bus-0 problem it addresses, but that is not confirmed on 7.2.8.0609does nothing in S3.0682holding D0 during sleep, the backlight being off during sleep, fan rpm during sleep.@niconistal's build-and-boot (comment above) was on 7.2.5 (
eff7069+0771) and has not been repeated on 7.2.8.Limitations found
Package C6. PC6–PC10 stay at 0 in every test, awake and in s2idle; only PC3 advances. Each of the following was ruled out; the first six were also combined in one test:
vga_switcheroo, and separately at low DPM;LTR_IGNOREset for every PCH LTR agent;intel_iommu=igfx_off;acpi_osi=Darwin(already set by DMI on Apple hardware);What remains is the CPU power configuration left by Apple's firmware. Platform power in s2idle is about 7–13 W, and package RAPL about 1.5–2.1 W. The battery gauge (
sbs) is too coarse for short windows, so these figures are rough.S3. The Radeon SMU fails S3 resume with
-22, independent of these patches. Only s2idle was tested.First sleep only. One Thunderbolt failure breaks every later sleep in the same boot. A result from a second sleep after a failure says nothing.
Hooks versus direct writes. Writing
freezeto/sys/power/statewoke within 0.1 s on an ACPI GPE several times;systemctl suspenddid not. The journal is buffered during s2idle, so useTimekeeping suspended forandpm_print_timesfor timing.GPU mux. With
gpu-power-prefs=1(Intel on the panel), external displays work only when plugged in after login, and they need Multi-GPU: Secondary AMD GPU output fails with "destination dmabuf unsupported" (external-only) when primary GPU is different AMD card hyprwm/aquamarine#220 fixed. Booting with a monitor connected makes the firmware start on the Radeon with the panel dark. From Linux,vga_switcherooIGD powers off the Radeon, and i915 still cannot probe the panel. After that attempt, the next two boots came up with dark screens until an NVRAM reset. This machine went back to factory mode, with the Radeon driving everything. None of this is part of this PR.Not verified. No Thunderbolt or USB-C device was attached during sleep. No other native-CM TB3 Mac was tested, and no long lid-closed sleep was checked with
0753. The0771results come from a local kretprobe module, not from the patch in linux-omarchy: carry ACPICA PCI bus fix for resume delays #544 built into a kernel.What was not tested
-eevdfand-muqssflavors at runtime (they get the same patches; onlylinux-omarchywas built and booted).0664with a Thunderbolt or USB-C device attached, wake-on-plug in s2idle, or other models.Related work
nhi_suspend_noirq → tb_switch_suspend → tb_lc_set_sleepputs the Alpine Ridge router into LC sleep and the whole chip readsffffffff. omarchy-pkgs#349 and omarchy#10758 restore the lost config with a shim.0664takes the other route for s2idle and does not set the bit. The 14,3 upstream bridges are the same8086:1578.0771) fixes the resume time that remains with0664. On this 14,3 theUPSBandDSB0PCI_Config regions (H530,A1E0–A1E2) are set up during the first resume, while the bridges read Primary Bus 0. They get cached at00:00.0, andUPSB._PS0then polls the host bridge 300,240 times. If linux-omarchy: carry ACPICA PCI bus fix for resume delays #544 lands first, thepkgrelbump here will need a rebase.Signatures
Existing patches are signed by
12D27D5D8C8E9BF1AABC7C7C7C64768D3DE334E7. This account does not hold that key. The four new files are listed insource=()without a.sigcompanion, with b2 and sha256 entries. Add signatures before any release if that remains required.Still open
A built and bootedDone on 7.2.5 by @niconistal (withlinux-omarchypackage with these patches and0771.0771), and on 7.2.8 by me (without linux-omarchy: carry ACPICA PCI bus fix for resume delays #544).0609with Thunderbolt or USB-C devices attached.🤖 Generated with Claude Code