summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-05-14 11:33:08 -0700
committerEric Anholt <eric@anholt.net>2015-06-04 14:15:35 -0700
commit660b630f8de24d4c73f5f2982b65ed2537735c1d (patch)
tree766dd3a97d0ab505af92796d756221500e7113c5
parenteb4fdfd674ab976fed764b6c606c9963c183906a (diff)
downloadlinux-660b630f8de24d4c73f5f2982b65ed2537735c1d.tar.gz
drm/vc4: Don't forget to lock around BO creation in the overflow work.
The overflow handler notably walks through our BO cache structs, which are protected by this lock. Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/vc4/vc4_irq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c
index 5af0e6ff5318..c2f539c3b6c6 100644
--- a/drivers/gpu/drm/vc4/vc4_irq.c
+++ b/drivers/gpu/drm/vc4/vc4_irq.c
@@ -37,7 +37,9 @@ vc4_overflow_mem_work(struct work_struct *work)
struct drm_device *dev = vc4->dev;
struct vc4_bo *bo;
+ mutex_lock(&dev->struct_mutex);
bo = vc4_bo_create(dev, 256 * 1024);
+ mutex_unlock(&dev->struct_mutex);
if (!bo) {
DRM_ERROR("Couldn't allocate binner overflow mem\n");
return;