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
sithglan added a commit that referenced this pull request Nov 21, 2026
The J873 backend builds only the 26A428 (macOS 27.0, 27.0.1) InitData
graph and admits only that firmware's loader receipt. macOS 27.2
(26B123) ships the G18G firmware RTKit 3514.41.1, which rejects that
graph at its first check.

Against 26A434, whose GPU firmware is the 26A428 one, 26B123 differs in
three places:

- the root version word gains bit 45 (0x0c8b_4339_83a0_04c0 ->
  0x0c8b_6339_83a0_04c0), which both roles compare with root +0;
- the perf/policy block grows from 0x7800 to 0x7860 and the status
  config from 0x6d0 to 0x6d8; the other 22 allocations keep their sizes.
  Everything after the policy in shared allocation #1 moves by 0x80, and
  the page total stays 0x28000. The private cluster keeps its layout, as
  0x6d8 packs to the same 0x700;
- inside those two objects fields move: policy +0x2f0c..+0x2f17 by 0x10
  and +0x2fb4..+0x6d9f by 0x18, with a new word at +0x2f28; status config
  +0x59c..+0x5b3 by 4 and +0x5b4 to the end by 8, with new words at
  +0x59c and +0x5b8. +0x2f28 and +0x5b8 carry a new parameter of the GPU
  power controller. Neither the ADT's GPU node nor the firmware data the
  loader passes carries it. With both words zero the firmware boots, and
  renders with the same throughput and latency, so they stay zero, as
  +0x59c does; the 26A428 layout runs without them.

hw_data, the roots, the main configs, status B and region C keep their
field offsets.

Describe a firmware build's layouts as G18GLayouts. The 26A428 encoders
stay as they are; for 26B123 the policy and status config they produce
are moved by relocation bands and the new words are written. The loader
receipt names the build: G18G-RTKit-3514.0.15.release selects 26A428 as
before, G18G-RTKit-3514.41.1.release selects 26B123. The 26A428 graph is
unchanged.

Tested on a J873 (Mac mini M6) booted from a macOS 27.2 stub, with this
change on the tree that drives its display: both firmware roles accept
the graph, stage 10 registers the render node, sway composites on the
GPU and es2gears runs at about 300 FPS without vsync. With the
power-controller words zero, a 1M-triangle scene runs at 20.2 fps, a
20k one at 493 fps and a compositor-like clear every 16.7 ms signals
after 0.39 ms (p50), the same as with them set, and no GPU job fails.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
sithglan added a commit that referenced this pull request Nov 21, 2026
The J873 backend builds only the 26A428 (macOS 27.0, 27.0.1) InitData
graph and admits only that firmware's loader receipt. macOS 27.2
(26B123) ships the G18G firmware RTKit 3514.41.1, which rejects that
graph at its first check.

Against 26A434, whose GPU firmware is the 26A428 one, 26B123 differs in
three places:

- the root version word gains bit 45 (0x0c8b_4339_83a0_04c0 ->
  0x0c8b_6339_83a0_04c0), which both roles compare with root +0;
- the perf/policy block grows from 0x7800 to 0x7860 and the status
  config from 0x6d0 to 0x6d8; the other 22 allocations keep their sizes.
  Everything after the policy in shared allocation #1 moves by 0x80, and
  the page total stays 0x28000. The private cluster keeps its layout, as
  0x6d8 packs to the same 0x700;
- inside those two objects fields move: policy +0x2f0c..+0x2f17 by 0x10
  and +0x2fb4..+0x6d9f by 0x18, with a new word at +0x2f28; status config
  +0x59c..+0x5b3 by 4 and +0x5b4 to the end by 8, with new words at
  +0x59c and +0x5b8. +0x2f28 and +0x5b8 carry a new parameter of the GPU
  power controller. Neither the ADT's GPU node nor the firmware data the
  loader passes carries it. With both words zero the firmware boots, and
  renders with the same throughput and latency, so they stay zero, as
  +0x59c does; the 26A428 layout runs without them.

hw_data, the roots, the main configs, status B and region C keep their
field offsets.

Describe a firmware build's layouts as G18GLayouts. The 26A428 encoders
stay as they are; for 26B123 the policy and status config they produce
are moved by relocation bands. The loader
receipt names the build: G18G-RTKit-3514.0.15.release selects 26A428 as
before, G18G-RTKit-3514.41.1.release selects 26B123. The 26A428 graph is
unchanged.

Tested on a J873 (Mac mini M6) booted from a macOS 27.2 stub, with this
change on the tree that drives its display: both firmware roles accept
the graph, stage 10 registers the render node, sway composites on the
GPU and es2gears runs at about 300 FPS without vsync. With the
power-controller words zero, a 1M-triangle scene runs at 20.2 fps, a
20k one at 493 fps and a compositor-like clear every 16.7 ms signals
after 0.39 ms (p50), the same as with them set, and no GPU job fails.

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