diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2009-03-02 11:10:56 +0100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2009-03-03 09:50:20 +1000 |
commit | fda714c29cdf360464059044b221450decb4b913 (patch) | |
tree | dc985f3c861d9490a1b5ffe82583497b6fe64236 /drivers/gpu/drm/drm_lock.c | |
parent | 171901d15deeef61aa8e1b0d0772404f39691b73 (diff) | |
download | linux-3.10-fda714c29cdf360464059044b221450decb4b913.tar.gz linux-3.10-fda714c29cdf360464059044b221450decb4b913.tar.bz2 linux-3.10-fda714c29cdf360464059044b221450decb4b913.zip |
drm: Avoid client deadlocks when the master disappears.
This is done by
1) Wake up lock waiters when we close the master file descriptor.
Not when the master structure is removed, since the latter
requires the waiters themselves to release the refcount on the
master structure -> Deadlock.
2) Send a SIGTERM to all clients waiting for the lock.
Normally these clients will get a SIGPIPE when the X server dies,
but clients may also spin trying to grab the DRM lock, without
getting any sort of notification.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/drm_lock.c')
-rw-r--r-- | drivers/gpu/drm/drm_lock.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index b03586fdabb..e2f70a516c3 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c @@ -80,6 +80,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) __set_current_state(TASK_INTERRUPTIBLE); if (!master->lock.hw_lock) { /* Device has been unregistered */ + send_sig(SIGTERM, current, 0); ret = -EINTR; break; } |