Skip to content

Commit

Permalink
drm/nouveau: Add a separate class for the kernel channel mutex.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Francisco Jerez authored and Ben Skeggs committed Dec 3, 2010
1 parent 1f6d2de commit e419cf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
chan = nvbo->channel;
if (!chan || nvbo->no_vm) {
chan = dev_priv->channel;
mutex_lock(&chan->mutex);
mutex_lock_nested(&chan->mutex, NOUVEAU_KCHANNEL_MUTEX);
}

if (dev_priv->card_type < NV_50)
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/nouveau/nouveau_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ struct nouveau_page_flip_state {
uint64_t offset;
};

enum nouveau_channel_mutex_class {
NOUVEAU_UCHANNEL_MUTEX,
NOUVEAU_KCHANNEL_MUTEX
};

struct nouveau_channel {
struct drm_device *dev;
int id;
Expand Down

0 comments on commit e419cf0

Please sign in to comment.