From 1e73a2e00c76e25e4ce2980e5d04a533b0c6158d Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Mon, 21 Sep 2026 20:08:39 -0400 Subject: kernel: Booter-Unload success + SM order table (unload/reload cycle works) - gsp_emu_poll_boot generic SEC2 kick path: clear SEC2_MAILBOX0=0 (success) - Booter Unload during GPU shutdown read a stale 0xff, failing the unload and killing the subsequent re-init ('Booter failed with non-zero error code: 0xff' -> RmInitAdapter 0x40). A SEC2 kick after a completed boot is a GSP shutdown/reload: clear boot state. Driver unload/reload cycle (last close -> RmShutdown, next open -> RmInitAdapter) now works. - STATIC_KGR_GET_GLOBAL_SM_ORDER(0x20800a22): TU104 topology 6 GPC x 4 TPC x 2 SM = 48 SMs/24 TPCs on GR0. kgrStaticInit is init-critical (NV_CHECK_OK_OR_GOTO); zeros left numSm=0 and NVML spun on empty topology. --- kernel/gsp_emulation.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'kernel/gsp_emulation.c') diff --git a/kernel/gsp_emulation.c b/kernel/gsp_emulation.c index 5522bf3..bca8a52 100644 --- a/kernel/gsp_emulation.c +++ b/kernel/gsp_emulation.c @@ -234,13 +234,23 @@ static void gsp_emu_poll_boot(struct gsp_emu_context *ctx) return; } - /* Any other STARTCPU kick (resume/unload/etc.): just complete it */ + /* Any other STARTCPU kick (resume/unload/etc.): complete it. + * SEC2 kicks report their ucode result in SEC2_MAILBOX0 (0=success) - + * e.g. Booter Unload during GPU shutdown. Without clearing it the + * driver reads a stale/garbage error code (0xff) and the unload + * fails, killing the subsequent re-init. A SEC2 kick after a + * completed boot is a GSP shutdown/reload: drop the boot state + * (GSP no longer active, queue dead). */ if (gsp_cpuctl & GSP_EMU_CPUCTL_STARTCPU) gsp_emu_shadow_write32(ctx, GSP_EMU_REG_GSP_CPUCTL, GSP_EMU_CPUCTL_HALTED); - if (sec2_cpuctl & GSP_EMU_CPUCTL_STARTCPU) + if (sec2_cpuctl & GSP_EMU_CPUCTL_STARTCPU) { + gsp_emu_shadow_write32(ctx, GSP_EMU_REG_SEC2_MAILBOX0, 0); gsp_emu_shadow_write32(ctx, GSP_EMU_REG_SEC2_CPUCTL, GSP_EMU_CPUCTL_HALTED); + if (ctx->boot_stage == GSP_BOOT_STAGE_BOOTER_DONE) + gsp_emu_clear_boot_state(ctx, "Booter unload/reload kick"); + } } /* ============================================================ -- cgit v1.2.3