drm/vmwgfx: Fix a potential infinite spin waiting for fifo idle
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 28 Aug 2014 09:53:23 +0000 (11:53 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Mon, 1 Sep 2014 10:31:24 +0000 (12:31 +0200)
The code waiting for fifo idle was incorrect and could possibly spin
forever under certain circumstances.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reported-by: Mark Sheldon <markshel@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reivewed-by: Mark Sheldon <markshel@vmware.com>
Cc: <stable@vger.kernel.org>
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c

index 6ccd993e26bf4ead66d0e8d1f1b4b592856d7599..6eae14d2a3f73511143a42da95757418edf01207 100644 (file)
@@ -180,8 +180,9 @@ void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)
 
        mutex_lock(&dev_priv->hw_mutex);
 
+       vmw_write(dev_priv, SVGA_REG_SYNC, SVGA_SYNC_GENERIC);
        while (vmw_read(dev_priv, SVGA_REG_BUSY) != 0)
-               vmw_write(dev_priv, SVGA_REG_SYNC, SVGA_SYNC_GENERIC);
+               ;
 
        dev_priv->last_read_seqno = ioread32(fifo_mem + SVGA_FIFO_FENCE);