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

drm/nouveau: Add a separate class for the kernel channel mutex.

nouveau_bo_move_m2mf() needs to lock the kernel channel, and it may be
called from the pushbuf IOCTL with an user channel already locked. Use
a separate subclass for the kernel channel mutex because this is
legitimate mutex nesting.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

authored by

Francisco Jerez and committed by
Ben Skeggs
e419cf09 1f6d2de2

+6 -1
+1 -1
drivers/gpu/drm/nouveau/nouveau_bo.c
··· 678 678 chan = nvbo->channel; 679 679 if (!chan || nvbo->no_vm) { 680 680 chan = dev_priv->channel; 681 - mutex_lock(&chan->mutex); 681 + mutex_lock_nested(&chan->mutex, NOUVEAU_KCHANNEL_MUTEX); 682 682 } 683 683 684 684 if (dev_priv->card_type < NV_50)
+5
drivers/gpu/drm/nouveau/nouveau_drv.h
··· 173 173 uint64_t offset; 174 174 }; 175 175 176 + enum nouveau_channel_mutex_class { 177 + NOUVEAU_UCHANNEL_MUTEX, 178 + NOUVEAU_KCHANNEL_MUTEX 179 + }; 180 + 176 181 struct nouveau_channel { 177 182 struct drm_device *dev; 178 183 int id;