diff mbox series

[1/2] drm/vmwgfx: Drop preempt_disable() in vmw_fifo_ping_host()

Message ID 20200224140726.1550689-1-bigeasy@linutronix.de (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/vmwgfx: Drop preempt_disable() in vmw_fifo_ping_host() | expand

Commit Message

Sebastian Andrzej Siewior Feb. 24, 2020, 2:07 p.m. UTC
vmw_fifo_ping_host() disables preemption around a test and a register
write via vmw_write(). The write function acquires a spinlock_t typed
lock which is not allowed in a preempt_disable()ed section on
PREEMPT_RT. This has been reported in the bugzilla.

It has been explained by Thomas Hellstrom that this preempt_disable()ed
section is not required for correctness.

Remove the preempt_disable() section.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=206591
Link: https://lkml.kernel.org/r/0b5e1c65d89951de993deab06d1d197b40fd67aa.camel@vmware.com
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Thomas Hellstrom Feb. 26, 2020, 3:01 p.m. UTC | #1
On Mon, 2020-02-24 at 15:07 +0100, Sebastian Andrzej Siewior wrote:
> vmw_fifo_ping_host() disables preemption around a test and a register
> write via vmw_write(). The write function acquires a spinlock_t typed
> lock which is not allowed in a preempt_disable()ed section on
> PREEMPT_RT. This has been reported in the bugzilla.
> 
> It has been explained by Thomas Hellstrom that this
> preempt_disable()ed
> section is not required for correctness.
> 
> Remove the preempt_disable() section.
> 

Hi, Sebastian,

I suppose there isn't something like a preempt_disable_unless_RT()
macro?

If not,
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>

I'll include in the next vmwgfx-next pull request

Thanks,
Thomas
Sebastian Andrzej Siewior Feb. 27, 2020, 3:54 p.m. UTC | #2
On 2020-02-26 15:01:15 [+0000], Thomas Hellstrom wrote:
> Hi, Sebastian,
Hi Thomas,

> I suppose there isn't something like a preempt_disable_unless_RT()
> macro?

We got rid of most users of "preempt_disable_unless_RT()" since it was
used as a duct tape.
We still have it in the rt-devel tree but we have a plan for most users
and we don't intend to get it upstream.

> If not,
> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
> 
> I'll include in the next vmwgfx-next pull request

Thank you.

> Thanks,
> Thomas

Sebastian
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
index e5252ef3812f0..6941689085ed3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -169,10 +169,8 @@  void vmw_fifo_ping_host(struct vmw_private *dev_priv, uint32_t reason)
 {
 	u32 *fifo_mem = dev_priv->mmio_virt;
 
-	preempt_disable();
 	if (cmpxchg(fifo_mem + SVGA_FIFO_BUSY, 0, 1) == 0)
 		vmw_write(dev_priv, SVGA_REG_SYNC, reason);
-	preempt_enable();
 }
 
 void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)