[03/18] drm/gem: Be more friendly with locking checks
diff mbox

Message ID 1436477570-4936-4-git-send-email-daniel.vetter@ffwll.ch
State New
Headers show

Commit Message

Daniel Vetter July 9, 2015, 9:32 p.m. UTC
BUG_ON kills the driver, WARN_ON is much friendly. And usually nothing
bad happens when the locking is lightly busted.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thierry Reding Aug. 10, 2015, 10:42 a.m. UTC | #1
On Thu, Jul 09, 2015 at 11:32:35PM +0200, Daniel Vetter wrote:
> BUG_ON kills the driver, WARN_ON is much friendly. And usually nothing
> bad happens when the locking is lightly busted.

s/much friendly/much friendlier/, s/lightly/slightly/?

Otherwise:

Reviewed-by: Thierry Reding <treding@nvidia.com>
Daniel Vetter Aug. 10, 2015, 11:43 a.m. UTC | #2
On Mon, Aug 10, 2015 at 12:42:30PM +0200, Thierry Reding wrote:
> On Thu, Jul 09, 2015 at 11:32:35PM +0200, Daniel Vetter wrote:
> > BUG_ON kills the driver, WARN_ON is much friendly. And usually nothing
> > bad happens when the locking is lightly busted.
> 
> s/much friendly/much friendlier/, s/lightly/slightly/?

Yeah, changed.

> Otherwise:
> 
> Reviewed-by: Thierry Reding <treding@nvidia.com>

Thanks for your review, I've applied the patches to topic/drm-misc except
armada (needs to be split), one nouveau patch (superseeded meanwhile by
Archit's work), radeon/amdgpu (I'll ping Alex) and the two tegra ones.

Thanks, Daniel

Patch
diff mbox

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 27a4228b4343..3c2d4abd71c5 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -766,7 +766,7 @@  drm_gem_object_free(struct kref *kref)
 	struct drm_gem_object *obj = (struct drm_gem_object *) kref;
 	struct drm_device *dev = obj->dev;
 
-	BUG_ON(!mutex_is_locked(&dev->struct_mutex));
+	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
 	if (dev->driver->gem_free_object != NULL)
 		dev->driver->gem_free_object(obj);