Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/nouveau/nvkm: introduce new GSP reply policy NVKM_GSP_RPC_REPLY_POLL

Some GSP RPC commands need a new reply policy: "caller don't care about
the message content but want to make sure a reply is received". To
support this case, a new reply policy is introduced.

NV_VGPU_MSG_FUNCTION_ALLOC_MEMORY is a large GSP RPC command. The actual
required policy is NVKM_GSP_RPC_REPLY_POLL. This can be observed from the
dump of the GSP message queue. After the large GSP RPC command is issued,
GSP will write only an empty RPC header in the queue as the reply.

Without this change, the policy "receiving the entire message" is used
for NV_VGPU_MSG_FUNCTION_ALLOC_MEMORY. This causes the timeout of receiving
the returned GSP message in the suspend/resume path.

Introduce the new reply policy NVKM_GSP_RPC_REPLY_POLL, which waits for
the returned GSP message but discards it for the caller. Use the new policy
NVKM_GSP_RPC_REPLY_POLL on the GSP RPC command
NV_VGPU_MSG_FUNCTION_ALLOC_MEMORY.

Fixes: 50f290053d79 ("drm/nouveau: support handling the return of large GSP message")
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Tested-by: Ben Skeggs <bskeggs@nvidia.com>
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250227013554.8269-3-zhiw@nvidia.com

authored by

Zhi Wang and committed by
Danilo Krummrich
a738fa91 4570355f

+8 -1
+4
drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
··· 44 44 * NVKM_GSP_RPC_REPLY_RECV - If specified, wait and receive the entire GSP 45 45 * RPC message after the GSP RPC command is issued. 46 46 * 47 + * NVKM_GSP_RPC_REPLY_POLL - If specified, wait for the specific reply and 48 + * discard the reply before returning to the caller. 49 + * 47 50 */ 48 51 enum nvkm_gsp_rpc_reply_policy { 49 52 NVKM_GSP_RPC_REPLY_NOWAIT = 0, 50 53 NVKM_GSP_RPC_REPLY_RECV, 54 + NVKM_GSP_RPC_REPLY_POLL, 51 55 }; 52 56 53 57 struct nvkm_gsp {
+3
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
··· 602 602 else 603 603 repv = reply; 604 604 break; 605 + case NVKM_GSP_RPC_REPLY_POLL: 606 + repv = r535_gsp_msg_recv(gsp, fn, 0); 607 + break; 605 608 } 606 609 607 610 return repv;
+1 -1
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/r535.c
··· 105 105 rpc->pteDesc.pte_pde[i].pte = (phys >> 12) + i; 106 106 } 107 107 108 - ret = nvkm_gsp_rpc_wr(gsp, rpc, NVKM_GSP_RPC_REPLY_RECV); 108 + ret = nvkm_gsp_rpc_wr(gsp, rpc, NVKM_GSP_RPC_REPLY_POLL); 109 109 if (ret) 110 110 return ret; 111 111