Skip to contentSkip to conversation

drm/i915: correct lock type in destroy

PATCH In review Ben Widawsky 3 participants 3 messages Jan 23, 2012 – Jan 26, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: correct lock type in destroy

This is only relevant when using module unloading, and really only helps get rid of a probably benign warning.

I can't remember if I sent this out already, but it's not turning up in any of my searches.

---
 drivers/gpu/drm/i915/i915_irq.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +3 -2
index 65ee789..d71c0a5 100644
@@ -1016,11 +1016,12 @@ void i915_destroy_error_state(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_i915_error_state *error;
+	unsigned long flags;
 
-	spin_lock(&dev_priv->error_lock);
+	spin_lock_irqsave(&dev_priv->error_lock, flags);
 	error = dev_priv->first_error;
 	dev_priv->first_error = NULL;
-	spin_unlock(&dev_priv->error_lock);
+	spin_unlock_irqrestore(&dev_priv->error_lock, flags);
 
 	if (error)
 		i915_error_state_free(dev, error);
Signature · 1 line
1.7.7.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Ben Widawsky

This is only relevant when using module unloading, and really only helps get rid of a probably benign warning.

I can't remember if I sent this out already, but it's not turning up in any of my searches.

I haven't seen it before. I reviewed all of our other spinlocks and it looks like this is the only error of this kind (using a spinlock in both irq and non-irq versions).

I'll pull this into -fixes

Signature · 1 line
[email protected]

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Ben Widawsky
Quoted 7 lines · Ben Widawsky

This is only relevant when using module unloading, and really only helps get rid of a probably benign warning.

I can't remember if I sent this out already, but it's not turning up in any of my searches.

Only developers use module unload anyway, and we shouldn't have anything left running that might take this look from irq context. So queued for -next, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48