drm/amdgpu/pm: Fix the error of pwm1_enable setting
Subsystems (3)
PATCH 1/1 drm/amdgpu/pm: Fix the error of pwm1_enable setting
Fix the pwm_mode value error which used forpwm1_enable setting
Signed-off-by Ma Jun <[email protected]>
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +11 -1
@@ -2582,6 +2582,7 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,struct amdgpu_device *adev =dev_get_drvdata (dev);int err, ret;int value; +u32 pwm_mode;if (amdgpu_in_reset (adev))return -EPERM ;
@@ -2592,13 +2593,22 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,if (err)return err; +if (value ==0 ) + pwm_mode =AMD_FAN_CTRL_NONE ; +else if (value ==1 ) + pwm_mode =AMD_FAN_CTRL_MANUAL ; +else if (value ==2 ) + pwm_mode =AMD_FAN_CTRL_AUTO ; +else +return -EINVAL ; + ret =pm_runtime_get_sync (adev_to_drm (adev)->dev);if (ret <0 ) {pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);return ret; } - ret =amdgpu_dpm_set_fan_control_mode (adev, value); + ret =amdgpu_dpm_set_fan_control_mode (adev, pwm_mode);pm_runtime_mark_last_busy (adev_to_drm (adev)->dev);pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);
Signature · 1 line
2.34.1
Quoted 13 lines · Ma Jun
Fix the
pwm_modevalue error which used forpwm1_enablesettingSigned-off-by Ma Jun <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/pm/amdgpu_pm.c +0
-0
drivers/gpu/drm/amd/pm/amdgpu_pm.c static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev, · line 2586
Quoted 5 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +1
-0@@ -2582,6 +2582,7 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,struct amdgpu_device *adev =dev_get_drvdata (dev);int err, ret;int value; +u32 pwm_mode;
You may move this declaration up to follow reverse Christmas tree order.
Reviewed-by Lijo Lazar <[email protected]>
Thanks,
Lijo
Quoted 26 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +10
-1if (amdgpu_in_reset (adev))return -EPERM ;@@ -2592,13 +2593,22 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,if (err)return err; +if (value ==0 ) + pwm_mode =AMD_FAN_CTRL_NONE ; +else if (value ==1 ) + pwm_mode =AMD_FAN_CTRL_MANUAL ; +else if (value ==2 ) + pwm_mode =AMD_FAN_CTRL_AUTO ; +else +return -EINVAL ; + ret =pm_runtime_get_sync (adev_to_drm (adev)->dev);if (ret <0 ) {pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);return ret; } - ret =amdgpu_dpm_set_fan_control_mode (adev, value); + ret =amdgpu_dpm_set_fan_control_mode (adev, pwm_mode);pm_runtime_mark_last_busy (adev_to_drm (adev)->dev);pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);
Quoted 11 lines · Lijo
Quoted 8 lines · Ma Jun
Fix the
pwm_modevalue error which used forpwm1_enablesettingSigned-off-by Ma Jun <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
Quoted 12 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev, · line 2586
Quoted 10 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +1
-0@@ -2582,6 +2582,7 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,struct amdgpu_device *adev =dev_get_drvdata (dev);int err, ret;int value; +u32 pwm_mode;You may move this declaration up to follow reverse Christmas tree order.
Thanks, will fix it when submit.
Regards,
Ma Jun
Quoted 31 lines
Reviewed-by Lijo Lazar <[email protected]>Thanks,
LijoQuoted 26 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +10
-1if (amdgpu_in_reset (adev))return -EPERM ;@@ -2592,13 +2593,22 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,if (err)return err; +if (value ==0 ) + pwm_mode =AMD_FAN_CTRL_NONE ; +else if (value ==1 ) + pwm_mode =AMD_FAN_CTRL_MANUAL ; +else if (value ==2 ) + pwm_mode =AMD_FAN_CTRL_AUTO ; +else +return -EINVAL ; + ret =pm_runtime_get_sync (adev_to_drm (adev)->dev);if (ret <0 ) {pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);return ret; } - ret =amdgpu_dpm_set_fan_control_mode (adev, value); + ret =amdgpu_dpm_set_fan_control_mode (adev, pwm_mode);pm_runtime_mark_last_busy (adev_to_drm (adev)->dev);pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);