Skip to content

TEST ONLY: J813: order the final SMC sleep notice after ANS - #1

Closed
sithglan wants to merge 4 commits into
thomas/j813-dcp-s2r-followupfrom
thomas/j813-smc-after-ans
Closed

sithglan wants to merge 4 commits into
thomas/j813-dcp-s2r-followupfrom
thomas/j813-smc-after-ans

Conversation

@sithglan

@sithglan sithglan commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Historical experiment: the final SMC fix is now included in m0d16l14n1/linux#5 as 321a7e5, with the same source tree as candidate 651007b. The separate upstream PR aurora-silicon#2086 is being closed.

A J813 lid suspend after MagSafe removal returned Linux and Wi-Fi but left the display and storage unavailable. ANS missed its IOP IDLE acknowledgment before commit; SMC faulted at ANS mailbox address 0x48160c110, DCP power-on timed out, and ANS endpoint discovery failed.

This is a TEST ONLY, unqualified experiment, stacked on m0d16l14n1/linux#5. The matching J813 native trace completes ANS idle before the final SMC MBSE/AP IDLE notice. The existing Linux path sends that notice first.

  • Defer the final SMC notice on J813 until peer stops finish, before last-mile domain shutdown. The boot switch apple_sleep.j813_smc_late=0 restores the original ordering.
  • Reserve the existing bounded SMC transport in prepare_late so the notice can run with local IRQs disabled. Check ownership before irreversible peer stops.
  • Release transport ownership at platform wake, retaining J813's original AP ON notification in macsmc resume_noirq. Other SoCs keep their existing wake policy.
  • Preserve J813's existing command sequence, delay floors and wake-reason table.

Full arm64 LLVM 22 Image, modules and DT builds pass; strict checkpatch is clean. Cancellation before commit preserves GPU and Bluetooth operation.

The initial transport reuse stalled and reset. The next build exposed missing scope acquisition, fixed before the physical campaign. With the scope wired, three physical wakes returned SMC, ANS, DCP, GPU and Bluetooth; ANS restarted in 168/170/170 ms. However, Alpha Wi-Fi aborted on the first wake. A second boot with normal console settings reproduced that failure. These are partial wakes, not successful system qualification.

The current head, 651007b, preserves the original SMC wake-notice timing because platform wake had moved AP ON ahead of device noirq resume and DMA restoration. Three physical RTC wakes now pass, with the panel on and fbcon bound throughout entry, unchanged boot ID 1c522e44-c4b9-468a-a0b5-42501dc92f71, and suspend counter 0 -> 3. Each wake passed Apple M5 GPU clear/readback, Bluetooth opcode 0x1001 completion, brightness 100, all ten CPUs, and a fresh SSH connection over Wi-Fi. ANS restart times were 167/169/170 ms. A subsequent uncached 32 MiB disk read matched its checksum.

The user subsequently completed two physical lid wakes with MagSafe unplugged: boot-object count 3 -> 5, MTP wake source and SMC lid bit, ANS restart 170/169 ms, display restored. Follow-up GPU, Bluetooth, CPU and uncached storage checks pass. The focused fix is carried in m0d16l14n1#5; aurora-silicon#2086 is superseded. A later USB hub/Ethernet hot-plug exposed a PHY timeout and refused another suspend before commit; that separate issue is being investigated. Raw firmware and crash captures remain private.

The MagSafe/lid failure missed ANS IOP IDLE and then SMC faulted at ANS mailbox +0xc110. The native J813 trace idles ANS before SMC's final notice; the current noirq path reverses that order. Defer the existing notice to platform entry after peer stops and before domain power-down. This is a hypothesis under hardware qualification; j813_smc_late=0 restores the original ordering.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The platform enter callback runs with local IRQs disabled. The normal noirq SMC path can wait on scheduler work and jiffies, and the first ordering experiment stalled there. Reserve the existing saved SMC transport in prepare_late and restore it in platform wake. Keep J813's MBSE/AP sequence and delay floors without importing the other SoC's policy.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Only the early-context suspend ops had prepare_late and finish callbacks. Wire the SMC scope callbacks into the regular ops too, and require held ownership before entering the irreversible region. The scope begin is a no-op when the experimental late notice is disabled.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The saved transport restores AP power in platform wake, before device noirq resume. Using that on J813 moved AP ON ahead of the radio's DMA restoration. Two fresh boots returned from physical sleep with healthy SMC/ANS/DCP but Alpha in firmware stage 3. Release the bounded transport at platform wake and leave ap_notified set for J813's existing resume_noirq notice. The other SoC's saved policy keeps its original release behavior.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan

Copy link
Copy Markdown
Owner Author

Superseded: the SMC ordering fix is now part of m0d16l14n1#5.

@sithglan sithglan closed this Nov 16, 2026
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