summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-07 10:44:20 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-07 10:44:20 -0400
commit2520bdb490398c1190d53fbd700ecba178fe8bb9 (patch)
tree64e41678e6174624182c69fb8134dc16e796dd8e /kernel/gsp_phys_booter.c
parentbfbe85f50f5243e601d98fe40b43e364c3e8901f (diff)
downloadopen-iov-2520bdb490398c1190d53fbd700ecba178fe8bb9.tar.gz
open-iov-2520bdb490398c1190d53fbd700ecba178fe8bb9.zip
vgsp: m78 - lane-enable skip mask + best-effort lane tail (#1063 no longer aborts it)
gsp_phys_rmcall_gr_lane_skip: bit0 skips #1059 CILP mode, bit1 skips #1061 timeslice, bit2 skips #1063 device-sched. Used to bisect which lane-enable control arms the forwarded QMD enqueue and which one leaves the scheduling state that ends in the dispatch-time context save. Also makes the m76 lane tail independent of #1063 (always refused 0x1f by the server).
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c79
1 files changed, 52 insertions, 27 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index b8de6c3..241fe04 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -13168,6 +13168,7 @@ static int gsp_phys_rmcall_user_lane_lane_enable(void __iomem *bar0)
struct gsp_phys_rmcall_preemption_params pp;
struct gsp_phys_rmcall_timeslice_params ts;
struct gsp_phys_rmcall_device_sched_params ds;
+ u32 skip = (u32)gsp_phys_rmcall_gr_lane_skip_value();
u32 rpc_result = 0, status = 0;
int ret;
@@ -13176,39 +13177,63 @@ static int gsp_phys_rmcall_user_lane_lane_enable(void __iomem *bar0)
pp.h_channel_group = cpu_to_le32(boot_stage.rmcall_tsg);
pp.cilp_ctxsw_preempt_mode =
cpu_to_le32(GSP_PHYS_RMCALL_PREEMPT_MODE_CILP);
- ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_subdevice,
- GSP_PHYS_RMCALL_CTRL_GR_SET_CTXSW_PREEMPTION_MODE,
- &pp, sizeof(pp), 16, NULL, 0, &rpc_result, &status,
- "GR_SET_CTXSW_PREEMPTION_MODE (mode 35 lane enable, R2 #1059)");
- pr_info("vgsp-boot: rm-call: mode 35 lane enable #1059 GR_SET_CTXSW_PREEMPTION_MODE: flags=0x%x hChannelGroup=0x%x cilp=%u status=0x%x rpc_result=0x%x ret=%d\n",
- le32_to_cpu(pp.flags), le32_to_cpu(pp.h_channel_group),
- le32_to_cpu(pp.cilp_ctxsw_preempt_mode), status, rpc_result, ret);
- if (ret)
- return ret;
+ if (skip & 1u) {
+ pr_info("vgsp-boot: rm-call: mode 35 lane enable #1059 GR_SET_CTXSW_PREEMPTION_MODE SKIPPED by gsp_phys_rmcall_gr_lane_skip=0x%x\n",
+ skip);
+ } else {
+ ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_subdevice,
+ GSP_PHYS_RMCALL_CTRL_GR_SET_CTXSW_PREEMPTION_MODE,
+ &pp, sizeof(pp), 16, NULL, 0, &rpc_result,
+ &status,
+ "GR_SET_CTXSW_PREEMPTION_MODE (mode 35 lane enable, R2 #1059)");
+ pr_info("vgsp-boot: rm-call: mode 35 lane enable #1059 GR_SET_CTXSW_PREEMPTION_MODE: flags=0x%x hChannelGroup=0x%x cilp=%u status=0x%x rpc_result=0x%x ret=%d\n",
+ le32_to_cpu(pp.flags),
+ le32_to_cpu(pp.h_channel_group),
+ le32_to_cpu(pp.cilp_ctxsw_preempt_mode), status,
+ rpc_result, ret);
+ if (ret)
+ return ret;
+ }
memset(&ts, 0, sizeof(ts));
ts.timeslice = cpu_to_le32(GSP_PHYS_RMCALL_LANE_TIMESLICE);
- ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_tsg,
- GSP_PHYS_RMCALL_CTRL_SET_TIMESLICE,
- &ts, sizeof(ts), 16, NULL, 0, &rpc_result, &status,
- "SET_TIMESLICE (mode 35 lane enable, R2 #1061)");
- pr_info("vgsp-boot: rm-call: mode 35 lane enable #1061 SET_TIMESLICE: timeslice=0x%x hTsg=0x%x status=0x%x rpc_result=0x%x ret=%d\n",
- le32_to_cpu(ts.timeslice), boot_stage.rmcall_tsg,
- status, rpc_result, ret);
- if (ret)
- return ret;
+ if (skip & 2u) {
+ pr_info("vgsp-boot: rm-call: mode 35 lane enable #1061 SET_TIMESLICE SKIPPED by gsp_phys_rmcall_gr_lane_skip=0x%x\n",
+ skip);
+ } else {
+ ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_tsg,
+ GSP_PHYS_RMCALL_CTRL_SET_TIMESLICE,
+ &ts, sizeof(ts), 16, NULL, 0, &rpc_result,
+ &status,
+ "SET_TIMESLICE (mode 35 lane enable, R2 #1061)");
+ pr_info("vgsp-boot: rm-call: mode 35 lane enable #1061 SET_TIMESLICE: timeslice=0x%x hTsg=0x%x status=0x%x rpc_result=0x%x ret=%d\n",
+ le32_to_cpu(ts.timeslice), boot_stage.rmcall_tsg,
+ status, rpc_result, ret);
+ if (ret)
+ return ret;
+ }
memset(&ds, 0, sizeof(ds));
ds.enable = cpu_to_le32(1);
- 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 (mode 35 lane enable, R2 #1063)");
- 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;
+ if (skip & 4u) {
+ pr_info("vgsp-boot: rm-call: mode 35 lane enable #1063 device sched SKIPPED by gsp_phys_rmcall_gr_lane_skip=0x%x\n",
+ skip);
+ } else {
+ 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 (mode 35 lane enable, R2 #1063)");
+ 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);
+ }
+ /*
+ * #1063 is best-effort by design (the server has always refused it
+ * with 0x1f and the lane still enqueues); do not abort the tail on
+ * its failure.
+ */
+ ret = 0;
/*
* R2 #1073/#1075/#1077 lane tail (gsp_phys_rmcall_gr_lane_tail;