Skip to content

drm/asahi: G16: run each probe phase in its own stack frame - #1669

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
niteria:j713/g16-probe-stack
Nov 12, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
niteria:j713/g16-probe-stack

Conversation

@niteria

@niteria niteria commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

On the J713 (MacBook Air M4), loading the G16 GPU module overflows the probe's 32 KB stack:

Insufficient stack space to handle exception!
pc : ...g16...Firmware13start_backend+0x54 [aurora]
Kernel panic - not syncing: kernel stack overflow

Gpu::new() runs admission, the firmware start and the backend start in turn. Built for the J713, the compiler now inlines the first two into it, a 17 KB frame, and calls the third, which has 14 KB of its own. Below the probe path that no longer fits in the 32 KB stack. Before the G16 changes #1445 brought in, the backend start was inlined as well: one 18 KB frame.

This keeps all three out of line, so each phase's temporaries are gone when it returns. Measured from the frames in aurora.o, the deepest path below the probe goes from 34.5 KB to 24.9 KB (26.1 KB before those changes). The backend start's own frame, mostly whole-Firmware moves, is the next thing to shrink.

Seen with the G16 code as #1445 merged it, which integration/aurora still has. Tested on the J713 as part of #1314: with this commit the module loads, the GPU renders, and its firmware comes back after each deep sleep.

🤖 Generated with Claude Code

Loading the GPU module on the J713 overflows the probe's stack:

  Insufficient stack space to handle exception!
  pc : ...g16...Firmware13start_backend+0x54 [aurora]
  Kernel panic - not syncing: kernel stack overflow

Gpu::new() runs admission, the firmware start and the backend start in
turn. Built for the J713, the compiler now inlines the first two into
it, a 17 KB frame, and calls the third, which has 14 KB of its own.
Below the probe path that no longer fits in the 32 KB stack. Before the
last G16 changes the backend start was inlined as well: one 18 KB frame.

Keep all three out of line, so each phase's temporaries are gone when
it returns. Measured from the frames in aurora.o, the deepest path below
the probe goes from 34.5 KB to 24.9 KB (26.1 KB before those changes).
The backend start's own frame, mostly whole-Firmware moves, is the next
thing to shrink.

Assisted-by: LLM
Signed-off-by: Bartosz Nitka <niteria@gmail.com>
@niteria
niteria marked this pull request as ready for review November 12, 2026 10:24
@DjDeveloperr
DjDeveloperr merged commit f173f7c into aurora-silicon:integration/aurora Nov 12, 2026
1 check passed
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.

2 participants