Skip to contentSkip to conversation

nouveau/gsp: add three notifier callbacks that we see in normal operation

PATCH In review Dave Airlie 2 participants 4 messages Dec 4, 2023 – Dec 5, 2023

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 nouveau/gsp: add three notifier callbacks that we see in normal operation

These seem to get called, but it doesn't look like we have to care too much at this point.

---
 .../gpu/drm/nouveau/nvkm/subdev/gsp/r535.c    | 24 ++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c +23 -1
index f6725a5f5bfb..8b368df2e798 100644
@@ -1505,6 +1505,26 @@ r535_gsp_msg_run_cpu_sequencer(void *priv, u32 fn, void *repv, u32 repc)
 	return 0;
 }
 
+static int
+r535_gsp_msg_perf_bridgeless_info_update(void *priv, u32 fn, void *repv, u32 repc)
+{
+	return 0;
+}
+
+static int
+r535_gsp_msg_ucode_libos_print(void *priv, u32 fn, void *repv, u32 repc)
+{
+	/* work out what we should do here. */
+	return 0;
+}
+
+static int
+r535_gsp_msg_gsp_send_user_shared_data(void *priv, u32 fn, void *repv, u32 repc)
+{
+	/* this seems to send some sort of assert counts from gsp */
+	return 0;
+}
+
 static void
 nvkm_gsp_mem_dtor(struct nvkm_gsp *gsp, struct nvkm_gsp_mem *mem)
 {
@@ -2104,7 +2124,9 @@ r535_gsp_oneinit(struct nvkm_gsp *gsp)
 	r535_gsp_msg_ntfy_add(gsp, NV_VGPU_MSG_EVENT_MMU_FAULT_QUEUED,
 			      r535_gsp_msg_mmu_fault_queued, gsp);
 	r535_gsp_msg_ntfy_add(gsp, NV_VGPU_MSG_EVENT_OS_ERROR_LOG, r535_gsp_msg_os_error_log, gsp);
-
+	r535_gsp_msg_ntfy_add(gsp, NV_VGPU_MSG_EVENT_PERF_BRIDGELESS_INFO_UPDATE, r535_gsp_msg_perf_bridgeless_info_update, gsp);
+	r535_gsp_msg_ntfy_add(gsp, NV_VGPU_MSG_EVENT_UCODE_LIBOS_PRINT, r535_gsp_msg_ucode_libos_print, gsp);
+	r535_gsp_msg_ntfy_add(gsp, NV_VGPU_MSG_EVENT_GSP_SEND_USER_SHARED_DATA, r535_gsp_msg_gsp_send_user_shared_data, gsp);
 	ret = r535_gsp_rm_boot_ctor(gsp);
 	if (ret)
 		return ret;
Signature · 1 line
2.43.0
#1 lore raw

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c r535_gsp_msg_run_cpu_sequencer(void *priv, u32 fn, void *repv, u32 repc) · line 1519

Quoted 6 lines · Dave Airlie
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c +6 -0
+static int
+r535_gsp_msg_ucode_libos_print(void *priv, u32 fn, void *repv, u32 repc)
+{
+       /* work out what we should do here. */
+       return 0;
+}

This is part of my logrm debugfs patch.  It contains the printf log from a PMU exception.

Do you want me to research the other two RPCs and tell you exactly what they do?

But if you're not planning on actually doing anything with these RPCs, why add callbacks?  Doesn't the driver already ignore RPCs it doesn't recognize?

author maintainer
#2 lore raw
Quoted 12 lines · Timur Tabi

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c r535_gsp_msg_run_cpu_sequencer(void *priv, u32 fn, void *repv, u32 repc) · line 1519

Quoted 6 lines · Dave Airlie
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c +6 -0
+static int
+r535_gsp_msg_ucode_libos_print(void *priv, u32 fn, void *repv, u32 repc)
+{
+       /* work out what we should do here. */
+       return 0;
+}

This is part of my logrm debugfs patch. It contains the printf log from a PMU exception.

Quoted 5 lines

Do you want me to research the other two RPCs and tell you exactly what they do?

But if you're not planning on actually doing anything with these RPCs, why add callbacks? Doesn't the driver already ignore RPCs it doesn't recognize?

The current code prints a message when we get a callback we don't handle, this silences those, but maybe I should just silence them.

Dave.

#3 lore raw
Quoted 2 lines · Dave Airlie

The current code prints a message when we get a callback we don't handle, this silences those, but maybe I should just silence them.

How about this:

In r535_gsp_msg_recv():

if (ntfy->fn && (ntfy->fn == msg->function)) {
	ntfy->func(ntfy->priv, ntfy->fn, msg->data, msg->length -
sizeof(*msg));
	break;
}

and then in r535_gsp_oneinit():

r535_gsp_msg_ntfy_add(gsp, NV_VGPU_MSG_EVENT_PERF_BRIDGELESS_INFO_UPDATE, NULL, NULL);
...