summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/gsp_phys_booter.c66
1 files changed, 40 insertions, 26 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 6c415ec..14cec7c 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -9835,12 +9835,13 @@ static void gsp_phys_rmcall_gr_fwclient_small_prepare(void)
* retry and never a partial accept followed by another promote.
*/
static int gsp_phys_rmcall_golden9_promote_on(void __iomem *bar0,
- u32 h_channel)
+ u32 h_channel, bool skip_fecs)
{
struct gsp_phys_rmcall_promote_params *p;
u32 attr = GSP_PHYS_RMCALL_GR_CTX_PHYS_ATTR;
u32 fattr;
u32 rpc_result = 0, status = 0;
+ u32 entry_count = 0;
unsigned int i;
int ret;
@@ -9858,10 +9859,11 @@ static int gsp_phys_rmcall_golden9_promote_on(void __iomem *bar0,
ret = gsp_phys_rmcall_golden9_fb_aux_prepare(bar0);
if (ret)
return ret;
- if (!boot_stage.rmcall_patch_pa || !boot_stage.rmcall_fecs_pa ||
+ if (!boot_stage.rmcall_patch_pa ||
+ (!skip_fecs && !boot_stage.rmcall_fecs_pa) ||
!boot_stage.rmcall_priv_pa ||
!boot_stage.rmcall_unrestricted_pa) {
- pr_err("vgsp-boot: rm-call: GOLDEN9 promote aborted: patch=0x%llx fecs=0x%llx priv=0x%llx unr=0x%llx (all nine buffers must be present); no promote is sent and the ladder aborts with no retry\n",
+ pr_err("vgsp-boot: rm-call: GOLDEN9 promote aborted: patch=0x%llx fecs=0x%llx priv=0x%llx unr=0x%llx (all required buffers must be present); no promote is sent and the ladder aborts with no retry\n",
boot_stage.rmcall_patch_pa, boot_stage.rmcall_fecs_pa,
boot_stage.rmcall_priv_pa,
boot_stage.rmcall_unrestricted_pa);
@@ -9879,44 +9881,56 @@ static int gsp_phys_rmcall_golden9_promote_on(void __iomem *bar0,
p->ch_id = cpu_to_le32(0);
p->h_chan_client = cpu_to_le32(boot_stage.rmcall_client);
p->h_object = cpu_to_le32(h_channel);
- p->entry_count = cpu_to_le32(9);
- gsp_phys_rmcall_promote_entry_fill(p, 0,
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_MAIN,
boot_stage.rmcall_ctx_pa, boot_stage.rmcall_ctx_va,
boot_stage.rmcall_ctx_size,
boot_stage.rmcall_ctx_fbmem ?
GSP_PHYS_RMCALL_GR_CTX_PHYS_ATTR_FB : attr, 1, 0);
- gsp_phys_rmcall_promote_entry_fill(p, 1,
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_PATCH,
boot_stage.rmcall_patch_pa, GSP_PHYS_RMCALL_VA_GR_PATCH,
boot_stage.rmcall_patch_size, fattr, 1, 0);
- gsp_phys_rmcall_promote_entry_fill(p, 2,
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_BUNDLE_CB,
0, GSP_PHYS_RMCALL_VA_GOLDEN9_BUNDLE_CB, 0, 0, 0, 0);
- gsp_phys_rmcall_promote_entry_fill(p, 3,
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_PAGEPOOL,
0, GSP_PHYS_RMCALL_VA_GOLDEN9_PAGEPOOL, 0, 0, 0, 0);
- gsp_phys_rmcall_promote_entry_fill(p, 4,
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_ATTRIBUTE_CB,
0, GSP_PHYS_RMCALL_VA_GOLDEN9_ATTRIBUTE_CB, 0, 0, 0, 0);
- gsp_phys_rmcall_promote_entry_fill(p, 5,
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_RTV_CB_GLOBAL,
0, GSP_PHYS_RMCALL_VA_GOLDEN9_RTV_CB_GLOBAL, 0, 0, 0, 0);
- gsp_phys_rmcall_promote_entry_fill(p, 6,
- GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_FECS_EVENT,
- boot_stage.rmcall_fecs_pa, GSP_PHYS_RMCALL_VA_GOLDEN9_FECS,
- boot_stage.rmcall_fecs_size, fattr, 1, 0);
- gsp_phys_rmcall_promote_entry_fill(p, 7,
+ /*
+ * Mode 31 sibling A: skip the FECS_EVENT entry. The shared global
+ * FECS ctx-buffer slot is a one-shot per (GPU, gfid) and the D golden
+ * replay's promote already initialized it earlier in the same cycle;
+ * an atomic set containing it again is refused whole-control with
+ * 0x1f (PART 95 / simulator valprobe), which is exactly the m30 A
+ * promote failure. A only carries the TSG group commit, which the
+ * MAIN/PATCH entries drive.
+ */
+ if (!skip_fecs)
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
+ GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_FECS_EVENT,
+ boot_stage.rmcall_fecs_pa,
+ GSP_PHYS_RMCALL_VA_GOLDEN9_FECS,
+ boot_stage.rmcall_fecs_size, fattr, 1, 0);
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_PRIV_MAP,
boot_stage.rmcall_priv_pa, GSP_PHYS_RMCALL_VA_GOLDEN9_PRIV,
boot_stage.rmcall_priv_size, fattr, 1, 0);
- gsp_phys_rmcall_promote_entry_fill(p, 8,
+ gsp_phys_rmcall_promote_entry_fill(p, entry_count++,
GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_UNR_PRIV_MAP,
boot_stage.rmcall_unrestricted_pa, GSP_PHYS_RMCALL_VA_GOLDEN9_UNR,
boot_stage.rmcall_unr_size, fattr, 1, 0);
- for (i = 0; i < 9; i++)
+ p->entry_count = cpu_to_le32(entry_count);
+
+ for (i = 0; i < entry_count; i++)
pr_info("vgsp-boot: rm-call: PROMOTE_CTX golden9 entry[%u]: bufferId=%u pa=0x%llx va=0x%llx size=0x%llx physAttr=0x%x bInitialize=%u bNonmapped=%u%s\n",
i, le16_to_cpu(p->entry[i].buffer_id),
le64_to_cpu(p->entry[i].gpu_phys_addr),
@@ -9930,16 +9944,16 @@ static int gsp_phys_rmcall_golden9_promote_on(void __iomem *bar0,
ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_subdevice,
GSP_PHYS_RMCALL_CTRL_GPU_PROMOTE_CTX,
p, sizeof(*p), 24, NULL, 0, &rpc_result, &status,
- "GPU_PROMOTE_CTX (golden9, 9 entries, atomic)");
- pr_info("vgsp-boot: rm-call: PROMOTE_CTX golden9: entryCount=9 status=0x%x rpc_result=0x%x (hObject=0x%x hChanClient=0x%x engineType=0x%x MAIN pa=0x%llx va=0x%llx size=0x%x; gr_promote_param=%u)\n",
- status, rpc_result, h_channel,
+ "GPU_PROMOTE_CTX (golden9, atomic)");
+ pr_info("vgsp-boot: rm-call: PROMOTE_CTX golden9: entryCount=%u status=0x%x rpc_result=0x%x (hObject=0x%x hChanClient=0x%x engineType=0x%x MAIN pa=0x%llx va=0x%llx size=0x%x; skip_fecs=%u gr_promote_param=%u)\n",
+ entry_count, status, rpc_result, h_channel,
boot_stage.rmcall_client, GSP_PHYS_RMCALL_ENGINE_GR0,
boot_stage.rmcall_ctx_pa, boot_stage.rmcall_ctx_va,
- boot_stage.rmcall_ctx_size,
+ boot_stage.rmcall_ctx_size, skip_fecs,
GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN9);
if (ret) {
- pr_err("vgsp-boot: rm-call: PROMOTE_CTX golden9 (9 entries) failed (status=0x%x rpc_result=0x%x, %s, ret=%d); the golden context is not committed and the ladder aborts with no retry and no follow-up promote\n",
- status, rpc_result,
+ pr_err("vgsp-boot: rm-call: PROMOTE_CTX golden9 (%u entries) failed (status=0x%x rpc_result=0x%x, %s, ret=%d); the golden context is not committed and the ladder aborts with no retry and no follow-up promote\n",
+ entry_count, status, rpc_result,
gsp_phys_rmcall_status_str(status), ret);
kvfree(p);
return ret;
@@ -9952,7 +9966,7 @@ static int gsp_phys_rmcall_golden9_promote_on(void __iomem *bar0,
static int gsp_phys_rmcall_golden9_promote(void __iomem *bar0)
{
return gsp_phys_rmcall_golden9_promote_on(bar0,
- GSP_PHYS_RMCALL_HANDLE_GOLDEN_CHANNEL);
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CHANNEL, false);
}
/*
@@ -9998,7 +10012,7 @@ static int gsp_phys_rmcall_golden_sibling_alloc(void __iomem *bar0)
return ret;
gsp_phys_rmcall_ctx_diag_decode("post-V6-constructs pre-A-commit");
ret = gsp_phys_rmcall_golden9_promote_on(bar0,
- GSP_PHYS_RMCALL_HANDLE_GOLDEN_SIBLING);
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_SIBLING, true);
if (ret)
return ret;
gsp_phys_rmcall_ctx_diag_dump("INSTANCE (post-A-commit pre-BIND)",
@@ -11049,7 +11063,7 @@ static int gsp_phys_rmcall_gr_ctx_promote(void __iomem *bar0)
* never processing the forwarded launch.
*/
ret = gsp_phys_rmcall_golden9_promote_on(
- bar0, boot_stage.rmcall_channel);
+ bar0, boot_stage.rmcall_channel, false);
if (ret) {
kvfree(p);
return ret;