Bug 219643 - thinkpad_acpi: Fan control not available since 6.12 for older(?) Ryzen models
Summary: thinkpad_acpi: Fan control not available since 6.12 for older(?) Ryzen models
Status: NEEDINFO
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Fan (show other bugs)
Hardware: AMD Linux
: P3 normal
Assignee: acpi_power-fan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-30 16:57 UTC by Vlastimil Holer
Modified: 2025-02-27 09:27 UTC (History)
3 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
t495s ACPI DSDT disassembly (471.75 KB, text/plain)
2025-02-10 09:15 UTC, Eduard Christian Dumitrescu
Details
proposed patch which disables ACPI fan access for the T495 and T495s (2.20 KB, patch)
2025-02-10 09:16 UTC, Eduard Christian Dumitrescu
Details | Diff
proposed patch which disables the ACPI fan access method for the T495 and T495s (2.33 KB, patch)
2025-02-10 09:41 UTC, Eduard Christian Dumitrescu
Details | Diff
proposed patch which disables the ACPI fan access method for the T495 and T495s and E560 (2.43 KB, patch)
2025-02-27 09:27 UTC, Eduard Christian Dumitrescu
Details | Diff

Description Vlastimil Holer 2024-12-30 16:57:22 UTC
Some older Thinkpad Ryzen models lost abaility to control fan since
kernel 6.12 and it's still not working in latest 6.12.7. Previously, the fan
was controlled via /proc/acpi/ibm/fan since when module option fan_control=1
was set. Currently, then file is present, but any action fails with error:

# cat /proc/acpi/ibm/fan
cat: /proc/acpi/ibm/fan: No such device or address

As complained by some users here, e.g.:
- https://www.reddit.com/r/archlinux/comments/1h02oui/after_i_update_linux_kernel_612_my_thinkpad_cant/
- https://www.reddit.com/r/thinkpad/comments/1h02o38/after_i_update_linux_kernel_612_my_thinkpad_cant/

Kernel log when module is loaded with debugging:
[ 1539.239412] thinkpad_acpi: tpacpi_acpi_handle_locate: Found ACPI handle for ec
[ 1539.239418] thinkpad_acpi: ThinkPad ACPI Extras v0.26
[ 1539.239420] thinkpad_acpi: http://ibm-acpi.sf.net/
[ 1539.239421] thinkpad_acpi: ThinkPad BIOS R12ET64W(1.34 ), EC R12HT64W
[ 1539.239423] thinkpad_acpi: Lenovo ThinkPad T495, model 20NJ0011MC
[ 1539.239669] thinkpad_acpi: tpacpi_acpi_handle_locate: Found ACPI handle for video
[ 1539.239695] thinkpad_acpi: ibm_init: probing for driver
[ 1539.239696] thinkpad_acpi: ibm_init: driver installed
[ 1539.239700] thinkpad_acpi: ibm_init: probing for hotkey
[ 1539.239704] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle HKEY for hkey
[ 1539.239752] thinkpad_acpi: radio switch found; radios are enabled
[ 1539.239755] thinkpad_acpi: hotkey_init: using keymap number 1
[ 1539.239760] thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
[ 1539.239761] thinkpad_acpi: Disabling thinkpad-acpi brightness events by default...
[ 1539.239763] thinkpad_acpi: hotkey_init: enabling firmware HKEY event interface...
[ 1539.240876] thinkpad_acpi: register_tpacpi_subdriver: registering hotkey as an ACPI driver
[ 1539.240963] thinkpad_acpi: ibm_init: hotkey installed
[ 1539.240965] thinkpad_acpi: ibm_init: probing for bluetooth
[ 1539.240971] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle HKEY for hkey
[ 1539.241128] thinkpad_acpi: tpacpi_rfk_hook_set_block: request to change radio state to unblocked
[ 1539.242350] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked
[ 1539.242354] thinkpad_acpi: ibm_init: bluetooth installed
[ 1539.242365] thinkpad_acpi: ibm_init: probing for wan
[ 1539.242380] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle HKEY for hkey
[ 1539.242433] thinkpad_acpi: wan_init: wan hardware not installed
[ 1539.242435] thinkpad_acpi: ibm_init: probing for video
[ 1539.242443] thinkpad_acpi: ibm_init: probing for kbdlight
[ 1539.242447] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle HKEY for hkey
[ 1539.251956] thinkpad_acpi: ibm_init: kbdlight installed
[ 1539.251965] thinkpad_acpi: ibm_init: probing for light
[ 1539.251988] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle \CMOS for cmos
[ 1539.253217] thinkpad_acpi: ibm_init: light installed
[ 1539.253224] thinkpad_acpi: ibm_init: probing for cmos
[ 1539.253247] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle \CMOS for cmos
[ 1539.253249] thinkpad_acpi: ibm_init: cmos installed
[ 1539.253251] thinkpad_acpi: ibm_init: probing for led
[ 1539.253425] thinkpad_acpi: ibm_init: led installed
[ 1539.253428] thinkpad_acpi: ibm_init: probing for beep
[ 1539.253432] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle BEEP for beep
[ 1539.253433] thinkpad_acpi: ibm_init: beep installed
[ 1539.253436] thinkpad_acpi: ibm_init: probing for thermal
[ 1539.265981] thinkpad_acpi: ibm_init: thermal installed
[ 1539.265992] thinkpad_acpi: ibm_init: probing for brightness
[ 1539.265996] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
[ 1539.265999] thinkpad_acpi: ibm_init: probing for volume
[ 1539.266001] thinkpad_acpi: volume_init: driver auto-selected volume_mode=3
[ 1539.266459] thinkpad_acpi: volume_set_software_mute: Initial HAUM setting was 3
[ 1539.269361] thinkpad_acpi: volume_set_mute: trying to unmute
[ 1539.270419] thinkpad_acpi: volume_get_status_ec: status 0x00
[ 1539.271909] thinkpad_acpi: ibm_init: volume installed
[ 1539.271916] thinkpad_acpi: ibm_init: probing for fan
[ 1539.271925] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle FANG for fang
[ 1539.271929] thinkpad_acpi: drv_acpi_handle_init: Found ACPI handle FANW for fanw
[ 1539.277394] thinkpad_acpi: tpacpi_rfk_hook_set_block: request to change radio state to unblocked
[ 1539.313424] thinkpad_acpi: ibm_init: fan installed
[ 1539.313442] thinkpad_acpi: ibm_init: probing for mute_led
[ 1539.342775] thinkpad_acpi: ibm_init: mute_led installed
[ 1539.342786] thinkpad_acpi: ibm_init: probing for battery
[ 1539.358401] thinkpad_acpi: battery 1 registered (start 50, stop 85, behaviours: 0x7)
[ 1539.358444] ACPI: battery: new extension: ThinkPad Battery Extension
[ 1539.358451] thinkpad_acpi: ibm_init: battery installed
[ 1539.358457] thinkpad_acpi: ibm_init: probing for lcdshadow
[ 1539.358470] thinkpad_acpi: ibm_init: lcdshadow installed
[ 1539.358481] thinkpad_acpi: ibm_init: probing for proximity-sensor
[ 1539.359141] thinkpad_acpi: ibm_init: proximity-sensor installed
[ 1539.359148] thinkpad_acpi: ibm_init: probing for dytc-profile
[ 1539.359475] thinkpad_acpi: ibm_init: probing for kbdlang
[ 1539.359835] thinkpad_acpi: ibm_init: kbdlang installed
[ 1539.359842] thinkpad_acpi: ibm_init: probing for dprc
[ 1539.359851] thinkpad_acpi: ibm_init: probing for auxmac
[ 1539.359864] thinkpad_acpi: ibm_init: auxmac installed
[ 1539.360337] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input59
[ 1539.361395] thinkpad_acpi: tpacpi_rfk_hook_set_block: request to change radio state to unblocked
[ 1539.367277] thinkpad_acpi: tpacpi_rfk_hook_set_block: request to change radio state to unblocked
[ 1539.647328] thinkpad_acpi: tpacpi_rfk_hook_set_block: request to change radio state to unblocked
[ 1539.648853] thinkpad_acpi: tpacpi_rfk_hook_set_block: request to change radio state to unblocked
Comment 1 Vlastimil Holer 2024-12-30 16:58:48 UTC
Reported hardware:
- Thinkpad T495
- AMD Ryzen 5 PRO 3500U
- Kernel 6.12.7
Comment 2 Artem S. Tashkinov 2024-12-30 20:19:14 UTC
Since this is a regression, please bisect:

https://docs.kernel.org/admin-guide/bug-bisect.html
Comment 3 crok 2025-02-08 15:01:40 UTC
Hello Everyone,


It looks like I have the very same laptop and the very same problem (Thinkpad T495 && AMD Ryzen 5 PRO 3500U).

DMESG:
[ 1.453359] thinkpad_acpi: ThinkPad ACPI Extras v0.26
[ 1.453365] thinkpad_acpi: http://ibm-acpi.sf.net/
[ 1.453367] thinkpad_acpi: ThinkPad BIOS R12ET64W(1.34 ), EC R12HT64W
[ 1.453370] thinkpad_acpi: Lenovo ThinkPad T495, model 20NKS0MF00
[ 1.453831] thinkpad_acpi: radio switch found; radios are enabled
[ 1.453845] thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
[ 1.453847] thinkpad_acpi: Disabling thinkpad-acpi brightness events by default…
[ 1.459443] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked
[ 1.478073] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
[ 1.544670] thinkpad_acpi: battery 1 registered (start 95, stop 100, behaviours: 0x7)
[ 1.546536] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input5

Do work with kernel 6.6 using the very same module options (options thinkpad_acpi fan_control=1 with and without experimental=1) but on 6.12.12-1-lts and never worked with any version of 6.12.
Comment 4 Eduard Christian Dumitrescu 2025-02-10 09:14:13 UTC
I have performed the bisection. The bug was introduced in commit 57d0557dfa4940919ec2971245a6d288e5d85aa8 which adds a new fan control method via the FANG and FANW ACPI methods. In particular, have a look at the `fan_init` method.

The T495s laptop has the FANG+FANW ACPI methods (therefore `fang_handle!=NULL` and `fanw_handle!=NULL`) but they do not actually work, which results in the dreaded "No such device or address" error. Fan access and control is restored after forcing the legacy non-ACPI fan control method by setting both `fang_handle` and `fanw_handle` to NULL.

I speculate that the underlying cause is related to the following dmesg line:

    thinkpad_acpi: secondary fan control detected & enabled

The DSDT table code for the FANG+FANW methods doesn't seem to do anything special regarding the fan being secondary, but I am not an ACPI expert. I will attach the relevant dump file anyway. I also note that the current thinkpad_acpi module FANG+FANW code does not handle secondary fans in any way.

Finally, I am attaching my patch which adds a quirk for T495 and T495s to make them avoid the FANG/FANW methods.
Comment 5 Eduard Christian Dumitrescu 2025-02-10 09:15:33 UTC
Created attachment 307606 [details]
t495s ACPI DSDT disassembly
Comment 6 Eduard Christian Dumitrescu 2025-02-10 09:16:28 UTC
Created attachment 307607 [details]
proposed patch which disables ACPI fan access for the T495 and T495s
Comment 7 Eduard Christian Dumitrescu 2025-02-10 09:41:57 UTC
Created attachment 307608 [details]
proposed patch which disables the ACPI fan access method for the T495 and T495s

Ah I should have diff'd against 6.13, not an older version.
Comment 8 crok 2025-02-10 09:49:47 UTC
Hi,

It was very kind of you, thanks a ton! Hopefully it will be merged soon. Can I -somehow- test it myself in an easy way?
Comment 9 Seyediman Seyedarab 2025-02-25 08:21:35 UTC
(In reply to Eduard Christian Dumitrescu from comment #7)
> Created attachment 307608 [details]
> proposed patch which disables the ACPI fan access method for the T495 and
> T495s
> 
> Ah I should have diff'd against 6.13, not an older version.

Check out this commit in mainline at v6.14-rc341^24:
1046cac109225eda0973b898e053aeb3d6c10e1d

The attribute you used in your patch is already in use:
+#define TPACPI_FAN_TPR         0x0040          /* Fan speed is in Ticks Per Revolution */
Comment 10 Seyediman Seyedarab 2025-02-25 08:35:19 UTC
(In reply to Seyediman Seyedarab from comment #9)
> (In reply to Eduard Christian Dumitrescu from comment #7)
> > Created attachment 307608 [details]
> > proposed patch which disables the ACPI fan access method for the T495 and
> > T495s
> > 
> > Ah I should have diff'd against 6.13, not an older version.
> 
> Check out this commit in mainline at v6.14-rc341^24:
> 1046cac109225eda0973b898e053aeb3d6c10e1d
> 
> The attribute you used in your patch is already in use:
> +#define TPACPI_FAN_TPR         0x0040          /* Fan speed is in Ticks Per
> Revolution */

My apologies, I meant v6.14-rc3~41^2~4.

Also, users with the E560 experience the same issue, and this does the trick:
TPACPI_Q_LNV3('R', '0', '0', TPACPI_FAN_NOACPI); /* E560 */
Maybe you should add this to your patch too.
Comment 11 Eduard Christian Dumitrescu 2025-02-27 09:27:32 UTC
Created attachment 307719 [details]
proposed patch which disables the ACPI fan access method for the T495 and T495s and E560

Updated patch against v6.14-rc4 because a conflicting flag was added. Also added affected model E560 as reported by Seyediman Seyedarab.

Note You need to log in before you can comment on or make changes to this bug.