drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"
Subsystems (3)
PATCH 1/1 drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"
This reverts commit fe01cb24b81c0091d7e5668874d51ce913e44a97.
Unfortunately, that commit causes fan monitors can't be read and written properly.
--- .../amd/pm/powerplay/hwmgr/vega10_thermal.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +13 -12
@@ -67,21 +67,22 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,int vega10_fan_ctrl_get_fan_speed_pwm (struct pp_hwmgr *hwmgr,uint32_t *speed) { -struct amdgpu_device *adev = hwmgr->adev; -uint32_t duty100, duty; -uint64_t tmp64; +uint32_t current_rpm; +uint32_t percent =0 ; - duty100 =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_FDO_CTRL1), -CG_FDO_CTRL1 ,FMAX_DUTY100 ); - duty =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_THERMAL_STATUS), -CG_THERMAL_STATUS ,FDO_PWM_DUTY ); +if (hwmgr->thermal_controller.fanInfo.bNoFan) +return 0 ; -if (!duty100) -return -EINVAL ; +if (vega10_get_current_rpm (hwmgr, ¤t_rpm)) +return -1 ; + +if (hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM !=0 ) + percent = current_rpm *255 / + hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM; - tmp64 = (uint64_t )duty *255 ; -do_div (tmp64, duty100); - *speed =MIN ((uint32_t )tmp64,255 ); + *speed =MIN (percent,255 );return 0 ; }
Signature · 1 line
2.25.1
Regards,
Guchun
-----Original Message-----
From: Song, Asher <[email protected]>
Sent: Friday, October 14, 2022 12:15 PM
To: Deucher, Alexander <[email protected]>; [email protected]; Chen, Guchun <[email protected]>; Quan, Evan <[email protected]>; [email protected]
Cc: Song, Asher <[email protected]>
Subject: [PATCH] drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"
This reverts commit fe01cb24b81c0091d7e5668874d51ce913e44a97.
Unfortunately, that commit causes fan monitors can't be read and written properly.
--- .../amd/pm/powerplay/hwmgr/vega10_thermal.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +13 -13
@@ -67,21 +67,22 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr, int vega10_fan_ctrl_get_fan_speed_pwm(struct pp_hwmgr *hwmgr, uint32_t *speed) { -struct amdgpu_device *adev = hwmgr->adev; -uint32_t duty100, duty; -uint64_t tmp64; +uint32_t current_rpm; +uint32_t percent =0 ; - duty100 =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_FDO_CTRL1), -CG_FDO_CTRL1 ,FMAX_DUTY100 ); - duty =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_THERMAL_STATUS), -CG_THERMAL_STATUS ,FDO_PWM_DUTY ); +if (hwmgr->thermal_controller.fanInfo.bNoFan) +return 0 ; -if (!duty100) -return -EINVAL ; +if (vega10_get_current_rpm (hwmgr, ¤t_rpm)) +return -1 ; + +if (hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM !=0 ) + percent = current_rpm *255 / + hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM; - tmp64 = (uint64_t )duty *255 ; -do_div (tmp64, duty100); - *speed =MIN ((uint32_t )tmp64,255 ); + *speed =MIN (percent,255 );return 0 ; } --
2.25.1
It's working 100% time correctly on my Vega 56 it was a reason why I did it because without it returns mostly random data.
Quoted 55 lines · Asher Song
This reverts commit
fe01cb24b81c0091d7e5668874d51ce913e44a97.Unfortunately, that commit causes fan monitors can't be read and written properly.
Signed-off-by Asher Song <[email protected]>--- .../amd/pm/powerplay/hwmgr/vega10_thermal.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +13
-12@@ -67,21 +67,22 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,int vega10_fan_ctrl_get_fan_speed_pwm (struct pp_hwmgr *hwmgr,uint32_t *speed) { -struct amdgpu_device *adev = hwmgr->adev; -uint32_t duty100, duty; -uint64_t tmp64; +uint32_t current_rpm; +uint32_t percent =0 ; - duty100 =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_FDO_CTRL1), -CG_FDO_CTRL1 ,FMAX_DUTY100 ); - duty =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_THERMAL_STATUS), -CG_THERMAL_STATUS ,FDO_PWM_DUTY ); +if (hwmgr->thermal_controller.fanInfo.bNoFan) +return 0 ; -if (!duty100) -return -EINVAL ; +if (vega10_get_current_rpm (hwmgr, ¤t_rpm)) +return -1 ; + +if (hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM !=0 ) + percent = current_rpm *255 / + hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM; - tmp64 = (uint64_t )duty *255 ; -do_div (tmp64, duty100); - *speed =MIN ((uint32_t )tmp64,255 ); + *speed =MIN (percent,255 );return 0 ;}
--
2.25.1
Hello,
Can you write here your card name and firmware version? Without this patch, my fan sensors are broken, and it's sensitive to my pc case with water cooling.
My card is: Sapphire Pulse Radeon RX Vega 56 vd6546 SA
lspci name: [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] (rev c3)
Firmware: ATOM BIOS: 113-376XL-UO2
This patch is 100% working correct on my machine, and I tested it last 2 months.
Regards,
Quoted 55 lines · Asher Song
This reverts commit
fe01cb24b81c0091d7e5668874d51ce913e44a97.Unfortunately, that commit causes fan monitors can't be read and written properly.
Signed-off-by Asher Song <[email protected]>--- .../amd/pm/powerplay/hwmgr/vega10_thermal.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +13
-12@@ -67,21 +67,22 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,int vega10_fan_ctrl_get_fan_speed_pwm (struct pp_hwmgr *hwmgr,uint32_t *speed) { -struct amdgpu_device *adev = hwmgr->adev; -uint32_t duty100, duty; -uint64_t tmp64; +uint32_t current_rpm; +uint32_t percent =0 ; - duty100 =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_FDO_CTRL1), -CG_FDO_CTRL1 ,FMAX_DUTY100 ); - duty =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_THERMAL_STATUS), -CG_THERMAL_STATUS ,FDO_PWM_DUTY ); +if (hwmgr->thermal_controller.fanInfo.bNoFan) +return 0 ; -if (!duty100) -return -EINVAL ; +if (vega10_get_current_rpm (hwmgr, ¤t_rpm)) +return -1 ; + +if (hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM !=0 ) + percent = current_rpm *255 / + hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM; - tmp64 = (uint64_t )duty *255 ; -do_div (tmp64, duty100); - *speed =MIN ((uint32_t )tmp64,255 ); + *speed =MIN (percent,255 );return 0 ;}
--
2.25.1
[AMD Official Use Only - General]
+@Meng, Xiaohu<mailto:[email protected]>
Hi Zhuravlev,
The information of test card is as following:
Lspci name: [AMD/ATI] Vega 10 [Radeon Instinct MI25 MxGPU] (rev 05)
Firmware: ATOM BIOS: 113-D0531800-C04
When run test scripts compute-rocm-*/utils/run_rsmitst.sh, the below test cases fail.
[ FAILED ] 4 tests, listed below: [ FAILED ] rsmitstReadOnly.TestOverdriveRead [ FAILED ] rsmitstReadWrite.FanReadWrite [ FAILED ] rsmitstReadWrite.TestOverdriveReadWrite [ FAILED ] rsmitstReadWrite.TestPowerCapReadWrite
Best Regards,
Asher
From: Yury Zhuravlev <[email protected]>
Sent: Wednesday, October 26, 2022 9:31 AM
To: Song, Asher <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"
Hello,
Can you write here your card name and firmware version? Without this patch, my fan sensors are broken, and it's sensitive to my pc case with water cooling. My card is: Sapphire Pulse Radeon RX Vega 56 vd6546 SA
lspci name: [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] (rev c3)
Firmware: ATOM BIOS: 113-376XL-UO2
This patch is 100% working correct on my machine, and I tested it last 2 months.
Regards,
On Fri, Oct 14, 2022 at 1:15 PM Asher Song <[email protected]<mailto:[email protected]>> wrote:
This reverts commit fe01cb24b81c0091d7e5668874d51ce913e44a97.
Unfortunately, that commit causes fan monitors can't be read and written properly.
--- .../amd/pm/powerplay/hwmgr/vega10_thermal.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +13 -12
@@ -67,21 +67,22 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,int vega10_fan_ctrl_get_fan_speed_pwm (struct pp_hwmgr *hwmgr,uint32_t *speed) { -struct amdgpu_device *adev = hwmgr->adev; -uint32_t duty100, duty; -uint64_t tmp64; +uint32_t current_rpm; +uint32_t percent =0 ; - duty100 =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_FDO_CTRL1), -CG_FDO_CTRL1 ,FMAX_DUTY100 ); - duty =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_THERMAL_STATUS), -CG_THERMAL_STATUS ,FDO_PWM_DUTY ); +if (hwmgr->thermal_controller.fanInfo.bNoFan) +return 0 ; -if (!duty100) -return -EINVAL ; +if (vega10_get_current_rpm (hwmgr, ¤t_rpm)) +return -1 ; + +if (hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM !=0 ) + percent = current_rpm *255 / + hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM; - tmp64 = (uint64_t )duty *255 ; -do_div (tmp64, duty100); - *speed =MIN ((uint32_t )tmp64,255 ); + *speed =MIN (percent,255 );return 0 ; }
--
2.25.1
Hello Asher,
Thanks for the information, is it open-source tests? Can I reproduce it?
Also, it seems like Radeon Instinct MI25 was released before Radeon RX Vega, is it possible that they have different PowerPlay subsystems? On my Vega56, all these registers from vega20 are working very well. Seems like we should split implementation somehow.
Regards,
Quoted 121 lines · Asher
[AMD Official Use Only - General]
+@Meng, Xiaohu <[email protected]>
Hi Zhuravlev,
The information of test card is as following:
Lspci name: [AMD/ATI] Vega 10 [Radeon Instinct MI25 MxGPU] (rev 05)
Firmware: ATOM BIOS: 113-D0531800-C04
When run test scripts
compute-rocm-*/utils/run_rsmitst.sh, the below test cases fail.[ FAILED ] 4 tests, listed below:
[ FAILED ] rsmitstReadOnly.TestOverdriveRead
[ FAILED ] rsmitstReadWrite.FanReadWrite
[ FAILED ] rsmitstReadWrite.TestOverdriveReadWrite
[ FAILED ] rsmitstReadWrite.TestPowerCapReadWrite
Best Regards,
Asher
*From:* Yury Zhuravlev <[email protected]>
*Sent:* Wednesday, October 26, 2022 9:31 AM
*To:* Song, Asher <[email protected]>
*Cc:* Deucher, Alexander <[email protected]>; Chen, Guchun < [email protected]>; Quan, Evan <[email protected]>; [email protected]
*Subject:* Re: [PATCH] drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"Hello,
Can you write here your card name and firmware version? Without this patch, my fan sensors are broken, and it's sensitive to my pc case with water cooling.
My card is: Sapphire Pulse Radeon RX Vega 56 vd6546 SA lspci name: [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] (rev c3)
Firmware: ATOM BIOS: 113-376XL-UO2
This patch is 100% working correct on my machine, and I tested it last 2 months.Regards,
On Fri, Oct 14, 2022 at 1:15 PM Asher Song <[email protected]> wrote:
This reverts commit
fe01cb24b81c0091d7e5668874d51ce913e44a97.Unfortunately, that commit causes fan monitors can't be read and written properly.
Signed-off-by Asher Song <[email protected]>--- .../amd/pm/powerplay/hwmgr/vega10_thermal.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +13
-12@@ -67,21 +67,22 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,int vega10_fan_ctrl_get_fan_speed_pwm (struct pp_hwmgr *hwmgr,uint32_t *speed) { -struct amdgpu_device *adev = hwmgr->adev; -uint32_t duty100, duty; -uint64_t tmp64; +uint32_t current_rpm; +uint32_t percent =0 ; - duty100 =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_FDO_CTRL1), -CG_FDO_CTRL1 ,FMAX_DUTY100 ); - duty =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_THERMAL_STATUS), -CG_THERMAL_STATUS ,FDO_PWM_DUTY ); +if (hwmgr->thermal_controller.fanInfo.bNoFan) +return 0 ; -if (!duty100) -return -EINVAL ; +if (vega10_get_current_rpm (hwmgr, ¤t_rpm)) +return -1 ; + +if (hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM !=0 ) + percent = current_rpm *255 / + hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM; - tmp64 = (uint64_t )duty *255 ; -do_div (tmp64, duty100); - *speed =MIN ((uint32_t )tmp64,255 ); + *speed =MIN (percent,255 );return 0 ;}
--
2.25.1
Quoted 6 lines · Yury Zhuravlev
Hello Asher,
Thanks for the information, is it open-source tests? Can I reproduce it?
Also, it seems like Radeon Instinct MI25 was released before Radeon RX Vega, is it possible that they have different PowerPlay subsystems?
Same silicon, same powerplay implementation.
Alex
Quoted 117 lines
On my Vega56, all these registers from vega20 are working very well. Seems like we should split implementation somehow.
Regards,
Quoted 111 lines · Asher
[AMD Official Use Only - General]
+@Meng, Xiaohu
Hi Zhuravlev,
The information of test card is as following:
Lspci name: [AMD/ATI] Vega 10 [Radeon Instinct MI25 MxGPU] (rev 05)
Firmware: ATOM BIOS: 113-D0531800-C04
When run test scripts
compute-rocm-*/utils/run_rsmitst.sh, the below test cases fail.[ FAILED ] 4 tests, listed below:
[ FAILED ] rsmitstReadOnly.TestOverdriveRead
[ FAILED ] rsmitstReadWrite.FanReadWrite
[ FAILED ] rsmitstReadWrite.TestOverdriveReadWrite
[ FAILED ] rsmitstReadWrite.TestPowerCapReadWrite
Best Regards,
Asher
From: Yury Zhuravlev <[email protected]>
Sent: Wednesday, October 26, 2022 9:31 AM
To: Song, Asher <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"Hello,
Can you write here your card name and firmware version? Without this patch, my fan sensors are broken, and it's sensitive to my pc case with water cooling. My card is: Sapphire Pulse Radeon RX Vega 56 vd6546 SA
lspci name: [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] (rev c3)
Firmware: ATOM BIOS: 113-376XL-UO2
This patch is 100% working correct on my machine, and I tested it last 2 months.Regards,
On Fri, Oct 14, 2022 at 1:15 PM Asher Song <[email protected]> wrote:
This reverts commit
fe01cb24b81c0091d7e5668874d51ce913e44a97.Unfortunately, that commit causes fan monitors can't be read and written properly.
Signed-off-by Asher Song <[email protected]>--- .../amd/pm/powerplay/hwmgr/vega10_thermal.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +13
-13@@ -67,21 +67,22 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,int vega10_fan_ctrl_get_fan_speed_pwm (struct pp_hwmgr *hwmgr,uint32_t *speed) { -struct amdgpu_device *adev = hwmgr->adev; -uint32_t duty100, duty; -uint64_t tmp64; +uint32_t current_rpm; +uint32_t percent =0 ; - duty100 =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_FDO_CTRL1), -CG_FDO_CTRL1 ,FMAX_DUTY100 ); - duty =REG_GET_FIELD (RREG32_SOC15 (THM ,0 , mmCG_THERMAL_STATUS), -CG_THERMAL_STATUS ,FDO_PWM_DUTY ); +if (hwmgr->thermal_controller.fanInfo.bNoFan) +return 0 ; -if (!duty100) -return -EINVAL ; +if (vega10_get_current_rpm (hwmgr, ¤t_rpm)) +return -1 ; + +if (hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM !=0 ) + percent = current_rpm *255 / + hwmgr->thermal_controller. + advanceFanControlParameters.usMaxFanRPM; - tmp64 = (uint64_t )duty *255 ; -do_div (tmp64, duty100); - *speed =MIN ((uint32_t )tmp64,255 ); + *speed =MIN (percent,255 );return 0 ; } --2.25.1
Quoted 11 lines · Alex Deucher
Quoted 6 lines · Yury Zhuravlev
Hello Asher,
Thanks for the information, is it open-source tests? Can I reproduce it?
Also, it seems like Radeon Instinct MI25 was released before Radeon RX
Vega, is it possible that they have different PowerPlay subsystems?
Same silicon, same powerplay implementation.
Okay, what it means? Can I know what exactly you are tested by "rsmitstReadWrite.FanReadWrite"?
I am working now with my patch, and I definitely can read and write fan speed by PWM.
How can I help to solve this problem?
Regards,
This stuff I assume:
https://github.com/RadeonOpenCompute/rocm_smi_lib/tree/master/tests/rocm_smi_test
Regards
Den ons 26 okt. 2022 kl 17:43 skrev Yury Zhuravlev <[email protected]>:
Quoted 26 lines
Quoted 12 lines · Alex Deucher
Quoted 6 lines · Yury Zhuravlev
Hello Asher,
Thanks for the information, is it open-source tests? Can I reproduce it?
Also, it seems like Radeon Instinct MI25 was released before Radeon RX
Vega, is it possible that they have different PowerPlay subsystems?
Same silicon, same powerplay implementation.
Okay, what it means? Can I know what exactly you are tested by "rsmitstReadWrite.FanReadWrite"?
I am working now with my patch, and I definitely can read and write fan speed by PWM.
How can I help to solve this problem?Regards,