Zhi Wang
2025-Feb-07 17:58 UTC
[PATCH 3/5] drm/nouveau/nvkm: introduce new GSP reply policy NVKM_GSP_RPC_REPLY_POLL
There can be multiple cases of handling the GSP RPC messages, which
are the reply of GSP RPC commands according to the requirement of the
callers and the nature of the GSP RPC commands.
Some GSP RPC command needs 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.
Introduce new reply policy NVKM_GSP_RPC_REPLY_POLL, which waits for the
returned GSP message but discards it for the caller.
No functional change is intended.
Signed-off-by: Zhi Wang <zhiw at nvidia.com>
---
drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h | 1 +
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
index c467e44cab47..bc16510261b8 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
@@ -33,6 +33,7 @@ typedef void (*nvkm_gsp_event_func)(struct nvkm_gsp_event *,
void *repv, u32 rep
enum {
NVKM_GSP_RPC_REPLY_RECV = 1,
+ NVKM_GSP_RPC_REPLY_POLL,
};
struct nvkm_gsp {
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
index bc8eb9a3cb28..af2836cca38f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
@@ -601,6 +601,9 @@ r535_gsp_rpc_handle_reply(struct nvkm_gsp *gsp, u32 fn, int
reply,
else
repv = msg;
break;
+ case NVKM_GSP_RPC_REPLY_POLL:
+ repv = r535_gsp_msg_recv(gsp, fn, 0);
+ break;
default:
repv = ERR_PTR(-EINVAL);
break;
--
2.43.5
Alexandre Courbot
2025-Feb-12 06:57 UTC
[PATCH 3/5] drm/nouveau/nvkm: introduce new GSP reply policy NVKM_GSP_RPC_REPLY_POLL
On Sat Feb 8, 2025 at 2:58 AM JST, Zhi Wang wrote:> There can be multiple cases of handling the GSP RPC messages, which > are the reply of GSP RPC commands according to the requirement of the > callers and the nature of the GSP RPC commands. > > Some GSP RPC command needs 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. > > Introduce new reply policy NVKM_GSP_RPC_REPLY_POLL, which waits for the > returned GSP message but discards it for the caller. > > No functional change is intended. > > Signed-off-by: Zhi Wang <zhiw at nvidia.com> > --- > drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h | 1 + > drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 3 +++ > 2 files changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h > index c467e44cab47..bc16510261b8 100644 > --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h > +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h > @@ -33,6 +33,7 @@ typedef void (*nvkm_gsp_event_func)(struct nvkm_gsp_event *, void *repv, u32 rep > > enum { > NVKM_GSP_RPC_REPLY_RECV = 1, > + NVKM_GSP_RPC_REPLY_POLL, > }; > > struct nvkm_gsp { > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c > index bc8eb9a3cb28..af2836cca38f 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c > @@ -601,6 +601,9 @@ r535_gsp_rpc_handle_reply(struct nvkm_gsp *gsp, u32 fn, int reply, > else > repv = msg; > break; > + case NVKM_GSP_RPC_REPLY_POLL: > + repv = r535_gsp_msg_recv(gsp, fn, 0); > + break; > default: > repv = ERR_PTR(-EINVAL); > break;I suspect patch 4 can be merged into this one, so we introduce the user at the same time as the functionality.