nouveau/gsp: use correct size for registry rpc.
authorDave Airlie <airlied@redhat.com>
Tue, 30 Jan 2024 03:26:43 +0000 (13:26 +1000)
committerDanilo Krummrich <dakr@redhat.com>
Mon, 5 Feb 2024 16:36:48 +0000 (17:36 +0100)
Timur pointed this out before, and it just slipped my mind,
but this might help some things work better, around pcie power
management.

Cc: <stable@vger.kernel.org> # v6.7
Fixes: 8d55b0a940bb ("nouveau/gsp: add some basic registry entries.")
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240130032643.2498315-1-airlied@gmail.com
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c

index 9ee58e2a0eb2ad99c198ea7a58e6e1cf02a667d0..5e1fa176aac4a4b9e33562236b8b93889dae58ac 100644 (file)
@@ -1078,7 +1078,6 @@ r535_gsp_rpc_set_registry(struct nvkm_gsp *gsp)
        if (IS_ERR(rpc))
                return PTR_ERR(rpc);
 
-       rpc->size = sizeof(*rpc);
        rpc->numEntries = NV_GSP_REG_NUM_ENTRIES;
 
        str_offset = offsetof(typeof(*rpc), entries[NV_GSP_REG_NUM_ENTRIES]);
@@ -1094,6 +1093,7 @@ r535_gsp_rpc_set_registry(struct nvkm_gsp *gsp)
                strings += name_len;
                str_offset += name_len;
        }
+       rpc->size = str_offset;
 
        return nvkm_gsp_rpc_wr(gsp, rpc, false);
 }