diff options
| author | Christian König <christian.koenig@amd.com> | 2015-07-08 03:56:14 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2015-07-09 11:40:10 -0400 |
| commit | dbedff05d163f8d1b4a97b91c57b939830fc235f (patch) | |
| tree | 701318818432b56596b65412d27d6508ef226100 | |
| parent | eb99070b4ad105f8a516d99e95226180924eddc8 (diff) | |
drm/radeon: check if BO_VA is set before adding it to the invalidation list
Otherwise we try to clear BO_VAs without an address.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91141
Signed-off-by: Christian König <christian.koenig@amd.com>
Test-by: hadack@gmx.de
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_vm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index 031096599f84..48d97c040f49 100644 --- a/drivers/gpu/drm/radeon/radeon_vm.c +++ b/drivers/gpu/drm/radeon/radeon_vm.c | |||
| @@ -507,22 +507,21 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, | |||
| 507 | tmp->bo = radeon_bo_ref(bo_va->bo); | 507 | tmp->bo = radeon_bo_ref(bo_va->bo); |
| 508 | 508 | ||
| 509 | interval_tree_remove(&bo_va->it, &vm->va); | 509 | interval_tree_remove(&bo_va->it, &vm->va); |
| 510 | spin_lock(&vm->status_lock); | ||
| 510 | bo_va->it.start = 0; | 511 | bo_va->it.start = 0; |
| 511 | bo_va->it.last = 0; | 512 | bo_va->it.last = 0; |
| 512 | |||
| 513 | spin_lock(&vm->status_lock); | ||
| 514 | list_del_init(&bo_va->vm_status); | 513 | list_del_init(&bo_va->vm_status); |
| 515 | list_add(&tmp->vm_status, &vm->freed); | 514 | list_add(&tmp->vm_status, &vm->freed); |
| 516 | spin_unlock(&vm->status_lock); | 515 | spin_unlock(&vm->status_lock); |
| 517 | } | 516 | } |
| 518 | 517 | ||
| 519 | if (soffset || eoffset) { | 518 | if (soffset || eoffset) { |
| 519 | spin_lock(&vm->status_lock); | ||
| 520 | bo_va->it.start = soffset; | 520 | bo_va->it.start = soffset; |
| 521 | bo_va->it.last = eoffset - 1; | 521 | bo_va->it.last = eoffset - 1; |
| 522 | interval_tree_insert(&bo_va->it, &vm->va); | ||
| 523 | spin_lock(&vm->status_lock); | ||
| 524 | list_add(&bo_va->vm_status, &vm->cleared); | 522 | list_add(&bo_va->vm_status, &vm->cleared); |
| 525 | spin_unlock(&vm->status_lock); | 523 | spin_unlock(&vm->status_lock); |
| 524 | interval_tree_insert(&bo_va->it, &vm->va); | ||
| 526 | } | 525 | } |
| 527 | 526 | ||
| 528 | bo_va->flags = flags; | 527 | bo_va->flags = flags; |
| @@ -1156,7 +1155,8 @@ void radeon_vm_bo_invalidate(struct radeon_device *rdev, | |||
| 1156 | 1155 | ||
| 1157 | list_for_each_entry(bo_va, &bo->va, bo_list) { | 1156 | list_for_each_entry(bo_va, &bo->va, bo_list) { |
| 1158 | spin_lock(&bo_va->vm->status_lock); | 1157 | spin_lock(&bo_va->vm->status_lock); |
| 1159 | if (list_empty(&bo_va->vm_status)) | 1158 | if (list_empty(&bo_va->vm_status) && |
| 1159 | (bo_va->it.start || bo_va->it.last)) | ||
| 1160 | list_add(&bo_va->vm_status, &bo_va->vm->invalidated); | 1160 | list_add(&bo_va->vm_status, &bo_va->vm->invalidated); |
| 1161 | spin_unlock(&bo_va->vm->status_lock); | 1161 | spin_unlock(&bo_va->vm->status_lock); |
| 1162 | } | 1162 | } |
