Skip to contentSkip to conversation

drm/nouveau/fifo/ga102: initialise chid on return from channel creation

PATCH In review Ben Skeggs 2 participants 2 messages Sep 21, 2021

Subsystems (3)
lore
Share & tools
lore

Ben Skeggs

author
#0 lore raw

PATCH 1/1 drm/nouveau/fifo/ga102: initialise chid on return from channel creation

From: Ben Skeggs <[email protected]>

Turns out caller isn't zero-initialised after-all.

Fixes 6b457230bfa1 ("drm/nouveau/ga102-: support ttm buffer moves via copy engine")
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga102.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga102.c +3 -0
index f897bef13acf..c630dbd2911a 100644
@@ -179,6 +179,9 @@ ga102_chan_new(struct nvkm_device *device,
 		return -ENODEV;
 
 	chan->ctrl.chan = nvkm_rd32(device, chan->ctrl.runl + 0x004) & 0xfffffff0;
+
+	args->chid = 0;
+	args->inst = 0;
 	args->token = nvkm_rd32(device, chan->ctrl.runl + 0x008) & 0xffff0000;
 
 	ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST, 0x1000, 0x1000, true, &chan->mthd);
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Ben Skeggs

From: Ben Skeggs <[email protected]>

Turns out caller isn't zero-initialised after-all.

Fixes 6b457230bfa1 ("drm/nouveau/ga102-: support ttm buffer moves via copy engine")
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga102.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga102.c +3 -1
index f897bef13acf..c630dbd2911a 100644
@@ -179,6 +179,9 @@ ga102_chan_new(struct nvkm_device *device,
                return -ENODEV;
 
        chan->ctrl.chan = nvkm_rd32(device, chan->ctrl.runl + 0x004) & 0xfffffff0;
+
+       args->chid = 0;
+       args->inst = 0;
        args->token = nvkm_rd32(device, chan->ctrl.runl + 0x008) & 0xffff0000;
 
        ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST, 0x1000, 0x1000, true, &chan->mthd);
--
Quoted 2 lines

2.31.1