Skip to contentSkip to conversation

drm/tegra: fix locking of SET_TILING ioctl

PATCH Superseded Alexandre Courbot 3 participants 3 messages Nov 12, 2015 – Nov 19, 2015

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/tegra: fix locking of SET_TILING ioctl

drm_gem_object_unreference() now expects obj->dev->struct_mutex to be held. Use the newly-introduced drm_gem_object_unreference_unlocked() which handles locking for us.

If we don't do this drm_gem_object_unreference() will get noisy about struct_mutex not being held every time we call the SET_TILING ioctl.

---
 drivers/gpu/drm/tegra/drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/drm.c +1 -1
index cc48334ef164..c0ae89865958 100644
@@ -683,7 +683,7 @@ static int tegra_gem_set_tiling(struct drm_device *drm, void *data,
 	bo->tiling.mode = mode;
 	bo->tiling.value = value;
 
-	drm_gem_object_unreference(gem);
+	drm_gem_object_unreference_unlocked(gem);
 
 	return 0;
 }
Signature · 6 lines
2.6.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Alexandre Courbot

drm_gem_object_unreference() now expects obj->dev->struct_mutex to be held. Use the newly-introduced drm_gem_object_unreference_unlocked() which handles locking for us.

This rule has been really old, I simply made the checking more anal in

commit ef4c6270bf2867e2f8032e9614d1a8cfc6c71663

Author: Daniel Vetter <daniel.vetter-/[email protected]>
Date:   Thu Oct 15 09:36:25 2015 +0200

drm/gem: Check locking in drm_gem_object_unreference

With the above added this is:

Quoted 29 lines

If we don't do this drm_gem_object_unreference() will get noisy about struct_mutex not being held every time we call the SET_TILING ioctl.

---
 drivers/gpu/drm/tegra/drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/drm.c +1 -1
index cc48334ef164..c0ae89865958 100644
@@ -683,7 +683,7 @@ static int tegra_gem_set_tiling(struct drm_device *drm, void *data,
 	bo->tiling.mode = mode;
 	bo->tiling.value = value;
 
-	drm_gem_object_unreference(gem);
+	drm_gem_object_unreference_unlocked(gem);
 
 	return 0;
 }
Signature · 6 lines
2.6.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#2 lore raw
Quoted 8 lines · Daniel Vetter
Quoted 3 lines · Alexandre Courbot

drm_gem_object_unreference() now expects obj->dev->struct_mutex to be held. Use the newly-introduced drm_gem_object_unreference_unlocked() which handles locking for us.

This rule has been really old, I simply made the checking more anal in

commit ef4c6270bf2867e2f8032e9614d1a8cfc6c71663

Quoted 8 lines
Author: Daniel Vetter <[email protected]>
Date:   Thu Oct 15 09:36:25 2015 +0200

drm/gem: Check locking in drm_gem_object_unreference

With the above added this is:

Thanks! Sending an updated version.