All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: wrong control mode cause the fan spins faster unnecessarily
@ 2017-11-01  9:24 Evan Quan
       [not found] ` <1509528283-15171-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Evan Quan @ 2017-11-01  9:24 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

The fan control mode can either be FDO_PWM_MODE_STATIC or FDO_PWM_MODE_STATIC_RPM.
Setting it as AMD_FAN_CTRL_AUTO will cause the fan spin faster wrongly.

This can be reproduced by:
'# cat /sys/class/hwmon/hwmon0/pwm1
   38
'# cat /sys/class/hwmon/hwmon0/pwm1_enable
   2
'# echo "2" > /sys/class/hwmon/hwmon0/pwm1_enable
'# cat /sys/class/hwmon/hwmon0/pwm1
   122
The fan speed get faster wronly even with its original mode echo back.

Change-Id: I51b0586ac17e0d663925c87d548847b31c79d68a
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index 203ef10..4239b98 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4234,7 +4234,7 @@ static void vega10_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
 			vega10_fan_ctrl_stop_smc_fan_control(hwmgr);
 		break;
 	case AMD_FAN_CTRL_AUTO:
-		if (!vega10_fan_ctrl_set_static_mode(hwmgr, mode))
+		if (PP_CAP(PHM_PlatformCaps_MicrocodeFanControl))
 			vega10_fan_ctrl_start_smc_fan_control(hwmgr);
 		break;
 	default:
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/powerplay: wrong control mode cause the fan spins faster unnecessarily
       [not found] ` <1509528283-15171-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2017-11-01 14:16   ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2017-11-01 14:16 UTC (permalink / raw)
  To: Evan Quan; +Cc: amd-gfx list

On Wed, Nov 1, 2017 at 5:24 AM, Evan Quan <evan.quan@amd.com> wrote:
> The fan control mode can either be FDO_PWM_MODE_STATIC or FDO_PWM_MODE_STATIC_RPM.
> Setting it as AMD_FAN_CTRL_AUTO will cause the fan spin faster wrongly.
>
> This can be reproduced by:
> '# cat /sys/class/hwmon/hwmon0/pwm1
>    38
> '# cat /sys/class/hwmon/hwmon0/pwm1_enable
>    2
> '# echo "2" > /sys/class/hwmon/hwmon0/pwm1_enable
> '# cat /sys/class/hwmon/hwmon0/pwm1
>    122
> The fan speed get faster wronly even with its original mode echo back.
>
> Change-Id: I51b0586ac17e0d663925c87d548847b31c79d68a
> Signed-off-by: Evan Quan <evan.quan@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index 203ef10..4239b98 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -4234,7 +4234,7 @@ static void vega10_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
>                         vega10_fan_ctrl_stop_smc_fan_control(hwmgr);
>                 break;
>         case AMD_FAN_CTRL_AUTO:
> -               if (!vega10_fan_ctrl_set_static_mode(hwmgr, mode))
> +               if (PP_CAP(PHM_PlatformCaps_MicrocodeFanControl))
>                         vega10_fan_ctrl_start_smc_fan_control(hwmgr);
>                 break;
>         default:
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-01 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01  9:24 [PATCH] drm/amd/powerplay: wrong control mode cause the fan spins faster unnecessarily Evan Quan
     [not found] ` <1509528283-15171-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org>
2017-11-01 14:16   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.