<div dir="ltr"><div>Sorry, but do anybody know about this? <br></div><div>I hope my message is not lost. <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 3, 2023 at 9:38 PM Yury Zhuravlev <<a href="mailto:stalkerg@gmail.com">stalkerg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello!</div><div><br></div><div>Why is this revert for revert coming for 6.1 but reverted again for 6.1.2? My GPU is not working correctly again!</div><div><a href="https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.2" target="_blank">https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.2</a></div><div><br></div><div>It seems like somebody made a mistake and pick up the wrong patch for the stable channel. <br></div><div><br></div><div>Regards!<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 19, 2022 at 11:14 AM Sasha Levin <<a href="mailto:sashal@kernel.org" target="_blank">sashal@kernel.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Asher Song <<a href="mailto:Asher.Song@amd.com" target="_blank">Asher.Song@amd.com</a>><br>
<br>
[ Upstream commit 30b8e7b8ee3be003e0df85c857c5cd0e0bd58b82 ]<br>
<br>
This reverts commit 4545ae2ed3f2f7c3f615a53399c9c8460ee5bca7.<br>
<br>
The origin patch "drm/amdgpu: getting fan speed pwm for vega10 properly" works fine.<br>
Test failure is caused by test case self.<br>
<br>
Signed-off-by: Asher Song <<a href="mailto:Asher.Song@amd.com" target="_blank">Asher.Song@amd.com</a>><br>
Reviewed-by: Guchun Chen <<a href="mailto:guchun.chen@amd.com" target="_blank">guchun.chen@amd.com</a>><br>
Signed-off-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com" target="_blank">alexander.deucher@amd.com</a>><br>
Signed-off-by: Sasha Levin <<a href="mailto:sashal@kernel.org" target="_blank">sashal@kernel.org</a>><br>
---<br>
 .../amd/pm/powerplay/hwmgr/vega10_thermal.c   | 25 +++++++++----------<br>
 1 file changed, 12 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c<br>
index dad3e3741a4e..190af79f3236 100644<br>
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c<br>
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c<br>
@@ -67,22 +67,21 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,<br>
 int vega10_fan_ctrl_get_fan_speed_pwm(struct pp_hwmgr *hwmgr,<br>
                uint32_t *speed)<br>
 {<br>
-       uint32_t current_rpm;<br>
-       uint32_t percent = 0;<br>
-<br>
-       if (hwmgr->thermal_controller.fanInfo.bNoFan)<br>
-               return 0;<br>
+       struct amdgpu_device *adev = hwmgr->adev;<br>
+       uint32_t duty100, duty;<br>
+       uint64_t tmp64;<br>
<br>
-       if (vega10_get_current_rpm(hwmgr, &current_rpm))<br>
-               return -1;<br>
+       duty100 = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL1),<br>
+                               CG_FDO_CTRL1, FMAX_DUTY100);<br>
+       duty = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_THERMAL_STATUS),<br>
+                               CG_THERMAL_STATUS, FDO_PWM_DUTY);<br>
<br>
-       if (hwmgr->thermal_controller.<br>
-                       advanceFanControlParameters.usMaxFanRPM != 0)<br>
-               percent = current_rpm * 255 /<br>
-                       hwmgr->thermal_controller.<br>
-                       advanceFanControlParameters.usMaxFanRPM;<br>
+       if (!duty100)<br>
+               return -EINVAL;<br>
<br>
-       *speed = MIN(percent, 255);<br>
+       tmp64 = (uint64_t)duty * 255;<br>
+       do_div(tmp64, duty100);<br>
+       *speed = MIN((uint32_t)tmp64, 255);<br>
<br>
        return 0;<br>
 }<br>
-- <br>
2.35.1<br>
<br>
</blockquote></div>
</blockquote></div>