Skip to content

soc: apple: sleep: read a T6050 power word through its region - #2177

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
j716c/sleep-ps-full-region
Nov 18, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
j716c/sleep-ps-full-region

Conversation

@erikwb

@erikwb erikwb commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

On a J716c (M5 Max), every deep sleep on the current integration/aurora resets the Mac instead of sleeping. It came in with #2135.

sleep_ps_full() read the power word at s->ps + offset. T6050's power words are region-encoded, and sleep_power_reg() is what turns one into its address; sleep_ps_on() and the other readers already go through it. Since #2135, the bound display-coprocessor check in apple_sleep_refuse() and the bound gate checks in apple_sleep_gate_failed() call sleep_asc_running(), and so sleep_ps_full(), during T6050's early-entry refusal checks with interrupts off. There it read a wrong address.

Change

  • sleep_ps_full() reads the word through sleep_power_reg(). That is s->ps + offset on the SoCs without regions, so nothing changes for them.

Testing

On a J716c (M5 Max, 128 GB), with this fix plus #1956, #1957 and #2162 on integration/aurora 59b02d5:

  • Without the fix: a 30 s RTC deep sleep (mem_sleep deep, rtcwake -m mem -s 30) reset the Mac each time (3 of 3).
  • With T8142: suspend-to-RAM with J813 device and USB-C display recovery #2135 reverted instead: the same sleep suspends and resumes.
  • With the fix: suspends and resumes (suspend_stats/success 1), all four displays (internal and two 4K240 over Thunderbolt) come back, no oops or warning, ANE add-128 1000/1000 bit exact after the wake.
  • checkpatch --strict: clean.
  • Not tested: T8142 or another region-less SoC on hardware (the read is the same address there).

🤖 Generated with Claude Code

sleep_ps_full() read the power word at s->ps + offset. On T6050 the
words are region-encoded (SLEEP_REGION(w)), and sleep_power_reg() is
what turns one into its address; sleep_ps_on() and the other readers
went through it with the T6050 support, which missed this one.

Since the T8142 sleep support, the bound display-coprocessor check in
apple_sleep_refuse() and the bound gate checks in
apple_sleep_gate_failed() call sleep_asc_running(), and so
sleep_ps_full(), during T6050's early-entry refusal checks, with
interrupts off on the last CPU. There it read a wrong address, and the
J716c reset during every deep sleep instead of sleeping. Read the word
through sleep_power_reg(), which is s->ps + offset on the SoCs without
regions, so nothing changes there.

Developed with Claude Code.

Fixes: 5ce3491 ("soc: apple: sleep: T6050 (M5 Pro) suspend to RAM")
Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@sithglan can you test this with your m5 air/s? I believe d54ceba was base-m5 specific and broke on pro/max - this should support the whole m5 family through deep sleep.

@sithglan

Copy link
Copy Markdown
Contributor

Tested on my J813 (MacBook Air 13" M5). I have no Pro/Max or 15" Air to test with.

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