drm/amdgpu: fix list not initialized
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix list not initialized
Otherwise, cpu stuck for 22s with kernel panic.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -2
@@ -1563,10 +1563,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,* the evicted list so that it gets validated again on the * next command submission. */ +list_del_init (&bo_va->base.vm_status);if (!(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type)))list_add_tail (&bo_va->base.vm_status, &vm->evicted); -else -list_del_init (&bo_va->base.vm_status); }else {list_del_init (&bo_va->base.vm_status); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 18.04.2018 um 12:37 schrieb Chunming Zhou:
Quoted 13 lines
Otherwise, cpu stuck for 22s with kernel panic.
Change-Id I5b87cde662a4658c9ab253ba88d009c9628a44caSigned-off-by Chunming Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1569
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-2@@ -1563,10 +1563,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,* the evicted list so that it gets validated again on the * next command submission. */ +list_del_init (&bo_va->base.vm_status);if (!(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type)))list_add_tail (&bo_va->base.vm_status, &vm->evicted); -else -list_del_init (&bo_va->base.vm_status);
Good catch, but I think I would prefer to replace list_add_tail() with list_move_tail() instead of moving the list_del_init().
But just a nit pick. Either way the patch is Reviewed-by: Christian König <[email protected]>.
Regards,
Christian.
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1571
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0}else {list_del_init (&bo_va->base.vm_status); }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 14 lines · Chunming Zhou
Otherwise, cpu stuck for 22s with kernel panic.
Change-Id I5b87cde662a4658c9ab253ba88d009c9628a44caSigned-off-by Chunming Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -1563,10 +1563,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,* the evicted list so that it gets validated again on the
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1571
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-2* next command submission. */ +list_del_init (&bo_va->base.vm_status);if (!(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type)))list_add_tail (&bo_va->base.vm_status, &vm->evicted); -else -list_del_init (&bo_va->base.vm_status); }else {list_del_init (&bo_va->base.vm_status); }
We may simplify the logic as below.
How do you think?
list_del_init(&bo_va->base.vm_status);
unsigned mem_type = bo->tbo.mem.mem_type;
/* If the BO is not in its preferred location add it back to
* the evicted list so that it gets validated again on the
* next command submission.
*/
if ((bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) &&
(!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type))))
list_add_tail(&bo_va->base.vm_status, &vm->evicted);Jerry
Quoted 1 line
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 29 lines · Jerry (Junwei)
Quoted 24 lines · Chunming Zhou
Otherwise, cpu stuck for 22s with kernel panic.
Change-Id I5b87cde662a4658c9ab253ba88d009c9628a44caSigned-off-by Chunming Zhou <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-2@@ -1563,10 +1563,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device*adev, * the evicted list so that it gets validated again on the * next command submission. */ + list_del_init(&bo_va->base.vm_status); if (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type))) list_add_tail(&bo_va->base.vm_status, &vm->evicted); - else - list_del_init(&bo_va->base.vm_status); } else { list_del_init(&bo_va->base.vm_status);Quoted 1 line
}
We may simplify the logic as below.
How do you think?
Quoted 9 lines
list_del_init(&bo_va->base.vm_status);
unsignedmem_type=bo->tbo.mem.mem_type;
/* If the BO is not in its preferred location add it back to
* the evicted list so that it gets validated again on the
* next command submission.
*/
if ((bo &&bo->tbo.resv==vm->root.base.bo->tbo.resv) && (!(bo->preferred_domains &amdgpu_mem_type_to_domain(mem_type))))list_add_tail(&bo_va->base.vm_status, &vm->evicted);
Looks good, but I already pushed that patch just now. if you like, you can make a simplify patch with your idea.
Regards,
David Zhou
Quoted 8 lines
Jerry
Quoted 1 line
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 41 lines · On 04/19/2018 10:30 AM, zhoucm1 wrote:
Quoted 37 lines · Jerry (Junwei)
Quoted 15 lines · Chunming Zhou
Otherwise, cpu stuck for 22s with kernel panic.
Change-Id I5b87cde662a4658c9ab253ba88d009c9628a44caSigned-off-by Chunming Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -1563,10 +1563,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,* the evicted list so that it gets validated again on the drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1571
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-2* next command submission. */ +list_del_init (&bo_va->base.vm_status);if (!(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type)))list_add_tail (&bo_va->base.vm_status, &vm->evicted); -else -list_del_init (&bo_va->base.vm_status); }else {list_del_init (&bo_va->base.vm_status); }We may simplify the logic as below.
How do you think?list_del_init(&bo_va->base.vm_status); unsigned mem_type = bo->tbo.mem.mem_type; /* If the BO is not in its preferred location add it back to * the evicted list so that it gets validated again on the * next command submission. */ if ((bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) && (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type))))Quoted 1 line
list_add_tail(&bo_va->base.vm_status, &vm->evicted);
Quoted 2 lines
Looks good, but I already pushed that patch just now. if you like, you can make a simplify patch with your idea.
Sure, I will.
Jerry
Quoted 12 lines
Regards,
David ZhouQuoted 8 lines
Jerry
Quoted 1 line
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx