blob: 414d3468aaa3dd951ee2a0727b85067f83215a2b [file] [log] [blame]
From: Rob Clark <robdclark@gmail.com>
Date: Tue, 17 May 2016 15:43:35 -0400
Subject: drm/msm: use mutex_lock_interruptible for submit ioctl
commit b5b4c264df4d270819676b290cef9a11d04c35f0 upstream.
Be kinder to things that do lots of signal handling (ie. Xorg)
Signed-off-by: Rob Clark <robdclark@gmail.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -339,12 +339,14 @@ int msm_ioctl_gem_submit(struct drm_devi
if (args->nr_cmds > MAX_CMDS)
return -EINVAL;
- mutex_lock(&dev->struct_mutex);
+ ret = mutex_lock_interruptible(&dev->struct_mutex);
+ if (ret)
+ return ret;
submit = submit_create(dev, gpu, args->nr_bos);
if (!submit) {
ret = -ENOMEM;
- goto out;
+ goto out_unlock;
}
ret = submit_lookup_objects(submit, args, file);
@@ -422,6 +424,7 @@ int msm_ioctl_gem_submit(struct drm_devi
out:
if (submit)
submit_cleanup(submit, !!ret);
+out_unlock:
mutex_unlock(&dev->struct_mutex);
return ret;
}