From: Thomas Hellstrom Date: Fri, 8 Jan 2016 19:29:39 +0000 (+0100) Subject: drm/vmwgfx: Fix an incorrect lock check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fb89ac5102ae2875d685c847e6b5dbc141622d43;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/vmwgfx: Fix an incorrect lock check 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: Reported-and-tested-by: Tetsuo Handa Signed-off-by: Thomas Hellstrom Reviewed-by: Sinclair Yeh Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c index 6377e8151000..67cebb23c940 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c @@ -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);