aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_info.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-04-26 19:29:41 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-04-27 10:16:17 +0200
commit1d2ac403ae3bfde7c50328ee0d39d3fb3d8d9823 (patch)
treeebdb7a84d3399feeb2e06b855f5ee04550101ea4 /drivers/gpu/drm/drm_info.c
parentdrm: Make drm_vm_open/close_locked private to drm_vm.c (diff)
downloadlinux-dev-1d2ac403ae3bfde7c50328ee0d39d3fb3d8d9823.tar.xz
linux-dev-1d2ac403ae3bfde7c50328ee0d39d3fb3d8d9823.zip
drm: Protect dev->filelist with its own mutex
amdgpu gained dev->struct_mutex usage, and that's because it's walking the dev->filelist list. Protect that list with it's own lock to take one more step towards getting rid of struct_mutex usage in drivers once and for all. While doing the conversion I noticed that 2 debugfs files in i915 completely lacked appropriate locking. Fix that up too. v2: don't forget to switch to drm_gem_object_unreference_unlocked. Cc: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-9-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_info.c')
-rw-r--r--drivers/gpu/drm/drm_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
index cbb4fc0fc969..5d469b2f26f4 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -174,7 +174,7 @@ int drm_clients_info(struct seq_file *m, void *data)
/* dev->filelist is sorted youngest first, but we want to present
* oldest first (i.e. kernel, servers, clients), so walk backwardss.
*/
- mutex_lock(&dev->struct_mutex);
+ mutex_lock(&dev->filelist_mutex);
list_for_each_entry_reverse(priv, &dev->filelist, lhead) {
struct task_struct *task;
@@ -190,7 +190,7 @@ int drm_clients_info(struct seq_file *m, void *data)
priv->magic);
rcu_read_unlock();
}
- mutex_unlock(&dev->struct_mutex);
+ mutex_unlock(&dev->filelist_mutex);
return 0;
}