Skip to contentSkip to conversation

drm/amdgpu: Warn about disabled DPM

PATCH In review Paul Menzel 3 participants 3 messages Jun 17, 2020

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

PATCH 1/1 drm/amdgpu: Warn about disabled DPM

Currently, besides there is no explicit message, that DPM is disabled. The user would need to know, that the missing success line is an indicator.

[drm] amdgpu: dpm initialized

So, add an explicit message, and make it log level warning, as disabling dpm is not the default.

Resolves: https://gitlab.freedesktop.org/drm/amd/-/issues/1173

---
 drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 4 +++-
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +3 -1
index 4b3faaccecb9..071215e8039a 100644
@@ -3014,8 +3014,10 @@ static int kv_dpm_sw_init(void *handle)
 	adev->pm.current_mclk = adev->clock.default_mclk;
 	adev->pm.int_thermal_type = THERMAL_TYPE_NONE;
 
-	if (amdgpu_dpm == 0)
+	if (amdgpu_dpm == 0) {
+		DRM_WARN("amdgpu: dpm disabled\n");
 		return 0;
+	}
 
 	INIT_WORK(&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);
 	mutex_lock(&adev->pm.mutex);
drivers/gpu/drm/amd/amdgpu/si_dpm.c +3 -1
index c00ba4b23c9a..6af89587f80c 100644
@@ -7687,8 +7687,10 @@ static int si_dpm_sw_init(void *handle)
 	adev->pm.current_mclk = adev->clock.default_mclk;
 	adev->pm.int_thermal_type = THERMAL_TYPE_NONE;
 
-	if (amdgpu_dpm == 0)
+	if (amdgpu_dpm == 0) {
+		DRM_INFO("amdgpu: dpm disabled\n");
 		return 0;
+	}
 
 	ret = si_dpm_init_microcode(adev);
 	if (ret)
Signature · 6 lines
2.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Paul Menzel
Sent: Wednesday, June 17, 2020 3:17 PM
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Cc: Paul Menzel <[email protected]>; [email protected]
Subject: [PATCH] drm/amdgpu: Warn about disabled DPM

Currently, besides there is no explicit message, that DPM is disabled. The user would need to know, that the missing success line is an indicator.

[drm] amdgpu: dpm initialized

So, add an explicit message, and make it log level warning, as disabling dpm is not the default.

Resolves: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1173&amp;data=02%7C01%7Cevan.quan%40amd.com%7C4ba79bb63487426f074d08d81290e615%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637279760886452253&amp;sdata=if2K3qoBopyK%2FLqycejyBac7JuifQk%2F6O576wubDSDA%3D&amp;reserved=0

---
 drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 4 +++-  drivers/gpu/drm/amd/amdgpu/si_dpm.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +3 -1
index 4b3faaccecb9..071215e8039a 100644
@@ -3014,8 +3014,10 @@ static int kv_dpm_sw_init(void *handle)
 adev->pm.current_mclk = adev->clock.default_mclk;
 adev->pm.int_thermal_type = THERMAL_TYPE_NONE;
 
-if (amdgpu_dpm == 0)
+if (amdgpu_dpm == 0) {
+DRM_WARN("amdgpu: dpm disabled\n");
 return 0;
+}
 
 INIT_WORK(&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);
 mutex_lock(&adev->pm.mutex);
drivers/gpu/drm/amd/amdgpu/si_dpm.c +3 -1
index c00ba4b23c9a..6af89587f80c 100644
@@ -7687,8 +7687,10 @@ static int si_dpm_sw_init(void *handle)
 adev->pm.current_mclk = adev->clock.default_mclk;
 adev->pm.int_thermal_type = THERMAL_TYPE_NONE;
 
-if (amdgpu_dpm == 0)
+if (amdgpu_dpm == 0) {
+DRM_INFO("amdgpu: dpm disabled\n");
 return 0;
+}
 
 ret = si_dpm_init_microcode(adev);
 if (ret)

--
2.27.0

_______________________________________________
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=02%7C01%7Cevan.quan%40amd.com%7C4ba79bb63487426f074d08d81290e615%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637279760886452253&amp;sdata=xJ1ZELqsAMby6w%2Fj5e9N1ytLe%2FOYPRn6e4C8wX7%2BCCg%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw
In reply to Paul Menzel
Quoted 39 lines · Paul Menzel

Currently, besides there is no explicit message, that DPM is disabled. The user would need to know, that the missing success line is an indicator.

[drm] amdgpu: dpm initialized

So, add an explicit message, and make it log level warning, as disabling dpm is not the default.

Resolves: https://gitlab.freedesktop.org/drm/amd/-/issues/1173

---
 drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 4 +++-
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +3 -1
index 4b3faaccecb9..071215e8039a 100644
@@ -3014,8 +3014,10 @@ static int kv_dpm_sw_init(void *handle)
        adev->pm.current_mclk = adev->clock.default_mclk;
        adev->pm.int_thermal_type = THERMAL_TYPE_NONE;
 
-       if (amdgpu_dpm == 0)
+       if (amdgpu_dpm == 0) {
+               DRM_WARN("amdgpu: dpm disabled\n");
                return 0;
+       }
 
        INIT_WORK(&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);
        mutex_lock(&adev->pm.mutex);
drivers/gpu/drm/amd/amdgpu/si_dpm.c +0 -0
index c00ba4b23c9a..6af89587f80c 100644

drivers/gpu/drm/amd/amdgpu/si_dpm.c static int si_dpm_sw_init(void *handle) · line 7691

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +2 -1
@@ -7687,8 +7687,10 @@ static int si_dpm_sw_init(void *handle)
        adev->pm.current_mclk = adev->clock.default_mclk;
        adev->pm.int_thermal_type = THERMAL_TYPE_NONE;
 
-       if (amdgpu_dpm == 0)
+       if (amdgpu_dpm == 0) {
+               DRM_INFO("amdgpu: dpm disabled\n");

These should both be WARN or both be INFO for consistency. Also, please use dev_info or dev_warn rather than the old DRM macros. They provide better information when multiple GPUs are present.

Thanks,

Alex

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1 -1
                return 0;
+       }
 
        ret = si_dpm_init_microcode(adev);
        if (ret)
--

2.27.0

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