summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2016-09-09 22:34:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-07 15:21:17 +0200
commitb5a7c19d4a86b3c1db1810289c7a0beae26383b5 (patch)
treefe0b586d891bda67efad0a72039b2b22ac34f48b /drivers/gpu
parent6eb34f668e471583ea00b0afd24f90b56fcf60b8 (diff)
downloadlinux-stable-b5a7c19d4a86b3c1db1810289c7a0beae26383b5.tar.gz
linux-stable-b5a7c19d4a86b3c1db1810289c7a0beae26383b5.tar.bz2
linux-stable-b5a7c19d4a86b3c1db1810289c7a0beae26383b5.zip
drm/nouveau/fifo/nv04: avoid ramht race against cookie insertion
commit 666ca3d8f19082f40745d75f3cc7cc0200ee87e3 upstream. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/dmanv04.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/dmanv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/dmanv04.c
index edec30fd3ecd..0a7b6ed5ed28 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/dmanv04.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/dmanv04.c
@@ -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