Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau: complain loudly if buffer is pinned during destruction

Shouldn't happen, and we invert the struct_mutex with reservation here,
potentially leading to deadlocks. Once reservations become lockdep annotated,
lockdep will go splat on this.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Maarten Lankhorst and committed by
Dave Airlie
27f06b2d 1e2bd5f5

+2 -1
+2 -1
drivers/gpu/drm/nouveau/nouveau_gem.c
··· 50 50 return; 51 51 nvbo->gem = NULL; 52 52 53 - if (unlikely(nvbo->pin_refcnt)) { 53 + /* Lockdep hates you for doing reserve with gem object lock held */ 54 + if (WARN_ON_ONCE(nvbo->pin_refcnt)) { 54 55 nvbo->pin_refcnt = 1; 55 56 nouveau_bo_unpin(nvbo); 56 57 }