fifo/nv04: avoid ramht race against cookie insertion
PATCH 1/1 fifo/nv04: avoid ramht race against cookie insertion
---
Ian Romanick reported a kernel crash that implicated this path in a null pointer jump, which means that one of the function pointers had been nulled out. Not sure if a race there would explain it, but maybe.
There is also questionable ramht usage in channv50 and various disp code. If you think this is a good idea, those should probably be fixed up as well.
drm/nouveau/nvkm/engine/fifo/dmanv04.c | 3 +++ 1 file changed, 3 insertions(+)
drm/nouveau/nvkm/engine/fifo/dmanv04.c +3 -0
@@ -37,7 +37,10 @@ nv04_fifo_dma_object_dtor(struct nvkm_fifo_chan *base, int cookie) {struct nv04_fifo_chan *chan =nv04_fifo_chan (base);struct nvkm_instmem *imem = chan->fifo->base.engine.subdev.device->imem; + +mutex_lock (&chan->fifo->base.engine.subdev.mutex);nvkm_ramht_remove (imem->ramht, cookie); +mutex_unlock (&chan->fifo->base.engine.subdev.mutex); } static int
Signature · 6 lines
2.7.3 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): 1473474842-6901-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]
Ilia Mirkin
Tested-by Ian RomanickQuoted 2 lines · Ilia Mirkin
Signed-off-by Ilia Mirkin <[email protected]>
Ian mentioned that he tested this out on IRC:
#dri-devel: <idr> imirkin: Your patch to the nouveau kernel module fixes the oops that I encountered. Consider that a Tested-by.
So you can probably throw in a
Quoted 28 lines
---
Ian Romanick reported a kernel crash that implicated this path in a null pointer jump, which means that one of the function pointers had been nulled out. Not sure if a race there would explain it, but maybe.
There is also questionable ramht usage in channv50 and various disp code. If you think this is a good idea, those should probably be fixed up as well.
drm/nouveau/nvkm/engine/fifo/dmanv04.c | 3 +++ 1 file changed, 3 insertions(+)drm/nouveau/nvkm/engine/fifo/dmanv04.c +3
-1@@ -37,7 +37,10 @@ nv04_fifo_dma_object_dtor(struct nvkm_fifo_chan *base, int cookie) {struct nv04_fifo_chan *chan =nv04_fifo_chan (base);struct nvkm_instmem *imem = chan->fifo->base.engine.subdev.device->imem; + +mutex_lock (&chan->fifo->base.engine.subdev.mutex);nvkm_ramht_remove (imem->ramht, cookie); +mutex_unlock (&chan->fifo->base.engine.subdev.mutex); } static int --
Quoted 2 lines
2.7.3
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau