drm/amdgpu/smu12: fix power reporting on CZN/BCL
Subsystems (3)
Alex Deucher
maintainerPATCH 1/2 drm/amdgpu/smu12: fix power reporting on CZN/BCL
The metrics interface exposes the socket power in W, but apparently RN systems exposed the power as mW. See
commit 137aac26a2ed ("drm/amdgpu/smu12: fix power reporting on renoir"). So leave RN as mW and use W for CZN/BCL.
--- drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +4 -1
@@ -1196,7 +1196,10 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu, *value = metrics->AverageUvdActivity /100 ;break ;case METRICS_AVERAGE_SOCKETPOWER : - *value = (metrics->CurrentSocketPower <<8 ) /1000 ; +if (smu->adev->ip_versions[MP1_HWIP ][0 ] ==IP_VERSION (12 ,0 ,0 )) + *value = (metrics->CurrentSocketPower <<8 ) /1000 ;/* mW */ +else + *value = metrics->CurrentSocketPower <<8 ;/* W */ break ;case METRICS_TEMPERATURE_EDGE : *value = (metrics->GfxTemperature / 100) *
Signature · 1 line
2.39.0
Alex Deucher
maintainerPATCH 2/2 drm/amdgpu/pm: update hwmon power documentation
Power reporting is socket power. On APUs this includes the CPU. Update the documentation to clarify this.
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +1 -1
@@ -3059,7 +3059,7 @@ static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev,* * hwmon interfaces for GPU power: * -* - power1_average: average power used by the GPU in microWatts +* - power1_average: average power used by the SoC in microWatts. On APUs this includes the CPU. * * - power1_cap_min: minimum cap supported in microWatts *
Signature · 1 line
2.39.0
Re: [PATCH 2/2] drm/amdgpu/pm: update hwmon power documentation
Can someone review this patch (2/2)? 1/2 is superseded by Jesse's patch, but this one still makes sense.
Thanks
Quoted 25 lines · Alex Deucher
Power reporting is socket power. On APUs this includes the CPU. Update the documentation to clarify this.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/pm/amdgpu_pm.c +1
-2@@ -3059,7 +3059,7 @@ static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev,* * hwmon interfaces for GPU power: * -* - power1_average: average power used by the GPU in microWatts +* - power1_average: average power used by the SoC in microWatts. On APUs this includes the CPU. * * - power1_cap_min: minimum cap supported in microWatts * -- 2.39.0
RE: [PATCH 2/2] drm/amdgpu/pm: update hwmon power documentation
In reply to Alex Deucher[AMD Official Use Only - General]
Quoted 34 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, January 13, 2023 12:25 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu/pm: update hwmon power documentationPower reporting is socket power. On APUs this includes the CPU. Update the documentation to clarify this.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/pm/amdgpu_pm.c +1
-1@@ -3059,7 +3059,7 @@ static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev, * * hwmon interfaces for GPU power: * - * - power1_average: average power used by the GPU in microWatts + * - power1_average: average power used by the SoC in microWatts. On APUsthis includes the CPU.
*
* -power1_cap_min: minimum cap supported in microWatts *
--
2.39.0
RE: [PATCH 2/2] drm/amdgpu/pm: update hwmon power documentation
In reply to Alex Deucher[AMD Official Use Only - General]
Quoted 35 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, January 13, 2023 12:25 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu/pm: update hwmon power documentationPower reporting is socket power. On APUs this includes the CPU. Update the documentation to clarify this.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/pm/amdgpu_pm.c +1
-1@@ -3059,7 +3059,7 @@ static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev, * * hwmon interfaces for GPU power: * - * - power1_average: average power used by the GPU in microWatts + * - power1_average: average power used by the SoC in microWatts. OnAPUs this includes the CPU.
*
* -power1_cap_min: minimum cap supported in microWatts *
--
2.39.0
Quoted 5 lines · Alex Deucher
The metrics interface exposes the socket power in W, but apparently RN systems exposed the power as mW. See
commit137aac26a2ed("drm/amdgpu/smu12: fix power reporting on renoir"). So leave RN as mW and use W for CZN/BCL.
Just saw that Jesse is working on a proper patch that fixes this for real based on the firmware versions. So let's take that instead.
Alex
Quoted 28 lines
Fixes 137aac26a2ed ("drm/amdgpu/smu12: fix power reporting on renoir")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +4
-2@@ -1196,7 +1196,10 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu, *value = metrics->AverageUvdActivity /100 ;break ;case METRICS_AVERAGE_SOCKETPOWER : - *value = (metrics->CurrentSocketPower <<8 ) /1000 ; +if (smu->adev->ip_versions[MP1_HWIP ][0 ] ==IP_VERSION (12 ,0 ,0 )) + *value = (metrics->CurrentSocketPower <<8 ) /1000 ;/* mW */ +else + *value = metrics->CurrentSocketPower <<8 ;/* W */ break ;case METRICS_TEMPERATURE_EDGE : *value = (metrics->GfxTemperature / 100) * --2.39.0