Skip to content

soc: apple: sleep: send J813's final SMC notice after peer stops - #2086

Closed
sithglan wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j813-smc-after-ans-upstream
Closed

sithglan wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j813-smc-after-ans-upstream

Conversation

@sithglan

@sithglan sithglan commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Superseded: this fix is now included in m0d16l14n1/linux#5, commit 321a7e5c9faf. This separate upstream PR is closed in favor of that series.

After unplugging MagSafe and closing/reopening a J813 lid, Linux and Wi-Fi returned but the display stayed black and storage stopped responding. ANS missed its IOP IDLE acknowledgment; SMC faulted at ANS mailbox address 0x48160c110, followed by DCP power-on and ANS restart timeouts.

The matching native trace completes ANS idle before the final SMC MBSE/AP IDLE notice. Move J813's notice behind the peer stops, using the existing bounded transport while interrupts are disabled. Reserve ownership in prepare_late and check it before irreversible stops. At wake, release transport ownership while retaining AP IDLE until macsmc resume_noirq: moving AP ON earlier into platform wake caused Alpha Wi-Fi aborts in testing.

This is a focused three-file change on integration/aurora at bf423bf. T8142 runtime support depends on #2043 and the related bring-up prerequisites. The tested stack is m0d16l14n1/linux#5 plus candidate 651007b (experiment PR); those prerequisite series are not bundled here. The existing J813 diagnostic switch and delay floors are retained; apple_sleep.j813_smc_late=0 selects the previous entry ordering.

Validation:

  • Full arm64 LLVM 22 Image.gz, modules and DT build on the submitted upstream base; strict checkpatch: 0 errors, warnings or checks.
  • Hardware on the candidate stack: three RTC wakes and two physical lid wakes with MagSafe unplugged, boot-object count 0 -> 5 with unchanged boot ID. Lid wakes used the MTP source and recorded the SMC lid bit; ANS restarted in 170/169 ms.
  • Display restored to brightness 100. RTC checks also verified actual Apple M5 GPU clear/readback, Bluetooth opcode 0x1001, all ten CPUs, Wi-Fi SSH and an uncached 32 MiB disk read.

A later hub/Ethernet hot-plug attempt exposed a USB PHY timeout and refused the next suspend during device prepare, before this commit path. That separate USB restoration issue is being investigated; this PR does not claim complete peripheral or long-term sleep qualification. The exact upstream-only build has not been booted because its T8142 sleep prerequisites are still pending.

cc @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10

After a battery lid suspend on J813, ANS failed its IOP IDLE handshake and SMC faulted at the ANS mailbox. Linux resumed, but ANS could not restart and DCP power-on timed out. The matching native trace idles ANS before the final SMC MBSE/AP IDLE sequence.

Defer that sequence until the peer stops have finished. Reserve the existing bounded SMC transport before IRQ shutdown and check ownership before irreversible stops. Release it at platform wake, retaining AP IDLE until macsmc resume_noirq so the original wake-notice timing is preserved. Sending AP ON from platform wake caused Alpha Wi-Fi aborts on the test stack.

Keep the J813-only diagnostic switch, command sequence and delay floors. Three RTC and two battery lid wakes completed on the tested T8142 stack with the final behavior. The upstream build passes; T8142 runtime support still depends on the pending sleep series.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
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.

1 participant