Skip to content

Sleep in s2idle on the MacBookPro14,3 - #14692

Draft
niconistal wants to merge 1 commit into
omacom:quattrofrom
niconistal:t1-15in-s2idle
Draft

niconistal wants to merge 1 commit into
omacom:quattrofrom
niconistal:t1-15in-s2idle

Conversation

@niconistal

@niconistal niconistal commented Oct 9, 2026 •

Copy link
Copy Markdown

Depends on omacom/omarchy-pkgs#596 and #544. Keep this in draft until both are in linux-omarchy. On the current kernel, s2idle on this machine stalls about 65 s on resume and then loses Wi-Fi and Thunderbolt, so merging this first would trade one broken sleep for another.

Problem

On a MacBookPro14,3 (15-inch 2017, Radeon Pro 555 driving the internal panel), every lid close since install ended in a forced power-off. S3 resume fails inside amdgpu: SMU load firmware failed → amdgpu_device_ip_resume failed (-22). The panel stays black. #596 reports the same -22 on another 14,3. Dunedan/mbp-2016-linux notes that the 15-inch models resume only on the Intel GPU.

Change

For MacBookPro14,3 only:

  • Limine drop-in: mem_sleep_default=s2idle button.lid_init_state=open.
  • udev: the T1 (05ac:8600) gets power/wakeup=disabled. QT scaling #596 found it waking the machine 12–141 s into s2idle. The lid (LID0) and the keyboard (SPIT) still wake it.
  • Migration: applies the leaf on existing installs and rebuilds the UKI only when the booted command line lacks the parameters, following Fix lid-close suspend on the MacBookPro14,1 #14409.

MacBookPro13,3 has the same Radeon-on-panel design but is untested, so it stays out of the match. Widen it after the same suspend test.

How this fits with the other T1 sleep PRs

Testing

On the MacBookPro14,3, with Omarchy 4.0.4, linux-omarchy 7.2.5 rebuilt with #596 + #544, this command line and the T1 rule:

🤖 Generated with Claude Code

S3 cannot resume the Radeon that drives the 15-inch panel. Select s2idle and
keep the T1 from waking the machine. Depends on the linux-omarchy s2idle
fixes in omarchy-pkgs omacom#596 and omacom#544.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@patattzel

Copy link
Copy Markdown

Additional MacBookPro14,3 evidence, including a possible missing lid-wake prerequisite on another firmware/kernel setup. This is not a test of this PR's installer or migration.

Hardware: 2017 15-inch, i7-7820HQ, Radeon Pro 560, BCM43602, two Alpine Ridge domains, T1. S3 previously failed with Radeon SMU errors, so the working local path uses s2idle. With built host fixes equivalent to omacom/omarchy-pkgs#596 (0609 + 0682 only), omacom/omarchy-pkgs#544 and standardagents/t1bridge#49, plus T1 remote wake disabled, an attended lid cycle slept 26.563 s and visibly returned automatically in approximately one second. Long sleep and battery behavior remain unvalidated.

However, this unit also needed a separate EC wake-capability correction:

  • Firmware ECDT identifies the EC GPE as 07. Lid _PRW identifies 6F; EC _Q20 reads the lid state and notifies LID0.
  • No PNP0D80/LPS0 device was present. The usual lps0_device_attach() path calling acpi_ec_mark_gpe_for_wake() was absent.
  • Read-only, running-BTF-validated metadata inspection found GPE07 flags 0x44, CAN_WAKE false; GPE6F was 0x59, CAN_WAKE true.
  • In the tested source, acpi_set_gpe_wake_mask() returns AE_TYPE without CAN_WAKE, while the EC wrapper does not propagate that failure. Normal runtime GPE operation therefore did not establish a usable s2idle EC wake mask.
  • A temporary exact-model/kernel/ECDT/no-LPS0 guarded helper, serialized against suspend, called only the existing acpi_ec_mark_gpe_for_wake() function. It changed GPE07 0x44 -> 0x54 and left the reported GPE6F state unchanged. No firmware-method evaluation or EC-register write was used.
  • After that change, the trace showed acpi_ec_dispatch_gpe -> acpi_lid_notify -> acpi_pm_wakeup_event, with LID wake accepted before dpm_resume_noirq. Before marking, an earlier complete RTC-woken trace had no EC dispatch before resume; the lid notification was processed only afterward.

The subsequent slow device resume was a separate ACPICA problem; the premature closed-lid return was a separate T1-remote-wake problem. They should not be conflated with the missing EC marking.

This is an additional prerequisite observed on 7.2.15-2-omarchy and the local corrected test kernel, not a claim that your tested setup has the same firmware state. I have not reproduced it on a current clean vanilla mainline kernel, and I am not proposing that an exact-release DKMS helper be shipped as the upstream fix. A separate Linux-ACPI report is being prepared to ask whether the correct solution belongs in generic no-LPS0 EC handling or a narrowly scoped quirk.

I am posting this here because it may matter when assessing whether the s2idle + T1 policy is sufficient across 14,3 units. Your existing dependency warnings should remain; this result does not establish universal lid wake or low sleep power. The locally installed persistent T1 policy has not yet been retested through its automatic boot/pre-sleep path.

Prepared with AI assistance from existing local firmware/source inspection, read-only metadata checks, traces and owner-confirmed visual results. No raw memory, private device identifiers, or firmware dumps are attached.

@makoni

makoni commented Nov 10, 2026

Copy link
Copy Markdown

@patattzel, thanks. The missing lid wake reproduces on my 14,3 with stock linux-omarchy 7.2.15-1 and firmware 529.140.2.0.0, without your EC correction and without omacom/omarchy-pkgs#596 or omacom/omarchy-pkgs#544. As on yours, the firmware has an ECDT and there is no PNP0D80 device.

In one lid-closed s2idle cycle with pm_debug_messages on and the T1's USB remote wake disabled, I opened the lid after about a minute and a half, and the machine stayed asleep for about another minute until I pressed a key. The kernel then logged PM: Triggering wakeup from IRQ 9 and ACPI: PM: ACPI non-EC GPE wakeup, with Timekeeping suspended for 162.305 seconds, and logind reported Lid opened only after the resume. I didn't read the GPE flags, so I can't confirm CAN_WAKE directly, but the behaviour matches yours: the lid event waited for the resume, and only the key press woke the machine.

@niconistal, this affects the description's line that the lid still wakes the machine: in my cycle on this firmware and kernel it didn't. Your omacom/omarchy-pkgs#596 test has the kernel back 0.5 s after Lid opened in the 3-minute lid close. Was a key pressed there, or did your 7.2.5 build wake on the lid itself?

@makoni

makoni commented Nov 10, 2026

Copy link
Copy Markdown

Follow-up to my lid-wake comment above: marking the EC GPE for wake made the lid wake the machine in both cycles I tried on my 14,3. Stock linux-omarchy 7.2.15-1, firmware 529.140.2.0.0, the T1's USB remote wake disabled, and neither omacom/omarchy-pkgs#596 nor omacom/omarchy-pkgs#544.

I loaded a module that only calls the exported acpi_ec_mark_gpe_for_wake() at load, then:

  • A lid close of 65.6 s: the machine woke within 1–2 s of opening the lid, with no key press. With pm_debug_messages on: ACPI: EC: ACPI EC GPE status set, ACPI: EC: ACPI EC GPE dispatched, then ACPI: PM: Wakeup after ACPI Notify sync.
  • A lid close of about an hour (Timekeeping suspended for 3623.965 seconds, on the charger): one wakeup in total, from the lid, with no earlier wakeups and no Rearming ACPI SCI for wakeup lines.

The 7.2.15 source matches your description. acpi_s2idle_prepare() calls acpi_ec_set_gpe_wake_mask(ACPI_GPE_ENABLE), and acpi_set_gpe_wake_mask() returns AE_TYPE for a GPE without CAN_WAKE. The only caller of acpi_ec_mark_gpe_for_wake() is lps0_device_attach(). The wake mask is cleared again in acpi_s2idle_restore() and isn't set on the S3 path. An EC event that isn't a wakeup is processed and the SCI is rearmed; the lid counts as a wakeup through acpi_lid_notify() → acpi_pm_wakeup_event(), which as far as I can tell needs LID0 to be wakeup-enabled (it is *enabled here).

For comparison, macOS appears to use S3 on this Mac (its power log reads Wake from Normal Sleep [CDNVA] : due to EC.LidOpen/UserActivity Assertion). GPE 0x6F is the _PRW GPE of both LID0 and the EC, so it is most likely the line that wakes it there. On Linux, gpe6F stayed at 0 through all three lid cycles this boot, with and without the module; in the two cycles with the module, the wake came through the EC GPE.

@patattzel, are you still preparing the linux-acpi report? If so, I'd rather add this unit to it as a second data point than send a separate patch.

@makoni

makoni commented Nov 10, 2026

Copy link
Copy Markdown

@niconistal, a status check against the current kernel, since the description's testing was on 7.2.5. On my 14,3 with the stock kernel linux-omarchy 7.2.15-1, without omacom/omarchy-pkgs#596 or omacom/omarchy-pkgs#544 and with the T1's USB remote wake disabled as in this PR, I ran three lid-closed s2idle cycles on 10 November (about 2.7 min, 65 s and 1 h; the second and third with the EC wake module from my comments above loaded):

  • No 65 s stall: noirq resume took 5.15 s, 1.25 s and 0.16 s.
  • Wi-Fi came back every time, 3–5 s after PM: suspend exit, with no MMIO or probe errors. My brcmfmac is the 7.2.15 source with the recipe's 0680/0681 plus a FEM fix that doesn't touch the suspend path, and without 0682, so on this kernel and unit Wi-Fi came back without it; the third cycle did a full re-probe of the card. I haven't repeated this with the packaged module itself.
  • Thunderbolt was lost in all three cycles: both NHIs became inaccessible, their xHCI controllers were removed, and the USB-C ports stayed dead until a reboot. That's what 0609 in linux-omarchy: MacBookPro14,3 backlight, BCM43602 D0, Thunderbolt and fan s2idle fixes omarchy-pkgs#596 addresses.
  • Opening the lid doesn't wake the machine without the EC GPE marking discussed above; a key press does. The description currently lists the lid as a working wake source.

So on 7.2.15 the remaining blocker looks like Thunderbolt, plus the lid wake. Given your note that every lid close in S3 ended in a forced power-off, would you consider taking this out of draft with those two limits documented, or do you still plan to wait for omacom/omarchy-pkgs#596? This is a small sample from one machine.

@patattzel

Copy link
Copy Markdown

@makoni Yes. The linux-acpi report is still a draft and has not been mailed. Please add this unit there rather than sending a separate patch.

Your stock linux-omarchy 7.2.15-1 cycles are the reproduction the draft did not have. It was written from 7.2.15-2-omarchy and a locally corrected test kernel, with the host suspend patches loaded, and it said so. This machine's firmware is also 529.140.2.0.0. No new lid cycle was run for this reply.

From the 7.2.15 tree, your source reading matches:

  • acpi_ec_mark_gpe_for_wake() is called only from lps0_device_attach().
  • acpi_s2idle_prepare() calls acpi_ec_set_gpe_wake_mask(ACPI_GPE_ENABLE).
  • acpi_set_gpe_wake_mask() returns AE_TYPE when ACPI_GPE_CAN_WAKE is clear, and acpi_ec_set_gpe_wake_mask() does not propagate that status.
  • The mask is cleared in acpi_s2idle_restore() and is not set on the S3 path.

I checked current mainline (drivers/acpi/ec.c and drivers/acpi/x86/s2idle.c). That single caller is unchanged, so this is not already fixed upstream.

I will fold your two comments in as the second machine, only as published:

  • Without the mark: lid open did not wake; a key press did. Log: PM: Triggering wakeup from IRQ 9, ACPI: PM: ACPI non-EC GPE wakeup, timekeeping suspended 162.305 s, Lid opened only after resume.
  • With acpi_ec_mark_gpe_for_wake(): a 65.6 s lid close woke in 1–2 s (ACPI EC GPE status set, ACPI EC GPE dispatched, Wakeup after ACPI Notify sync); about one hour on the charger (3623.965 s) was a single lid wakeup, with no earlier wakeup and no Rearming ACPI SCI for wakeup.
  • gpe6F stayed at 0; the accepted wake was the EC GPE. The macOS S3 / EC.LidOpen note stays a comparison, not a Linux result.

Still not claimed: a vanilla mainline build, battery drain, or every 14,3 firmware. The open question is unchanged: generic no-LPS0 EC handling, or a narrow quirk. I am not sending the exact-release helper as the fix.

If anything you want in the report is not already in those two comments, including how you want to be credited, reply here. I will not mail linux-acpi until you have had a chance to correct that, so this stays one report.

@patattzel

Copy link
Copy Markdown

The distro carry of the quirk is up, separate from the linux-acpi report: omacom/omarchy-pkgs#2472

It is the same acpi_ec_mark_gpe_for_wake() call, limited to MacBookPro14,3, in linux-omarchy and the eevdf/muqss builds. It does not replace #596, #544, or this pull request, and it does not pick the generic no-LPS0 answer. I have still not mailed linux-acpi.

@makoni, if you boot that kernel without the out-of-tree module, the expected line is ACPI: EC: GPE=0x7 marked wake-capable. A Tested-by from your unit belongs on that pull request. I will keep the report draft until you have corrected it.

@makoni

makoni commented Nov 11, 2026

Copy link
Copy Markdown

@patattzel, your summary of my two comments is accurate; there's nothing to correct. For the report, please credit me as Sergey Armodin <[email protected]>, as a Tested-by: if that fits.

One addition since: a kernel built from the branch of omacom/omarchy-pkgs#2472 (a plain make all of its recipe, not a packaged build) works here too, without any out-of-tree helper. The log has GPE=0x7 marked wake-capable, and opening the lid ended a 243.5 s s2idle sleep with no key press. Details and the tag are on that pull request. Battery drain is still not measured.

@patattzel

Copy link
Copy Markdown

@makoni The summary you confirmed stands. The draft credits you as:

Tested-by: Sergey Armodin [email protected]

The additional cycle is included only as published on omarchy-pkgs#2472: recipe d5a5d2d3, no out-of-tree EC helper, ACPI: EC: GPE=0x7 marked wake-capable, lid open ended a 243.531 s s2idle sleep with no key press. The 5.15 s noirq resume stays with #544, not this quirk. Battery drain is still not measured. The same line is now in the #2472 description.

The report is still a draft and has not been mailed. No new lid cycle was run on this machine for this reply.

Prepared with AI assistance from the published comments. No new hardware test.

@angellindo

Copy link
Copy Markdown

Tested on a MacBookPro14,3 (firmware 529.140.2.0.0, Omarchy 4.5.0-3). With Radeon driving the internal panel, deep S3 on local 7.2.15-1.1-omarchy-mbp143ab reproduced amdgpu: SMU load firmware failed and amdgpu_device_ip_resume failed (-22), corrupting the panel and requiring a hard reset (Touch Bar still responded). With Intel driving the panel and local S3 workarounds (Radeon unbind before S3 and T1 SOCW), the same machine resumed cleanly after 9 h 32 min of lid-closed deep S3 on battery with Touch Bar and speakers working.

Radeon + s2idle hardware run (#596 + #544 + #2472): I validated the proposed Radeon + s2idle setup on a separate 7.2.15 trial kernel carrying the six patches from omacom/omarchy-pkgs#596, omacom/omarchy-pkgs#544, and omacom/omarchy-pkgs#2472 (trimmed localmodconfig without Rust/BTF, pure in-tree thunderbolt, brcmfmac, applespi, and applesmc; apple-ib-drv and snd_hda_macbookpro via DKMS). Booted with Radeon primary (amdgpudrmfb, 0000:01:00.0 boot_vga=1), this PR's kernel parameters (mem_sleep_default=s2idle button.lid_init_state=open, plus pm_debug_messages), SuspendState=mem, and T1 power/wakeup=disabled:

  • Boot logged ACPI: EC: GPE=0x7 marked wake-capable (this unit also has an ECDT table and no PNP0D80).
  • One lid-closed s2idle cycle on battery held uninterrupted for 428.298 s (Timekeeping suspended for 428.298 seconds, no spurious wakes).
  • Opening the lid woke the machine via EC GPE (PM: Triggering wakeup from IRQ 9 -> ACPI: EC: ACPI EC GPE status set -> ACPI: EC: ACPI EC GPE dispatched -> ACPI: PM: Wakeup after ACPI Notify sync; gpe6F stayed at 0).
  • noirq resume completed in 528.384 ms and device resume in 327.494 ms, with clean Radeon resume (no SMU/-22 errors), 5 GHz Wi-Fi reconnected, both Alpine Ridge root links at 8.0 GT/s x4 (D0) with both NHIs (06:00.0, 7c:00.0) and all three xHCI controllers (00:14.0, 07:00.0, 7d:00.0) intact, and working keyboard, Touch Bar, and speakers.
  • Since this is a third 14,3 on 529.140.2.0.0 with ECDT and no PNP0D80, it may be worth listing linux-omarchy: mark the EC GPE wake-capable on the MacBookPro14,3 omarchy-pkgs#2472 alongside QT scaling #596 and Remove default scaling as most people do not have high resolution screen. #544 in the PR dependency note.

T1 udev rule (99-omarchy-apple-t1-nowake.rules, live hardware check): Interface 1-3:1.2 of 05ac:8600 is a HID boot keyboard (03/01/01, usbhid). In Linux 7.2.15, usbhid_start() (drivers/hid/usbhid/hid-core.c:1207-1212) calls device_set_wakeup_enable(&dev->dev, 1) on the parent USB device 1-3 during usb_set_configuration(), which runs after ACTION=="add" and before ACTION=="bind" on 1-3. Testing the PR's exact ACTION=="add" rule on its own (with my local rule temporarily removed): a direct udevadm trigger --action=add changed 1-3/power/wakeup from enabled to disabled, but a real usb driver unbind/bind of 1-3 left 1-3/power/wakeup at enabled. Widening the rule to ACTION=="add|change|bind" with TEST=="power/wakeup" left 1-3/power/wakeup at disabled across the same unbind/bind. Could 99-omarchy-apple-t1-nowake.rules cover ACTION=="add|change|bind" (and TEST=="power/wakeup")?

Migration (migrations/1791525672.sh, isolated fixtures at dff49a6):

  • Silent UKI rebuild failure and repeated pre-reboot rebuilds: /usr/share/libalpm/scripts/limine-mkinitcpio-install uses process_uki_kernel || return 0 (line 297) and process_kernel "$kernel_dir" || true (line 315), so sudo limine-mkinitcpio exits 0 even after logging mkinitcpio failed for kernel .... In the fixture (and observed in live limine-mkinitcpio output during trial setup), 1791525672.sh still set reboot-required after a failed per-kernel build; re-running the migration before reboot also triggered a second full UKI rebuild. Could 1791525672.sh adopt the same tee + grep -q 'mkinitcpio failed for kernel' check and machine-wide /var/lib/omarchy/migrations/... marker already merged in quattro (migrations/1795274792.sh) and used in Fix lid-close suspend on the MacBookPro14,1 #14409?
  • Two smaller notes: (1) Because the DMI gate checks only product_name == MacBookPro14,3 without checking boot_vga, an Intel-primary 14,3 also receives the Limine drop-in and UKI rebuild (changing the kernel default to s2idle unless overridden locally via MemorySleepMode=deep). (2) When needs_rebuild=0 (parameters already in /proc/cmdline), the migration writes the T1 udev rule without reloading/triggering udev or setting reboot-required.

@makoni

makoni commented Nov 24, 2026

Copy link
Copy Markdown

@niconistal, a status update since my comments of 10 November, and a question at the end. The branch hasn't changed since 9 October.

Do you want to keep working on this PR? If you don't have the time, would you mind if I opened a follow-up based on your branch, with you credited as co-author? It would take in the points above and state plainly what still depends on the kernel. I'll wait about a week before doing that.

Copy link
Copy Markdown

@makoni, a correction on the first point: closing omacom/omarchy-pkgs#2472 was an accident. I deleted my fork by mistake and GitHub closed the PR with it. It's back unchanged as omacom/omarchy-pkgs#3393, same commit, so the EC GPE quirk for the lid wake is pending again.

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.

4 participants