drm/vmwgfx: Fix an incorrect lock check
authorThomas Hellstrom <[email protected]>
Fri, 8 Jan 2016 19:29:39 +0000 (20:29 +0100)
committerDave Airlie <[email protected]>
Wed, 13 Jan 2016 21:56:44 +0000 (07:56 +1000)
With CONFIG_SMP=n and CONFIG_DEBUG_SPINLOCK=y the vmwgfx kernel module
would unconditionally throw a bug when checking for a held spinlock
in the command buffer code. Fix this by using a lockdep check.

Cc: <[email protected]>
Reported-and-tested-by: Tetsuo Handa <[email protected]>
Signed-off-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Sinclair Yeh <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c

index 6377e8151000f5401309133b635150acf128c2ad..67cebb23c940e2dc0019eab8b1dbe0b4a036650a 100644 (file)
@@ -247,7 +247,7 @@ static void __vmw_cmdbuf_header_free(struct vmw_cmdbuf_header *header)
 {
        struct vmw_cmdbuf_man *man = header->man;
 
-       BUG_ON(!spin_is_locked(&man->lock));
+       lockdep_assert_held_once(&man->lock);
 
        if (header->inline_space) {
                vmw_cmdbuf_header_inline_free(header);