[PATCH] drm/amdgpu: getting fan speed pwm for vega10 properly
Quan, Evan
Evan.Quan at amd.com
Wed Sep 7 04:33:23 UTC 2022
[Public]
Thanks Alex and Yury.
The changes seem reasonable to me. Feel free to add my RB: Reviewed-by: Evan Quan <evan.quan at amd.com>
BR
Evan
From: Deucher, Alexander <Alexander.Deucher at amd.com>
Sent: Tuesday, September 6, 2022 11:05 PM
To: Yury Zhuravlev <stalkerg at gmail.com>; amd-gfx at lists.freedesktop.org; Quan, Evan <Evan.Quan at amd.com>; Feng, Kenneth <Kenneth.Feng at amd.com>
Subject: Re: [PATCH] drm/amdgpu: getting fan speed pwm for vega10 properly
[Public]
@Quan, Evan<mailto:Evan.Quan at amd.com>, @Feng, Kenneth<mailto:Kenneth.Feng at amd.com> can you take a look?
Thanks,
Alex
________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org<mailto:amd-gfx-bounces at lists.freedesktop.org>> on behalf of Yury Zhuravlev <stalkerg at gmail.com<mailto:stalkerg at gmail.com>>
Sent: Friday, September 2, 2022 1:24 PM
To: amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org> <amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>>
Subject: [PATCH] drm/amdgpu: getting fan speed pwm for vega10 properly
Hello,
During the setup, the fan manager https://github.com/markusressel/fan2go<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmarkusressel%2Ffan2go&data=05%7C01%7Calexander.deucher%40amd.com%7C0903d6788f924045996108da8d086ecb%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637977365572428876%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IOJR10xHaW9cUZ%2Fv0Q%2BZDFFQJ1pbv2dUKP0zpxK4s8M%3D&reserved=0> I found that my Vega56 was not working correctly. This fan manager expects what read PWM value should be the same as you wrote before, but it's not the case. PWM value was volatile, and what is more critical, if I wrote 200, after reading I saw ~70-100, which is very confusing.
After that, I started reading the amdgpu driver, and how fan speed works, and I found what PWM value was calculated from RPM speed and not correct for my case (different BIOS or fan configuration?).
Because it looked wrong, I started looking into different implementations and found that Vega20 used mmCG_FDO_CTRL1 and mmCG_THERMAL_STATUS registers to calculate the PWM value.
I also checked how we set PWM for Vega10 and found the same registers. After that, I copy-pasted the function from Vega20 to Vega10, and it started working much better. It still has some fluctuation, but as I understand, this behavior is expected.
I have no in-depth information about amdgpu, and the original function may have been for some reason (maybe for some broken BIOS?), but I suppose somebody forgot to backport this code after prototype implementation.
It would be my first patch here. Sorry if I skipped some procedures, will be appreciated it if you help me.
Also, sorry for the patch in the attachment, I have not been using any mail programs for the last six years, only web clients, and it's strange to do it nowadays (PRs much more common...).
Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20220907/e653944e/attachment.htm>
More information about the amd-gfx
mailing list