Bug 110213 - Used pwm value is lesser than the requested value
Summary: Used pwm value is lesser than the requested value
Status: RESOLVED NOTABUG
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/AMDgpu (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-20 16:50 UTC by jpalaciosdev
Modified: 2019-03-21 02:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
dmesg (73.37 KB, text/plain)
2019-03-20 16:50 UTC, jpalaciosdev
no flags Details

Description jpalaciosdev 2019-03-20 16:50:24 UTC
Created attachment 143743 [details]
dmesg

On manual fan control through pwm interface, the used value on pwm1 is lesser that the requested value (except for maximum).
For example:
echo 1 > /sys/class/drm/card0/device/hwmon/hwmon1/pwm1_enable

echo 10 > /sys/class/drm/card0/device/hwmon/hwmon1/pwm1
cat /sys/class/drm/card0/device/hwmon/hwmon1/pwm1
5

echo 100 > /sys/class/drm/card0/device/hwmon/hwmon1/pwm1
cat /sys/class/drm/card0/device/hwmon/hwmon1/pwm1
96

echo 254 > /sys/class/drm/card0/device/hwmon/hwmon1/pwm1
cat /sys/class/drm/card0/device/hwmon/hwmon1/pwm1
249

The maximum value works as expected:
echo 255 > /sys/class/drm/card0/device/hwmon/hwmon1/pwm1
cat /sys/class/drm/card0/device/hwmon/hwmon1/pwm1
255

Other info:
Hardware: MSI RX480 Gaming (Polaris)
Kernel: linux 5.0.2

Please, let me know if more info is needed.
Thanks.
Comment 1 Alex Deucher 2019-03-21 02:36:06 UTC
The hwmon API specifies the range as 0-255, but the hw actually has a different range.  The conversion between ranges for read and writes accounts for the difference.  See smu7_fan_ctrl_get_fan_speed_percent() and smu7_fan_ctrl_set_fan_speed_percent() smu7_thermal.c and amdgpu_hwmon_get_pwm1() and amdgpu_hwmon_set_pwm1() amdgpu_pm.c.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.