Skip to contentSkip to conversation

drm/amdgpu: fix amdgpu_preempt_mgr_new()

PATCH Applied Dan Carpenter 6 participants 6 messages Jun 18, 2021 – Jun 21, 2021

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

PATCH 1/1 drm/amdgpu: fix amdgpu_preempt_mgr_new()

There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM.

Fixes 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +1 -1
index f6aff7ce5160..d02c8637f909 100644
@@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man,
 	struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
 
 	*res = kzalloc(sizeof(**res), GFP_KERNEL);
-	if (*res)
+	if (!*res)
 		return -ENOMEM;
 
 	ttm_resource_init(tbo, place, *res);
Signature · 1 line
2.30.2
maintainer
#1 lore raw

Am 18.06.21 um 10:37 schrieb Dan Carpenter:

Quoted 5 lines

There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM.

Fixes 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next")

Most be some fallout from merging it with the TTM changes.

Anyway, patch is Reviewed-by: Christian König <[email protected]>

Thanks,
Christian.

Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +1 -1
index f6aff7ce5160..d02c8637f909 100644
@@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man,
  	struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
 
  	*res = kzalloc(sizeof(**res), GFP_KERNEL);
-	if (*res)
+	if (!*res)
  		return -ENOMEM;
 
  	ttm_resource_init(tbo, place, *res);
#2 lore raw

Am 2021-06-18 um 4:39 a.m. schrieb Christian König:

Quoted 11 lines

Am 18.06.21 um 10:37 schrieb Dan Carpenter:

Quoted 6 lines

There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM.

Fixes 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of

git://anongit.freedesktop.org/drm/drm-misc into drm-next")

Most be some fallout from merging it with the TTM changes.

Anyway, patch is Reviewed-by: Christian König <[email protected]>

This is obviously not for amd-staging-drm-next. Christian, are you going to apply it to the relevant branches?

Thanks,
  Felix

Quoted 8 lines

Thanks,
Christian.

Quoted 4 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c static int amdgpu_preempt_mgr_new(struct · line 76

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +1 -1
index f6aff7ce5160..d02c8637f909 100644
@@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct
 ttm_resource_manager *man,
       struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
         *res = kzalloc(sizeof(**res), GFP_KERNEL);
-    if (*res)
+    if (!*res)
           return -ENOMEM;
         ttm_resource_init(tbo, place, *res);

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

Applied
#3 lore raw
Quoted 10 lines · Felix Kuehling

Am 2021-06-18 um 4:39 a.m. schrieb Christian König:

Quoted 8 lines

Am 18.06.21 um 10:37 schrieb Dan Carpenter:

Quoted 6 lines

There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM.

Fixes 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of

git://anongit.freedesktop.org/drm/drm-misc into drm-next")

Quoted 6 lines
Quoted 3 lines

Most be some fallout from merging it with the TTM changes.

Anyway, patch is Reviewed-by: Christian König <[email protected]>

This is obviously not for amd-staging-drm-next. Christian, are you going to apply it to the relevant branches?

I've applied it to my drm-next branch.

Alex

Quoted 31 lines

Thanks,
Felix

Quoted 8 lines

Thanks,
Christian.

Quoted 4 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c static int amdgpu_preempt_mgr_new(struct · line 76

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +1 -1
index f6aff7ce5160..d02c8637f909 100644
@@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct
 ttm_resource_manager *man,
      struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
        *res = kzalloc(sizeof(**res), GFP_KERNEL);
-    if (*res)
+    if (!*res)
          return -ENOMEM;
        ttm_resource_init(tbo, place, *res);

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

#4 lore raw

Am 18.06.21 um 23:18 schrieb Alex Deucher:

Quoted 9 lines · Felix Kuehling
Quoted 8 lines

Am 2021-06-18 um 4:39 a.m. schrieb Christian König:

Quoted 7 lines

Am 18.06.21 um 10:37 schrieb Dan Carpenter:

Quoted 6 lines

There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM.

Fixes 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of

git://anongit.freedesktop.org/drm/drm-misc into drm-next")

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Most be some fallout from merging it with the TTM changes.

Anyway, patch is Reviewed-by: Christian König <[email protected]>

This is obviously not for amd-staging-drm-next. Christian, are you going to apply it to the relevant branches?

I've applied it to my drm-next branch.

I already pushed it to drm-misc-next last week.

Christian.

Quoted 32 lines

Alex

Quoted 20 lines

Thanks,
Felix

Quoted 16 lines

Thanks,
Christian.

Quoted 13 lines
---
   drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +0 -0
index f6aff7ce5160..d02c8637f909 100644
@@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct
 ttm_resource_manager *man,
       struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
         *res = kzalloc(sizeof(**res), GFP_KERNEL);
Quoted 8 lines
Quoted 4 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man, · line 77

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +1 -1
-    if (*res)
+    if (!*res)
           return -ENOMEM;
         ttm_resource_init(tbo, place, *res);

_______________________________________________
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

#5 lore raw

[Public]

I've dropped it from my tree in that case.
________________________________
From: Christian König <[email protected]>
Sent: Monday, June 21, 2021 6:27 AM
To: Alex Deucher <[email protected]>; Kuehling, Felix <[email protected]>
Cc: David Airlie <[email protected]>; Pan, Xinhui <[email protected]>; [email protected] <[email protected]>; Maling list - DRI developers <[email protected]>; amd-gfx list <[email protected]>; Daniel Vetter <[email protected]>; Deucher, Alexander <[email protected]>; Dave Airlie <[email protected]>; Koenig, Christian <[email protected]>; Dan Carpenter <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix amdgpu_preempt_mgr_new()

Am 18.06.21 um 23:18 schrieb Alex Deucher:

Quoted 9 lines · Felix Kuehling
Quoted 8 lines

Am 2021-06-18 um 4:39 a.m. schrieb Christian König:

Quoted 7 lines

Am 18.06.21 um 10:37 schrieb Dan Carpenter:

Quoted 6 lines

There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM.

Fixes 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of

git://anongit.freedesktop.org/drm/drm-misc into drm-next")

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Most be some fallout from merging it with the TTM changes.

Anyway, patch is Reviewed-by: Christian König <[email protected]>

This is obviously not for amd-staging-drm-next. Christian, are you going to apply it to the relevant branches?

I've applied it to my drm-next branch.

I already pushed it to drm-misc-next last week.

Christian.

Quoted 32 lines

Alex

Quoted 20 lines

Thanks,
Felix

Quoted 16 lines

Thanks,
Christian.

Quoted 13 lines
---
   drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +0 -0
index f6aff7ce5160..d02c8637f909 100644
@@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct
 ttm_resource_manager *man,
       struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
         *res = kzalloc(sizeof(**res), GFP_KERNEL);
Quoted 8 lines
Quoted 4 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man, · line 77

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +1 -1
-    if (*res)
+    if (!*res)
           return -ENOMEM;
         ttm_resource_init(tbo, place, *res);

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C096813db12f24172870508d9349f375a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637598680703030828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=%2Ffg7TXDA9%2F%2Fjin8T5f3V11fAv3PVvtDFluNHnhwyOGM%3D&amp;reserved=0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C096813db12f24172870508d9349f375a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637598680703030828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=%2Ffg7TXDA9%2F%2Fjin8T5f3V11fAv3PVvtDFluNHnhwyOGM%3D&amp;reserved=0

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