Skip to contentSkip to conversation

drm/amdgpu: Use list_del_init in amdgpu_mn_unregister

PATCH In review Felix Kuehling 3 participants 4 messages Aug 2, 2017 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Use list_del_init in amdgpu_mn_unregister

Otherwise bo->shadow_list (which is aliased by bo->mn_list) will not appear empty in amdgpu_ttm_bo_destroy and cause an oops when freeing former userptr BOs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +1 -1
index 38f739f..6558a3e 100644
@@ -359,7 +359,7 @@ void amdgpu_mn_unregister(struct amdgpu_bo *bo)
 	head = bo->mn_list.next;
 
 	bo->mn = NULL;
-	list_del(&bo->mn_list);
+	list_del_init(&bo->mn_list);
 
 	if (list_empty(head)) {
 		struct amdgpu_mn_node *node;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1501641295-26353-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Hi Christian,

Please apply this patch if you think this is the correct solution. This is currently blocking the amd-kfd-staging merge from amd-staging-4.11. Kent will try another merge tomorrow morning our time.

I'm quite sure this also breaks userptrs in the graphics driver.

Thanks,
Felix

Quoted 14 lines · Felix Kuehling

Otherwise bo->shadow_list (which is aliased by bo->mn_list) will not appear empty in amdgpu_ttm_bo_destroy and cause an oops when freeing former userptr BOs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +0 -0
index 38f739f..6558a3e 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c void amdgpu_mn_unregister(struct amdgpu_bo *bo) · line 365

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +1 -1
@@ -359,7 +359,7 @@ void amdgpu_mn_unregister(struct amdgpu_bo *bo)
 	head = bo->mn_list.next;
 
 	bo->mn = NULL;
-	list_del(&bo->mn_list);
+	list_del_init(&bo->mn_list);
 
 	if (list_empty(head)) {
 		struct amdgpu_mn_node *node;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): d69ea54c-0e44-9112-1b7a-a304f81ccee8-5C7GfCeVMHo@public.gmane.org

#4 lore raw

Hi Felix,

yeah, that looks like the correct solution.

Patch is Reviewed-by: Christian König <[email protected]> and I'm going to push it into amd-staging-4.11 ASAP.

Mpf, looks like I've actually tested this with the notifier disabled.

Thanks for the quick fix,
Christian.

Am 02.08.2017 um 04:41 schrieb Felix Kuehling:

Quoted 33 lines

Hi Christian,

Please apply this patch if you think this is the correct solution. This is currently blocking the amd-kfd-staging merge from amd-staging-4.11. Kent will try another merge tomorrow morning our time.

I'm quite sure this also breaks userptrs in the graphics driver.

Thanks,
Felix

Quoted 20 lines · Felix Kuehling

Otherwise bo->shadow_list (which is aliased by bo->mn_list) will not appear empty in amdgpu_ttm_bo_destroy and cause an oops when freeing former userptr BOs.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +1 -1
index 38f739f..6558a3e 100644
@@ -359,7 +359,7 @@ void amdgpu_mn_unregister(struct amdgpu_bo *bo)
  	head = bo->mn_list.next;
 
  	bo->mn = NULL;
-	list_del(&bo->mn_list);
+	list_del_init(&bo->mn_list);
 
Quoted 6 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c void amdgpu_mn_unregister(struct amdgpu_bo *bo) · line 365

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +0 -0
  	if (list_empty(head)) {
  		struct amdgpu_mn_node *node;

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): 59789614-b4c6-447c-4f8d-4b5527fe1a4c-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#6 lore raw

Things look good on initial testing on Fiji. Thanks Felix for the fix, and Christian for pushing it quickly.

Kent

-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Wednesday, August 02, 2017 3:01 AM
To: Kuehling, Felix; [email protected]; Koenig, Christian
Cc: Russell, Kent
Subject: Re: [PATCH 1/1] drm/amdgpu: Use list_del_init in amdgpu_mn_unregister

Hi Felix,

yeah, that looks like the correct solution.

Patch is Reviewed-by: Christian König <[email protected]> and I'm going to push it into amd-staging-4.11 ASAP.

Mpf, looks like I've actually tested this with the notifier disabled.

Thanks for the quick fix,
Christian.

Am 02.08.2017 um 04:41 schrieb Felix Kuehling:

Quoted 34 lines

Hi Christian,

Please apply this patch if you think this is the correct solution. This is currently blocking the amd-kfd-staging merge from amd-staging-4.11. Kent will try another merge tomorrow morning our time.

I'm quite sure this also breaks userptrs in the graphics driver.

Thanks,
Felix

Quoted 21 lines · Felix Kuehling

Otherwise bo->shadow_list (which is aliased by bo->mn_list) will not appear empty in amdgpu_ttm_bo_destroy and cause an oops when freeing former userptr BOs.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +1 -1
index 38f739f..6558a3e 100644
@@ -359,7 +359,7 @@ void amdgpu_mn_unregister(struct amdgpu_bo *bo)
  	head = bo->mn_list.next;
 
  	bo->mn = NULL;
-	list_del(&bo->mn_list);
+	list_del_init(&bo->mn_list);
 
Quoted 6 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c void amdgpu_mn_unregister(struct amdgpu_bo *bo) · line 365

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +0 -0
  	if (list_empty(head)) {
  		struct amdgpu_mn_node *node;

_______________________________________________
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