Commit d53dab3a authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Dave Airlie

drm: Remove utterly bogus preempt_disable() sections

commit 27641c3f (drm/vblank: Add support for precise vblank
timestamping) adds preempt_disable()/enable() around a spin locked
section with the comments:

 * Disable preemption, so vblank_time_lock is held as short as
 * possible, even under a kernel with PREEMPT_RT patches.

/* Disable preemption while holding vblank_time_lock. Do
 * it explicitely to guard against PREEMPT_RT kernel.

Just that this has never been tested on a RT kernel which would have
granted that nonsense with a might_sleep() warning because
dev->vblank_time_lock is converted to a "sleeping" spinlock on RT.

So this is activly wrong on RT and superflous on mainline. Remove it.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarMario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent a7c36fd8
...@@ -110,10 +110,7 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc) ...@@ -110,10 +110,7 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc)
/* Prevent vblank irq processing while disabling vblank irqs, /* Prevent vblank irq processing while disabling vblank irqs,
* so no updates of timestamps or count can happen after we've * so no updates of timestamps or count can happen after we've
* disabled. Needed to prevent races in case of delayed irq's. * disabled. Needed to prevent races in case of delayed irq's.
* Disable preemption, so vblank_time_lock is held as short as
* possible, even under a kernel with PREEMPT_RT patches.
*/ */
preempt_disable();
spin_lock_irqsave(&dev->vblank_time_lock, irqflags); spin_lock_irqsave(&dev->vblank_time_lock, irqflags);
dev->driver->disable_vblank(dev, crtc); dev->driver->disable_vblank(dev, crtc);
...@@ -164,7 +161,6 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc) ...@@ -164,7 +161,6 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc)
clear_vblank_timestamps(dev, crtc); clear_vblank_timestamps(dev, crtc);
spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags);
preempt_enable();
} }
static void vblank_disable_fn(unsigned long arg) static void vblank_disable_fn(unsigned long arg)
...@@ -889,10 +885,6 @@ int drm_vblank_get(struct drm_device *dev, int crtc) ...@@ -889,10 +885,6 @@ int drm_vblank_get(struct drm_device *dev, int crtc)
spin_lock_irqsave(&dev->vbl_lock, irqflags); spin_lock_irqsave(&dev->vbl_lock, irqflags);
/* Going from 0->1 means we have to enable interrupts again */ /* Going from 0->1 means we have to enable interrupts again */
if (atomic_add_return(1, &dev->vblank_refcount[crtc]) == 1) { if (atomic_add_return(1, &dev->vblank_refcount[crtc]) == 1) {
/* Disable preemption while holding vblank_time_lock. Do
* it explicitely to guard against PREEMPT_RT kernel.
*/
preempt_disable();
spin_lock_irqsave(&dev->vblank_time_lock, irqflags2); spin_lock_irqsave(&dev->vblank_time_lock, irqflags2);
if (!dev->vblank_enabled[crtc]) { if (!dev->vblank_enabled[crtc]) {
/* Enable vblank irqs under vblank_time_lock protection. /* Enable vblank irqs under vblank_time_lock protection.
...@@ -912,7 +904,6 @@ int drm_vblank_get(struct drm_device *dev, int crtc) ...@@ -912,7 +904,6 @@ int drm_vblank_get(struct drm_device *dev, int crtc)
} }
} }
spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags2); spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags2);
preempt_enable();
} else { } else {
if (!dev->vblank_enabled[crtc]) { if (!dev->vblank_enabled[crtc]) {
atomic_dec(&dev->vblank_refcount[crtc]); atomic_dec(&dev->vblank_refcount[crtc]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment