aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-06-08 04:40:34 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-06-23 02:01:52 -0400
commit15ba79ad44fed84a9dabf6996144789424abae5b (patch)
treef957369de9f011b287b1b83dddb0a5219fc239cd /drivers/gpu/drm/nouveau
parent06b75e3552394af66cc1ee4bfb5fe01a94929adb (diff)
drm/nouveau: shut lockdep up if last vm ref needs to destroy pgd
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_vm.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_vm.c b/drivers/gpu/drm/nouveau/nouveau_vm.c
index 75ef595db4d5..244fd38fdb84 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vm.c
@@ -369,23 +369,26 @@ nouveau_vm_link(struct nouveau_vm *vm, struct nouveau_gpuobj *pgd)
369} 369}
370 370
371static void 371static void
372nouveau_vm_unlink(struct nouveau_vm *vm, struct nouveau_gpuobj *pgd) 372nouveau_vm_unlink(struct nouveau_vm *vm, struct nouveau_gpuobj *mpgd)
373{ 373{
374 struct nouveau_vm_pgd *vpgd, *tmp; 374 struct nouveau_vm_pgd *vpgd, *tmp;
375 struct nouveau_gpuobj *pgd = NULL;
375 376
376 if (!pgd) 377 if (!mpgd)
377 return; 378 return;
378 379
379 mutex_lock(&vm->mm->mutex); 380 mutex_lock(&vm->mm->mutex);
380 list_for_each_entry_safe(vpgd, tmp, &vm->pgd_list, head) { 381 list_for_each_entry_safe(vpgd, tmp, &vm->pgd_list, head) {
381 if (vpgd->obj != pgd) 382 if (vpgd->obj == mpgd) {
382 continue; 383 pgd = vpgd->obj;
383 384 list_del(&vpgd->head);
384 list_del(&vpgd->head); 385 kfree(vpgd);
385 nouveau_gpuobj_ref(NULL, &vpgd->obj); 386 break;
386 kfree(vpgd); 387 }
387 } 388 }
388 mutex_unlock(&vm->mm->mutex); 389 mutex_unlock(&vm->mm->mutex);
390
391 nouveau_gpuobj_ref(NULL, &pgd);
389} 392}
390 393
391static void 394static void