projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca95261
)
drm/amdgpu: max_pde_used usage should be under protect
author
monk.liu
<
[email protected]
>
Tue, 26 May 2015 02:22:41 +0000
(10:22 +0800)
committer
Alex Deucher
<
[email protected]
>
Thu, 4 Jun 2015 01:03:53 +0000
(21:03 -0400)
Need to take the lock when accessing this.
Signed-off-by: monk.liu <
[email protected]
>
Reviewed-by: Christian König <
[email protected]
>
Reviewed-by: Jammy Zhou <
[email protected]
>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index cc6dca2581a60c243ebb1f6a0031f3a0df4c91d7..dcb2d3859cf12692bb27aa0761c508e4c5d95482 100644
(file)
--- a/
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@
-90,10
+90,13
@@
struct amdgpu_bo_list_entry *amdgpu_vm_get_bos(struct amdgpu_device *adev,
struct amdgpu_bo_list_entry *list;
unsigned i, idx;
+ mutex_lock(&vm->mutex);
list = drm_malloc_ab(vm->max_pde_used + 2,
sizeof(struct amdgpu_bo_list_entry));
- if (!list)
+ if (!list) {
+ mutex_unlock(&vm->mutex);
return NULL;
+ }
/* add the vm page table to the list */
list[0].robj = vm->page_directory;
@@
-116,6
+119,7
@@
struct amdgpu_bo_list_entry *amdgpu_vm_get_bos(struct amdgpu_device *adev,
list[idx].tv.shared = true;
list_add(&list[idx++].tv.head, head);
}
+ mutex_unlock(&vm->mutex);
return list;
}