Skip to content

linux-omarchy: MacBookPro14,3 backlight, BCM43602 D0, Thunderbolt and fan s2idle fixes - #596

Open
angellindo wants to merge 3 commits into
omacom:masterfrom
angellindo:mbp143-untested-suspend-driver-patches
Open

angellindo wants to merge 3 commits into
omacom:masterfrom
angellindo:mbp143-untested-suspend-driver-patches

Conversation

@angellindo

@angellindo angellindo commented Sep 22, 2026 •

Copy link
Copy Markdown

Status

Four MacBookPro14,3 suspend patches for linux-omarchy, linux-omarchy-eevdf and linux-omarchy-muqss: 0682 (Wi-Fi), 0609 (Thunderbolt), 0752 (keyboard backlight) and 0809 (fans). Until 2026-10-22 they were numbered 0663, 0664, 0752 and 0753; 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: master at 172df0f8 (pkgver=7.2.8, pkgrel=10). pkgrel goes to 11 in all three flavors. linux-omarchy-bore is transitional and is not touched.

Patches

All four apply with patch -Np1 --fuzz=0 in recipe order on all three flavors.

  • 0682-brcmfmac-bcm43602-keep-d0-on-suspend.patch (was 0663), after 0680/0681: on the successful return of brcmf_pcie_pm_enter_D3(), and only for PCI 14e4:43ba subsystem 106b:0173, call pci_save_state(). The PCI core then skips pci_prepare_to_sleep() and the chip stays in D0.
  • 0609-thunderbolt-keep-tb3-host-router-awake-in-s2idle.patch (was 0664): in tb_switch_suspend(), skip tb_lc_set_sleep() for the host router when pm_suspend_target_state == PM_SUSPEND_TO_IDLE and 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 in applespi_suspend(), send a backlight-off packet in its own drain, then restore want_bl_level. Resume clears have_bl_level, so the next command restores the user's level. (The first version set want_bl_level to 0, so the backlight stayed off after wake. The rebased commit carries only the fixed version.)
  • 0809-applesmc-stop-fans-in-s2idle.patch (was 0753): applesmc has 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, saves FS!, sets manual mode and writes a zero F%dTg target. .resume writes the saved FS! back. Applies after 0805, 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.

# Problem Fix Where State on 2026-09-24
1 Wi-Fi gone after s2idle (MMIO read failed, probe -19) 0682 this PR Works as a local module. The stock module was retested in D3: Wi-Fi does not come back, even after reloading the module.
2 Both Thunderbolt domains lost on the first s2idle after every boot (-108) 0609 this PR Works, tested as a kprobe that skips the same call.
3 About 17.8 s of noirq resume once Thunderbolt survives ACPICA 0771 #544 0.53 s with a local kretprobe equivalent of 0771.
4 Keyboard backlight on during sleep 0752 (v2) this PR Works as a local module.
5 Fans at minimum rpm during sleep 0809 this PR Works as a local module.
6 Spurious wakes 12–141 s after sleeping power/wakeup=disabled on the T1 (05ac:8600) udev rule, not in this PR 4 of 4 five-minute sleeps ran to the RTC alarm.
7 Package C6 never reached (PC3 only) none found none Not fixed; see limitations.
8 Speakers and internal microphone (CS8409) snd_hda_macbookpro DKMS out of tree, not in this PR Playback confirmed by the user; microphone captures clean signal after resume.

On 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

  • 0809 must apply after 0805 (same #include block in applesmc.c).
  • 0609 comes before linux-omarchy: carry ACPICA PCI bus fix for resume delays #544's ACPICA fix. Without 0609, Thunderbolt is already dead after the first sleep, so resume time cannot be measured. With 0609 but without 0771, 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). Every 0771 measurement here was taken with 0609 active.
  • 0682 does 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.
  • 0809 only 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.
  • 0752 makes a userspace hook on this machine (93-macbook-keyboard-light.conf) unnecessary. The first 0752 needed that hook to get the light back; v2 does not. The hook is still installed here.

What was tested

Patch Artifact Result
0663 brcmfmac.ko built from v7.2.5 plus 0663, srcversion EEBD9EFB668A9ECC8B87A08, loaded from updates/ Four checked s2idle cycles on 2026-09-22 and 09-23 with no state saved, no MMIO read failed, no probe -19, and wlp3s0 up with HTTPS 200 after each. On 2026-09-24, 31 more s2idle cycles with the module had no MMIO 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.
0664 Stock thunderbolt.ko (srcversion 818021460DA57E63C550EC2) plus a kprobe module that makes tb_lc_set_sleep() return 0 in system sleep Six s2idle cycles in one boot on 2026-09-23. On 2026-09-24, none of 32 sleeps across 10 boots logged a Thunderbolt -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, domains 0-0 and 1-0 present after resume.
0752 applespi.ko with the corrected patch, srcversion 045678FA169D186975E1FD4 A kprobe trace shows the off packet sent and completed during suspend (0/0) and the level restored after resume (254/254). That cycle went through /sys/power/state, which skips the systemd-sleep hooks, so the result comes from the patch alone.
0753 applesmc.ko built from v7.2.5 plus 0750, 0751 (reproduces the stock srcversion 7323FE80015BE341E848CA7) and the same 0753 logic Awake, manual mode with target 0 stops both fans in about 4 s. Across s2idle: 90 s and 10 min sleeps, fans at 0 rpm on wake and back to about 2000 rpm within 10 s. The local module also has an s2idle_fan_rpm parameter (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, two systemctl suspend cycles with an RTC alarm, all local fixes active:

  • Cycle 1, the first sleep of the boot, woke after about 40 s on the ACPI SCI; the GPE was not captured. Cycle 2 slept 117 s (Timekeeping suspended for 117.029 seconds) and woke on the RTC (ACPI fixed event wakeup).
  • In both: Thunderbolt calls skipped (counts 2 and 4), domains 0-0 1-0 present, 04:00.0 noirq resume 0.45 s. Total noirq resume was 0.530 s in cycle 2; it was not logged for cycle 1.
  • Wi-Fi in D0, HTTPS 200. Keyboard light 255 before and after (the userspace hook is still installed here, so this does not isolate 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-omarchy 7.2.8-11 from this branch plus #815, pkgbase renamed to install beside stock. No #544, no out-of-tree modules (no Touch Bar, no audio).

  • Boot: tainted=0, no WARN/BUG/Oops.
  • First s2idle after boot, 60 s RTC wake:
    • 0609 logged suspend-to-idle, not setting LC sleep on both host routers; no -108;
    • 0809 logged fans stopped for suspend-to-idle; fans spinning after wake;
    • 0752: backlight level 50 before and after;
    • Wi-Fi reconnected 1 s after wake, no brcmf errors;
    • 0 WARN.
  • S3 in the same kernel: 13 WARNs (mostly 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. 0609 does nothing in S3.
  • Not observable here: 0682 holding 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:

    • display off (DPMS);
    • Radeon powered off through vga_switcheroo, and separately at low DPM;
    • Thunderbolt removed and its root ports in D3hot;
    • T1 port powered off;
    • all radios blocked;
    • LTR_IGNORE set for every PCH LTR agent;
    • NVMe APST (active, PS2 at 0.005 W);
    • intel_iommu=igfx_off;
    • acpi_osi=Darwin (already set by DMI on Apple hardware);
    • Wi-Fi in D3 with the stock driver.

    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 freeze to /sys/power/state woke within 0.1 s on an ACPI GPE several times; systemctl suspend did not. The journal is buffered during s2idle, so use Timekeeping suspended for and pm_print_times for 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_switcheroo IGD 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. The 0771 results 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

  • A 7.2.8 package with these patches and linux-omarchy: carry ACPICA PCI bus fix for resume delays #544 together.
  • The -eevdf and -muqss flavors at runtime (they get the same patches; only linux-omarchy was built and booted).
  • 0664 with a Thunderbolt or USB-C device attached, wake-on-plug in s2idle, or other models.
  • These patches together with the omarchy#11570 systemd-sleep hooks.

Related work

  • @orospakr identified the Thunderbolt mechanism on a MacBookPro14,1 in omarchy#9899 (comment): nhi_suspend_noirq → tb_switch_suspend → tb_lc_set_sleep puts the Alpine Ridge router into LC sleep and the whole chip reads ffffffff. omarchy-pkgs#349 and omarchy#10758 restore the lost config with a shim. 0664 takes the other route for s2idle and does not set the bit. The 14,3 upstream bridges are the same 8086:1578.
  • omarchy-pkgs#544 (ACPICA 0771) fixes the resume time that remains with 0664. On this 14,3 the UPSB and DSB0 PCI_Config regions (H530, A1E0–A1E2) are set up during the first resume, while the bridges read Primary Bus 0. They get cached at 00:00.0, and UPSB._PS0 then polls the host bridge 300,240 times. If linux-omarchy: carry ACPICA PCI bus fix for resume delays #544 lands first, the pkgrel bump 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 in source=() without a .sig companion, with b2 and sha256 entries. Add signatures before any release if that remains required.

Still open

  1. A built and booted linux-omarchy package with these patches and 0771. Done on 7.2.5 by @niconistal (with 0771), and on 7.2.8 by me (without linux-omarchy: carry ACPICA PCI bus fix for resume delays #544).
  2. 0609 with Thunderbolt or USB-C devices attached.
  3. Package PC6, not claimed.
  4. Fan speed and keyboard backlight during sleep in a packaged build. So far only the log lines and the state after wake have been checked.
  5. 7.2.8 with these patches and linux-omarchy: carry ACPICA PCI bus fix for resume delays #544 together, including S3.

🤖 Generated with Claude Code

@angellindo angellindo changed the title linux-omarchy: untested MacBookPro14,3 Wi-Fi D0 and keyboard-backlight patches linux-omarchy: MacBookPro14,3 backlight suspend call and BCM43602 D0 quirk Sep 22, 2026
@angellindo angellindo changed the title linux-omarchy: MacBookPro14,3 backlight suspend call and BCM43602 D0 quirk linux-omarchy: MacBookPro14,3 backlight, BCM43602 D0 and Thunderbolt s2idle fixes Sep 23, 2026
@angellindo angellindo changed the title linux-omarchy: MacBookPro14,3 backlight, BCM43602 D0 and Thunderbolt s2idle fixes linux-omarchy: MacBookPro14,3 backlight, BCM43602 D0, Thunderbolt and fan s2idle fixes Sep 23, 2026
@angellindo

Copy link
Copy Markdown
Author

Updated the description after a final checkup on 2026-09-24. The patches are unchanged, and master still has pkgrel=6, so no rebase was needed.

New since the last update:

  • The description now lists every suspend fix this 14,3 needs, including the two that are not in this PR: the ACPICA fix from linux-omarchy: carry ACPICA PCI bus fix for resume delays #544 and a udev rule that stops the T1 from waking the machine. It also covers how the fixes depend on each other and the limits found.
  • 0663 has a negative control. With the stock brcmfmac in D3, Wi-Fi does not come back from s2idle. With 0663, 31 sleeps that day had no failure.
  • With the 0771 logic from linux-omarchy: carry ACPICA PCI bus fix for resume delays #544 (emulated as a local module), noirq resume went from 17.8 s to 0.53 s, including the first sleep after boot.
  • PC6 remains unreachable after every OS-side cause was ruled out, including Wi-Fi in D3.

@angellindo

Copy link
Copy Markdown
Author

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 LTR_IGNORE=0x1fbdf written to the PMC during a 5-minute s2idle (measured with turbostat and MSR counters before and after: PC3 98.5 %, PC6 = 0). Without 0663 the Wi-Fi doesn't come back from D3 (err=-19), and PC6 is still 0.

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.

@angellindo

Copy link
Copy Markdown
Author

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.

turbostat -i 10 -n 6, idle, console blanked, Arch 7.2.2-arch1-1 (no patches):
Pkg%pc3 98.7-99.0  Pkg%pc6..pc10 0.00  PkgWatt 3.53

@niconistal

niconistal commented Oct 9, 2026 •

Copy link
Copy Markdown

Built and booted on a second MacBookPro14,3 (Radeon Pro 555 on the panel, i7-7820HQ, BCM43602, T1). This covers "a built and booted linux-omarchy package with these patches and 0771" from Still open.

Build. The PR head eff7069 (7.2.5, pkgrel=7), with #544's 0771 applied on top. All patches applied with --fuzz=0. The only other change was renaming pkgbase to linux-omarchy-s2idle, so it installs beside the stock kernel. Kernel arguments: mem_sleep_default=s2idle button.lid_init_state=open intel_iommu=off. The T1 (05ac:8600) and the Alpine Ridge NHI/xHCI have power/wakeup disabled.

Results (two boots, 18 s2idle cycles: 17 RTC- or key-woken, plus one 3-minute lid close):

  • 18 of 18 resumed.
  • noirq resume took 491–495 ms on every logged cycle. On the stock 7.2.5-3-omarchy kernel, xHCI 07:00.0 and 7d:00.0 reported not ready 65535ms after resume.
  • Thunderbolt: no -108 and no 65535ms warnings. Domains 0-0 and 1-0 were present after every resume I checked.
  • Wi-Fi: no MMIO read failed and no probe after resume failed. wlp3s0 was up and pinging after every resume I checked. On the stock kernel the same machine lost Wi-Fi with err=-19.
  • Wake sources: 14 ACPI fixed event wakeup (RTC) and 3 ACPI non-EC GPE wakeup. One of the GPE wakes was a key press. Another ended a 300 s sleep after 134 s with no input; I didn't capture the GPE.
  • The lid close went to sleep about 1 s after Lid closed., and the kernel was back 0.5 s after Lid opened.

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 0752), and package C-states.

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.

@angellindo

Copy link
Copy Markdown
Author

Thanks, @niconistal. This is the first build-and-boot of these patches as a real linux-omarchy package, and it covers item 1 of "Still open". Before this, every result here came from local modules or kprobes on the stock kernel. Your numbers match what I saw on my 14,3: noirq resume at 0.53 s (down from 17.8 s) with a local equivalent of 0771, no -108 with Thunderbolt domains 0-0 and 1-0 back, and no err=-19 from the Wi-Fi with 0663.

I'll update "Still open" with the rebase: item 1 is now done on your machine. Item 2 (0664 with a Thunderbolt or USB-C device attached) is still untested, as is item 3 (package PC6). Fan and keyboard-backlight behavior during sleep in a packaged build are also still unconfirmed, since you couldn't isolate those.

A side note, not part of this PR: on my 14,3, 5 GHz Wi-Fi also needed maxp5ga in NVRAM (details). If you only saw 2.4 GHz, that may be why.

The PR conflicts with master now that it's on 7.2.8, and patch numbers 0663 and 0664 are taken there. I'll rebase and renumber. Your build was on 7.2.5, so I'll say that in the description.

angellindo and others added 3 commits October 22, 2026 14:10
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>
@angellindo
angellindo force-pushed the mbp143-untested-suspend-driver-patches branch from eff7069 to 1aac35a Compare October 22, 2026 19:10
@angellindo

Copy link
Copy Markdown
Author

Rebased onto master (7.2.8-10) and renumbered, since 0663 and 0664 are taken there.

Now Was
0609-thunderbolt-keep-tb3-host-router-awake-in-s2idle 0664 unchanged logic
0682-brcmfmac-bcm43602-keep-d0-on-suspend 0663 after 0680/0681
0752-applespi-backlight-off-on-suspend 0752 v2 folded into one commit
0809-applesmc-stop-fans-in-s2idle 0753 include hunk refreshed for 0805; 0750/0751 are gone

The patches now go into linux-omarchy, linux-omarchy-eevdf and linux-omarchy-muqss, like 0680 and 0805, with pkgrel 11 in all three. linux-omarchy-bore is transitional, so it is untouched. All patches apply with --fuzz=0 in all three.

Built and booted on my MacBookPro14,3: linux-omarchy 7.2.8-11 with these patches and #815 (pkgbase renamed so it installs next to stock).

  • Boot: tainted=0, no WARN.
  • First s2idle after boot (rtcwake -m freeze -s 60):
    • 0609: suspend-to-idle, not setting LC sleep on both host routers (06:00.0, 7c:00.0), no -108;
    • 0809: fans stopped for suspend-to-idle, fans spinning again after wake;
    • 0752: backlight level restored (50 before and after);
    • Wi-Fi back in 1 s, no brcmf errors;
    • 0 WARN.

Not shown by this test:

  • 0682 keeping D0 during sleep. Sysfs can't show it. I only see the result: Wi-Fi comes back.
  • Backlight off and fans at 0 rpm during sleep. I only have the log line and the state after wake.
  • Thunderbolt or USB-C devices attached.

This kernel does not carry the ACPICA fix from #544. One S3 cycle in the same boot logged 13 WARNs (tb_cfg_read/tb_cfg_write, and one pci_disable_device from pciehp). pciehp then removed and re-probed the Wi-Fi (wlan0 → wlp3s0). It reconnected 6 s after wake. S3 does not run the 0609 path, so I don't count it as a regression from these patches. I haven't retested S3 with #544 on 7.2.8.

@niconistal's build-and-boot was on 7.2.5 (eff7069 + 0771). I've updated the description to say so.

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/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

  1. P1 Fans stay stopped after wake ▶

Summary

Adds four suspend patches to all three linux-omarchy variants and raises pkgrel to 11.

  • The MacBookPro14,3 Wi-Fi card stays powered through suspend.
  • The Thunderbolt 3 host router stays awake during suspend-to-idle.
  • The Apple keyboard backlight turns off while the laptop sleeps.
  • Apple fans stop during suspend-to-idle, then return to their saved mode.

Acknowledgments excluded from findings:

  • angellindo acknowledges the missing patch signatures and says to add them before release if required.
  • angellindo acknowledges that the complete package has not been built or booted.
  • angellindo acknowledges missing attached-device, other-model, and long lid-closed sleep tests.

Reviews (1) · Last reviewed commit: "linux-omarchy: stop MacBook fans in susp..." · Reviewed by Greptile

Comment on lines +61 to +63
+ if (fans_stopped) {
+ applesmc_write_key(FANS_MANUAL, fans_manual_saved, 2);
+ fans_stopped = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Fans stay stopped after wake

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.

@angellindo

Copy link
Copy Markdown
Author

S3 compatibility note from local MacBookPro14,3 tests on 2026-11-04. This is not a regression report against this PR's current 0609, and it does not close the outstanding s2idle-with-attached-devices test item.

The distinction is important because the historical number 0664 is used for two different artifacts:

  • This PR's current 0609-thunderbolt-keep-tb3-host-router-awake-in-s2idle.patch skips LC sleep only for the host router in s2idle. It leaves S3 unchanged.
  • My older out-of-tree tb_skip_lc_sleep2/0664 kprobe skips tb_lc_set_sleep() during system sleep including S3, not just s2idle.

I built a separate 7.2.8-9.1-omarchy-t106v3 kernel based on Omarchy 7.2.8-9 with a backport of SXFP v3, its PCI prerequisites and a local NHI-layer adjustment; the local ACPICA 0771 equivalent remained enabled. This is not this PR's exact packaged artifact or an unmodified upstream v3.

With the old local kprobe loaded, S3 still lost the occupied right-hand PCIe branch, even though the diagnostic capture reached ACPI: calling SXFP on both NHIs before S3. Blocking that module for the trial boot, with the same UKI and other local modules, gave four successful S3 recoveries across two cold boots, each starting with healthy links. Both upstream links returned at 8 GT/s x4, both NHIs/xHCIs remained present, and receiver input worked after every resume. Kingston USB3-attached S3 was checked on each side, at SuperSpeed, with matching SHA-256 from direct read-only 64 MiB reads before/after; no mounts, LUKS unlock or writes.

The source-level interaction to keep in mind is that the new preparation runs before tb_switch_suspend(), whose normal path still calls tb_lc_set_sleep(). The broad old kprobe changes that later step. This supports investigating the combination, not an electrical-causality claim or a reason to remove the current s2idle-only guard from this PR.

The left xHCI still reported USBSTS 0x401, Reinit in three successful cycles; that remains an observation, not a completely clean-journal claim. No real Thunderbolt device or new s2idle tests were done here, and these results do not validate the other patches/flavors in #596.

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.

@patattzel

Copy link
Copy Markdown

Additional scoped MacBookPro14,3 / s2idle evidence from November 6: i7-7820HQ, Radeon Pro 560, BCM43602 14e4:43ba / 106b:0173, two Alpine Ridge domains, T1 05ac:8600.

I built a separate 7.2.15-2-macbook143 kernel from the existing Omarchy recipe plus this PR's 0609 Thunderbolt and 0682 BCM43602 corrections at head 1aac35af814bc9b3e0fa7669cdb9e42ebf277795, and #544's ACPICA correction. The 0752 keyboard-backlight and 0809 fan patches were not added. T1Bridge 0.1.12 DKMS included standardagents/t1bridge#49. This is not validation of this PR's full package/flavor matrix or its fan/backlight code.

Targeted confirmation of the already documented T1 remote-wake workaround

  1. With T1 power/wakeup=enabled, an attended lid attempt returned immediately on a non-EC GPE while the lid was still closed. Independent BOOTTIME-minus-MONOTONIC measurement showed effectively zero actual sleep. A successful transition counter and a quick visible return were not sufficient to call it a successful sleep.
  2. In a separately approved platform negative control, only the identified T1 device's normal power/wakeup policy was temporarily disabled. The early IRQ9 trigger disappeared; GPE6D stayed unchanged and the artificial five-second pause actually ran (5.127 s). This was a platform diagnostic, not real sleep.
  3. A subsequent attended real lid-close/open cycle with T1 remote wake disabled slept 26.563 s independently measured, also confirmed by the kernel timekeeping message. EC/LID wake was accepted before device resume, well before the fallback RTC alarm. The owner reported automatic visible return in approximately one second, then normal keyboard/trackpad/Touch Bar function.

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 brcmf_inetaddr_changed: fail to get arp ip table err:-52 messages occurred around the test, so this is not an entirely clean-log claim. Earlier successful checks retained both Thunderbolt domains; no attached-device coverage is claimed.

The non-EC-GPE notification fingerprint matched firmware _L6D notifying PWRB/XHC1/HDEF, followed by a T1 wake notification. The targeted negative control supports T1 remote wake as the cause, but the first failed attempt did not directly capture the pending non-EC GPE number. This is not a complete A/B/A series or proof of firmware internals. IRQ9 itself is not wrong: the later correct EC/LID wake also uses it.

Additional host limitation

This 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants