[PATCH 1/4] drm/amd/powerplay: show the right unit for the temp printed out

Deucher, Alexander Alexander.Deucher at amd.com
Sat Dec 30 18:28:40 UTC 2017


I don't think the hwmon interface should expose the units in the string, this will probably break some applications that use the hwmon interface.  They are assumed to be milli-degrees celsius as per the API.


Alex


________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Evan Quan <evan.quan at amd.com>
Sent: Friday, December 29, 2017 2:44 AM
To: amd-gfx at lists.freedesktop.org
Cc: Quan, Evan
Subject: [PATCH 1/4] drm/amd/powerplay: show the right unit for the temp printed out

Change-Id: I30ea29aa85ab89c0017ecb4e0ab469db5ab5c103
Signed-off-by: Evan Quan <evan.quan at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 814329b..91f809e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -789,7 +789,7 @@ static ssize_t amdgpu_hwmon_show_temp(struct device *dev,
         else
                 temp = amdgpu_dpm_get_temperature(adev);

-       return snprintf(buf, PAGE_SIZE, "%d\n", temp);
+       return snprintf(buf, PAGE_SIZE, "%d millicelsius\n", temp);
 }

 static ssize_t amdgpu_hwmon_show_temp_thresh(struct device *dev,
@@ -805,7 +805,7 @@ static ssize_t amdgpu_hwmon_show_temp_thresh(struct device *dev,
         else
                 temp = adev->pm.dpm.thermal.max_temp;

-       return snprintf(buf, PAGE_SIZE, "%d\n", temp);
+       return snprintf(buf, PAGE_SIZE, "%d millicelsius\n", temp);
 }

 static ssize_t amdgpu_hwmon_get_pwm1_enable(struct device *dev,
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20171230/6198cc5d/attachment.html>


More information about the amd-gfx mailing list