summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvc0_vm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-04-06 13:28:35 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-04-20 08:50:14 +1000
commit04eb34a43ce5168e05e2748bd46a62a09289cdde (patch)
tree4a5bfe56c631889075416d18b6b513d1eaeb37ed /drivers/gpu/drm/nouveau/nvc0_vm.c
parent12dfc843f43efe14d0cfc7a52753d971a0cc759d (diff)
drm/nouveau: split ramin_lock into two locks, one hardirq safe
Fixes a possible lock ordering reversal between context_switch_lock and ramin_lock. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvc0_vm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_vm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_vm.c b/drivers/gpu/drm/nouveau/nvc0_vm.c
index a0a2a0277f73..a179e6c55afb 100644
--- a/drivers/gpu/drm/nouveau/nvc0_vm.c
+++ b/drivers/gpu/drm/nouveau/nvc0_vm.c
@@ -104,11 +104,12 @@ nvc0_vm_flush(struct nouveau_vm *vm)
struct nouveau_instmem_engine *pinstmem = &dev_priv->engine.instmem;
struct drm_device *dev = vm->dev;
struct nouveau_vm_pgd *vpgd;
+ unsigned long flags;
u32 engine = (dev_priv->chan_vm == vm) ? 1 : 5;
pinstmem->flush(vm->dev);
- spin_lock(&dev_priv->ramin_lock);
+ spin_lock_irqsave(&dev_priv->vm_lock, flags);
list_for_each_entry(vpgd, &vm->pgd_list, head) {
/* looks like maybe a "free flush slots" counter, the
* faster you write to 0x100cbc to more it decreases
@@ -125,5 +126,5 @@ nvc0_vm_flush(struct nouveau_vm *vm)
nv_rd32(dev, 0x100c80), engine);
}
}
- spin_unlock(&dev_priv->ramin_lock);
+ spin_unlock_irqrestore(&dev_priv->vm_lock, flags);
}