Skip to contentSkip to conversation

drm/amd/powerplay: fix missed hwmgr check warning before call gfx_off_control handler

PATCH In review Huang Rui 2 participants 3 messages May 18, 2018 – Jun 5, 2018 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: fix missed hwmgr check warning before call gfx_off_control handler

Patch 9667849bbb8d: "drm/amd/powerplay: add control gfxoff enabling in late init" from Mar 13, 2018, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c:194

pp_late_init()
error: we previously assumed 'hwmgr' could be null (see line 185)

drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c

This patch fixes the warning to add hwmgr checking.

---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +2 -1
index b493369..2d0e42f 100644
@@ -191,7 +191,8 @@ static int pp_late_init(void *handle)
 	if (adev->pm.smu_prv_buffer_size != 0)
 		pp_reserve_vram_for_smu(adev);
 
-	if (hwmgr->hwmgr_func->gfx_off_control &&
+	if (hwmgr && hwmgr->hwmgr_func &&
+	    hwmgr->hwmgr_func->gfx_off_control &&
 	    (hwmgr->feature_mask & PP_GFXOFF_MASK)) {
 		ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr, true);
 		if (ret)
Signature · 6 lines
2.7.4

_______________________________________________
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): 1526611804-25017-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

Ping.

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Friday, May 18, 2018 10:50 AM
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected]
Cc: Huang, Ray <[email protected]>; Dan Carpenter <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix missed hwmgr check warning before call gfx_off_control handler

Patch 9667849bbb8d: "drm/amd/powerplay: add control gfxoff enabling in late init" from Mar 13, 2018, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c:194

pp_late_init()
error: we previously assumed 'hwmgr' could be null (see line 185)

drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c

This patch fixes the warning to add hwmgr checking.

---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +2 -1
index b493369..2d0e42f 100644
@@ -191,7 +191,8 @@ static int pp_late_init(void *handle)
 	if (adev->pm.smu_prv_buffer_size != 0)
 		pp_reserve_vram_for_smu(adev);
 
-	if (hwmgr->hwmgr_func->gfx_off_control &&
+	if (hwmgr && hwmgr->hwmgr_func &&
+	    hwmgr->hwmgr_func->gfx_off_control &&
 	    (hwmgr->feature_mask & PP_GFXOFF_MASK)) {
 		ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr, true);
 		if (ret)

--
2.7.4

_______________________________________________
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): DM5PR12MB1338C0F00CF6715014170143EC660-2J9CzHegvk9OQUa6sFEYLQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by Evan Quan
#4 lore raw
Quoted 59 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang, Ray
Sent: Tuesday, June 05, 2018 6:11 PM
To: Huang, Ray <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected]
Cc: Dan Carpenter <[email protected]>
Subject: RE: [PATCH] drm/amd/powerplay: fix missed hwmgr check warning before call gfx_off_control handler

Ping.

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Friday, May 18, 2018 10:50 AM
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected]
Cc: Huang, Ray <[email protected]>; Dan Carpenter <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix missed hwmgr check warning before call gfx_off_control handler

Patch 9667849bbb8d: "drm/amd/powerplay: add control gfxoff enabling in late init" from Mar 13, 2018, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c:194

pp_late_init()
error: we previously assumed 'hwmgr' could be null (see line 185)

drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c

This patch fixes the warning to add hwmgr checking.

---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +2 -2
index b493369..2d0e42f 100644
@@ -191,7 +191,8 @@ static int pp_late_init(void *handle)
 	if (adev->pm.smu_prv_buffer_size != 0)
 		pp_reserve_vram_for_smu(adev);
 
-	if (hwmgr->hwmgr_func->gfx_off_control &&
+	if (hwmgr && hwmgr->hwmgr_func &&
+	    hwmgr->hwmgr_func->gfx_off_control &&
 	    (hwmgr->feature_mask & PP_GFXOFF_MASK)) {
 		ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr, true);
 		if (ret)
--

2.7.4

Quoted 8 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

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