diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-07 10:19:13 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-07 10:19:13 -0400 |
| commit | bfbe85f50f5243e601d98fe40b43e364c3e8901f (patch) | |
| tree | 755674d61d8c3e739b8d5d573925cce7e17cc7fb /kernel/gsp_phys_booter.c | |
| parent | ea9130180949fd72eca534e4f5a83336ad7e5d4a (diff) | |
| download | open-iov-bfbe85f50f5243e601d98fe40b43e364c3e8901f.tar.gz open-iov-bfbe85f50f5243e601d98fe40b43e364c3e8901f.zip | |
vgsp: m76 - R2 lane tail (TSG PREEMPT bWait + device-sched off + perf boost)
The real client's context-creation tail after the lane-enable trio is
#1073 NVA06C_CTRL_CMD_PREEMPT on the TSG with bWait=1, #1075
NV0080 device-sched disable, #1077 PERF_BOOST_SET_2X. The explicit preempt
makes the RM perform a clean context save/switch-out at setup time so the
first dispatch loads the context normally; without it our lane's context sits
loaded from the ladder and task activation ends in a save/unload instead of
execution (m72/m73/m75 signature). Gated by gsp_phys_rmcall_gr_lane_tail
(default 0).
Diffstat (limited to 'kernel/gsp_phys_booter.c')
| -rw-r--r-- | kernel/gsp_phys_booter.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c index 17fdcee..b8de6c3 100644 --- a/kernel/gsp_phys_booter.c +++ b/kernel/gsp_phys_booter.c @@ -263,6 +263,8 @@ bool gsp_phys_boot_requested(void) * runs with VALID=1, so the SKED schedule leg has no valid context. */ #define GSP_PHYS_RMCALL_CTRL_SET_TIMESLICE 0xa06c0103u +#define GSP_PHYS_RMCALL_CTRL_TSG_PREEMPT 0xa06c0105u +#define GSP_PHYS_RMCALL_CTRL_PERF_BOOST_SET_2X 0x20800a9au #define GSP_PHYS_RMCALL_CTRL_GR_SET_CTXSW_PREEMPTION_MODE 0x20801210u #define GSP_PHYS_RMCALL_CTRL_DEVICE_SCHED 0x00802009u /* @@ -13205,6 +13207,61 @@ static int gsp_phys_rmcall_user_lane_lane_enable(void __iomem *bar0) pr_info("vgsp-boot: rm-call: mode 35 lane enable #1063 device sched: enable=%u hDevice=0x%x status=0x%x rpc_result=0x%x ret=%d\n", le32_to_cpu(ds.enable), boot_stage.rmcall_device, status, rpc_result, ret); + if (ret) + return ret; + + /* + * R2 #1073/#1075/#1077 lane tail (gsp_phys_rmcall_gr_lane_tail; + * default 0): the real client explicitly PREEMPTS its own TSG with + * bWait=1 right after the lane-enable controls, then disables device + * scheduling and posts a perf-boost control. The preempt makes the + * RM drive a clean context save/switch-out at ctx-creation time, so + * the first dispatch performs a normal load. Without it our context + * sits loaded from the ladder and the task activation ends in a + * confused save/unload instead of execution. + */ + if (!gsp_phys_rmcall_gr_lane_tail_value()) + return ret; + { + u32 pre[2] = { 1u, 0u }; /* bWait=1, bManualTimeout=0 */ + + rpc_result = 0; + status = 0; + ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_tsg, + GSP_PHYS_RMCALL_CTRL_TSG_PREEMPT, + pre, sizeof(pre), sizeof(pre), NULL, 0, + &rpc_result, &status, + "TSG PREEMPT bWait=1 (mode 35 lane tail, R2 #1073)"); + pr_info("vgsp-boot: rm-call: mode 35 lane tail #1073 TSG PREEMPT: bWait=%u hTsg=0x%x status=0x%x rpc_result=0x%x ret=%d\n", + pre[0], boot_stage.rmcall_tsg, status, rpc_result, ret); + if (ret) + return ret; + } + memset(&ds, 0, sizeof(ds)); + ds.enable = cpu_to_le32(0); + ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_device, + GSP_PHYS_RMCALL_CTRL_DEVICE_SCHED, + &ds, sizeof(ds), 16, NULL, 0, &rpc_result, &status, + "NV01 device sched disable (mode 35 lane tail, R2 #1075)"); + pr_info("vgsp-boot: rm-call: mode 35 lane tail #1075 device sched: enable=%u hDevice=0x%x status=0x%x rpc_result=0x%x ret=%d\n", + le32_to_cpu(ds.enable), boot_stage.rmcall_device, + status, rpc_result, ret); + if (ret) + return ret; + { + u32 pb[2] = { 0x10u, 0u }; + + rpc_result = 0; + status = 0; + ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_subdevice, + GSP_PHYS_RMCALL_CTRL_PERF_BOOST_SET_2X, + pb, sizeof(pb), sizeof(pb), NULL, 0, + &rpc_result, &status, + "PERF_BOOST_SET_2X 0x10 (mode 35 lane tail, R2 #1077)"); + pr_info("vgsp-boot: rm-call: mode 35 lane tail #1077 PERF_BOOST_SET_2X: v=0x%x hSubdevice=0x%x status=0x%x rpc_result=0x%x ret=%d\n", + pb[0], boot_stage.rmcall_subdevice, status, + rpc_result, ret); + } return ret; } |
