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-04-14 20:20 UTC (History)
4 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
Hearnia_2k's dsdt from a ThinkPad x395 (471.68 KB, text/x-csrc)
2025-04-02 19:54 UTC, hearnia_2k
Details

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.
Comment 12 hearnia_2k 2025-04-02 16:40:39 UTC
This issue also impacts the Thinkpad X395.  

I would not be surprised if it also impacted a T14 Gen 1.  I installed the latest kernel from Fedora Stable-rc, which is 6.14.0-362.vanilla.fc41.x86_64 and I still have the same issue this ticket describes.

I'm happy to provide further information to help resolve this if I can do, however I likely need some pointers or steps to provide helpful information.  

Thanks!
Comment 13 Seyediman Seyedarab 2025-04-02 19:17:17 UTC
(In reply to hearnia_2k from comment #12)
> This issue also impacts the Thinkpad X395.  
> 
> I would not be surprised if it also impacted a T14 Gen 1.  I installed the
> latest kernel from Fedora Stable-rc, which is 6.14.0-362.vanilla.fc41.x86_64
> and I still have the same issue this ticket describes.
> 
> I'm happy to provide further information to help resolve this if I can do,
> however I likely need some pointers or steps to provide helpful information.
> 
> 
> Thanks!

Hi there,
The patch hasn't made it to the mainline yet, but you can find it here:
https://web.git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?h=review-ilpo-fixes&id=2b9f84e7dc863afd63357b867cea246aeedda036 

Could you please share the disassembled version of your DSDT? We need your ThinkPad ID to add the quirk for it:
$ cat /sys/firmware/acpi/tables/DSDT > dsdt.dat
$ iasl -d dsdt.dat

If everything goes well, you should get a .dsl file. Please upload it here.
Comment 14 hearnia_2k 2025-04-02 19:54:34 UTC
Hello!  Yes, I get a dsl file.  I don't see an upload option, though?

Here was the output from the iasl command, it had some warnings, not too sure how important / relevant they are, so sharing in case it's helpful!

iasl -d dsdt.dat 

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20240322
Copyright (c) 2000 - 2023 Intel Corporation

File appears to be binary: found 18034 non-ASCII characters, disassembling
Binary file appears to be a valid ACPI table, disassembling
Input file dsdt.dat, Length 0xDAB3 (55987) bytes
ACPI: DSDT 0x0000000000000000 00DAB3 (v01 LENOVO TP-R13   000011E0 INTL 20120711)
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed

Found 7 external control methods, reparsing with new information
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed
Disassembly completed
ASL Output:    dsdt.dsl - 483005 bytes

 iASL Warning: There were 7 external control methods found during
 disassembly, but only 0 were resolved (7 unresolved). Additional
 ACPI tables may be required to properly disassemble the code. This
 resulting disassembler output file may not compile because the
 disassembler did not know how many arguments to assign to the
 unresolved methods. Note: SSDTs can be dynamically loaded at
 runtime and may or may not be available via the host OS.

 To specify the tables needed to resolve external control method
 references, the -e option can be used to specify the filenames.
 Example iASL invocations:
     iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml
     iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml
     iasl -e ssdt*.aml -d dsdt.aml

 In addition, the -fe option can be used to specify a file containing
 control method external declarations with the associated method
 argument counts. Each line of the file must be of the form:
     External (<method pathname>, MethodObj, <argument count>)
 Invocation:
     iasl -fe refs.txt -d dsdt.aml


I have uploaded the dsdt file that I got as a result.  I can provide other info if it's helpful :-)

Thanks for the quick response!
Comment 15 hearnia_2k 2025-04-02 19:54:52 UTC
Created attachment 307913 [details]
Hearnia_2k's dsdt from a ThinkPad x395

This is the decrypted dsdt from a ThinkPad X395.
Comment 16 Seyediman Seyedarab 2025-04-02 20:03:36 UTC
(In reply to hearnia_2k from comment #15)
> Created attachment 307913 [details]
> Hearnia_2k's dsdt from a ThinkPad x395
> 
> This is the decrypted dsdt from a ThinkPad X395.

Thank you.
You should wait for the patch to make it into the mainline. Your ThinkPad ID is the same as the T495s, so it should be fixed.
Comment 17 crok 2025-04-14 20:20:24 UTC
Looks like the patch has been merged and I got back my fancontrol!

uname -a
Linux clifford 6.12.23-1-lts #1 SMP PREEMPT_DYNAMIC Thu, 10 Apr 2025 13:28:36 +0000 x86_64 GNU/Linux

cat /proc/acpi/ibm/fan
status:         disabled
speed:          0
level:          0
commands:       level <level> (<level> is 0-7, auto, disengaged, full-speed)
commands:       enable, disable
commands:       watchdog <timeout> (<timeout> is 0 (off), 1-120 (seconds))


Thank you so much!

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