summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_gpu.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 10:13:04 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 10:13:04 -0400
commit582696da869374455c3bcdaf63cbcd28352da14e (patch)
treece0832a6c1caf050d3fdb4706d13a738e3fbbdcc /kernel/gsp_phys_gpu.c
parentb589a88ff559833a80ff60c86d1e2c823bd66839 (diff)
downloadopen-iov-582696da869374455c3bcdaf63cbcd28352da14e.tar.gz
open-iov-582696da869374455c3bcdaf63cbcd28352da14e.zip
gsp-phys: command-queue TX and the GSP-RM unload RPC for clean teardown
Adds a minimal msgq producer on the command queue (element layout, checksum, sequence, dma_wmb before writePtr, doorbell) and submits the UNLOADING_GUEST_DRIVER RPC so GSP-RM shuts down and sets the scratch14 handoff bit the Booter Unload gate needs. Release attempts the RPC once before quiescing when a boot ran; on-demand testing is available through the debugfs file gsp-phys-unload-rpc while the module owns the GPU. GSP-RM processor suspend is polled on the GSP mailbox.
Diffstat (limited to 'kernel/gsp_phys_gpu.c')
-rw-r--r--kernel/gsp_phys_gpu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/gsp_phys_gpu.c b/kernel/gsp_phys_gpu.c
index 79c79bf..88d13f2 100644
--- a/kernel/gsp_phys_gpu.c
+++ b/kernel/gsp_phys_gpu.c
@@ -898,6 +898,15 @@ void gsp_phys_gpu_release(void)
wpr2_ret = -EIO;
gsp_phys_boot_staging_free(phys.pdev);
} else {
+ /*
+ * Clean GSP-RM shutdown: after a stage-3d boot, send
+ * UNLOADING_GUEST_DRIVER once (no-op otherwise) so
+ * GSP-RM suspends and sets the scratch14 handoff bits
+ * the Booter Unload gate needs; then quiesce the GSP
+ * falcon and run the existing FWSEC teardown. A failed
+ * RPC leaves the existing fail-safe in charge.
+ */
+ gsp_phys_boot_rm_unload(phys.bar0);
gsp_phys_boot_quiesce(phys.bar0);
wpr2_ret = gsp_phys_fwsec_release(&phys.boot,
phys.pdev,