summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_emulation.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-21 20:08:39 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-21 20:08:39 -0400
commit1e73a2e00c76e25e4ce2980e5d04a533b0c6158d (patch)
treeaebdceb64f185719fe03a273c6fce334db305a29 /kernel/gsp_emulation.c
parent0630028527ae401e15a99cf1145829e9725a13ad (diff)
downloadopen-iov-1e73a2e00c76e25e4ce2980e5d04a533b0c6158d.tar.gz
open-iov-1e73a2e00c76e25e4ce2980e5d04a533b0c6158d.zip
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.
Diffstat (limited to 'kernel/gsp_emulation.c')
-rw-r--r--kernel/gsp_emulation.c14
1 files changed, 12 insertions, 2 deletions
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");
+ }
}
/* ============================================================