Closed lithces closed 12 months ago
This seems is one of the newest model, so I am very hopeful that it will work after a few changes. Please provide the following information so that I can configure the driver:
# Install required tools
sudo apt install fwts
# Create folder for all the new files
mkdir fwts_re
cd fwts_re
sudo fwts wmi - > fwts_wmi.log
Then upload files.
# Install requiered tools
sudo apt install acpica-tools
# Create folder for all the new files
mkdir acpi_re
cd acpi_re
# List ACPI tables and copy them
ls /sys/firmware/acpi/tables/
sudo cp --no-preserve=mode /sys/firmware/acpi/tables/*SDT* .
# Disassemble tables to output DSDT.dsl
iasl -e SSDT* -d DSDT
Then upload files.
If you have Windows, then the following information are very very useful to make use of the ACPI methods. If you do not have Windows skip it. Open powershell as admin in Windows and run the following script. It will list all available lenovo WMI methods. Copy output to a file and upload.
$wmi_classes = Get-WmiObject -Namespace 'ROOT/WMI' -List -Class "*LENOVO*"
foreach ($wmi_class in $wmi_classes){
Write-Host "########################################"
Write-Host "########################################"
Write-Host "########################################"
Write-Host "Name:" $wmi_class.Name
Write-Host "Class Name:" $wmi_class.Name
Write-Host "Class GUID:" $wmi_class.Qualifiers["guid"].Value
Write-Host "Description:" $wmi_class.Methods.Count
Write-Host "Methods:"
foreach ($method in $wmi_class.Methods){
Write-Host "Name:" $method.Name
Write-Host "WmiMethodId:" $method.Qualifiers["WmiMethodId"].Value
Write-Host "Class Name:" $wmi_class.Name
Write-Host "Class GUID:" $wmi_class.Qualifiers["guid"].Value
Write-Host "Description:" $method.Qualifiers["Description"].Value
Write-Host "Implemented:" $method.Qualifiers["Implemented"].Value
Write-Host ""
}
Write-Host ""
}
Which features are the most useful for you?
This is the exact same modal of my laptop, but mine is with NVIDIA RTX 4080. Dumps here.
@ronyclau @lithces I updated the kernel module.
Thankyou @johnfanv2
I tried the latest Arch AUR and still the similar problem. The kernel module is loaded but something appears wrong in dmesg output
[ 3.441768] legion_laptop: legion_laptop starts loading [ 3.443547] legion PNP0C09:00: legion_laptop platform driver probing [ 3.443551] legion PNP0C09:00: Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82WQ; DMI_BIOS_VERSION:KWCN36WW [ 3.443552] legion_laptop: Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82WQ; DMI_BIOS_VERSION:KWCN36WW [ 3.443555] legion PNP0C09:00: is_denied: 0; is_allowed: 0; do_load_by_list: 0; do_load: 0 [ 3.443557] legion PNP0C09:00: Module not useable for this laptop because it is not in allowlist. Notify maintainer if you want to add your device or force load with param force. [ 3.443558] legion PNP0C09:00: legion_laptop not loaded for this device
I was unable to install fwts-git in AUR now, however I attached the output of ACPI tables and the output from the windows system,
acpi_re.tar.gz windows_dump.tar.gz
Note that when I was dumping the ACPI table on linux i got error messages as follows,
Firmware Error (ACPI): Failure creating named object [\_SB.PC00.XHCI.RHUB.HS14.SADX], AE_ALREADY_EXISTS (20221020/dswload-495) ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20221020/psobject-372) Could not parse ACPI tables, AE_ALREADY_EXISTS
Similar errors appear when I am trying to detach the discrete GPU (for better battery life) using acpi_call as described in Arch Wiki
Your insights are highly appreciated.
@lithces Sorry, for my incomprehensibly message.
Please uninstall any package, DKMS module, ARCH package etc. and compile and load the new version from github as described in the README on github (using make etc.)
@johnfanv2 Thank you so much for the quick work.
This is the output of dmesg
after calling sudo make reloadmodule
[Mon Jun 12 19:04:36 2023] ACPI Error: No handler for Region [RTCM] (00000000ffecb50c) [SystemCMOS] (20221020/evregion-130)
[Mon Jun 12 19:04:36 2023] ACPI Error: Region SystemCMOS (ID=5) has no handler (20221020/exfldio-261)
[Mon Jun 12 19:04:36 2023] No Local Variables are initialized for Method [SNTM]
[Mon Jun 12 19:04:36 2023] No Arguments are initialized for method [SNTM]
[Mon Jun 12 19:04:36 2023] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0.SNTM due to previous error (AE_NOT_EXIST) (20221020/psparse-529)
[Mon Jun 12 19:04:36 2023] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0._Q77 due to previous error (AE_NOT_EXIST) (20221020/psparse-529)
[Mon Jun 12 19:04:36 2023] legion_laptop: legion_laptop exit
[Mon Jun 12 19:04:36 2023] legion_laptop: legion_laptop starts loading
[Mon Jun 12 19:04:36 2023] legion PNP0C09:00: legion_laptop platform driver probing
[Mon Jun 12 19:04:36 2023] legion PNP0C09:00: Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82WQ; DMI_BIOS_VERSION:KWCN36WW
[Mon Jun 12 19:04:36 2023] legion_laptop: Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82WQ; DMI_BIOS_VERSION:KWCN36WW
[Mon Jun 12 19:04:36 2023] legion PNP0C09:00: is_denied: 0; is_allowed: 1; do_load_by_list: 1; do_load: 1
[Mon Jun 12 19:04:36 2023] legion PNP0C09:00: Using configuration for system: 8JCN
[Mon Jun 12 19:04:36 2023] legion PNP0C09:00: ACPI CFG: 2081289494
[Mon Jun 12 19:04:36 2023] legion_laptop: Creating RAM access to embedded controller
[Mon Jun 12 19:04:36 2023] legion_laptop: Succeffuly mapped embedded controller: 0xfe00d400 (in RAM)/0x0 (in EC) to virtual 0x0000000074e2fb1e
[Mon Jun 12 19:04:36 2023] legion PNP0C09:00: Read embedded controller ID 0x5507
[Mon Jun 12 19:04:36 2023] legion PNP0C09:00: Expected EC chip id 0x8227 but read 0x5507
[Mon Jun 12 19:04:36 2023] legion_laptop: Unloading legion ecram
[Mon Jun 12 19:04:36 2023] legion_laptop: Unloading legion ecram done
[Mon Jun 12 19:04:36 2023] legion_laptop: Unmapping embedded controller memory at 0xfe00d400 (in RAM)/0x0 (in EC) at virtual 0x0000000074e2fb1e
[Mon Jun 12 19:04:36 2023] legion_laptop: Unloading legion shared
[Mon Jun 12 19:04:36 2023] legion_laptop: Unloading legion shared done
[Mon Jun 12 19:04:36 2023] legion PNP0C09:00: legion_laptop not loaded for this device
[Mon Jun 12 19:04:36 2023] legion: probe of PNP0C09:00 failed with error -12
FYI, I am using PopOS and is booting with kernelstub. Didn't build for DKMS, as it was apparent above that the module was not loading.
@ronyclau @lithces I updated the ID for the embedded controller. Maybe this is a new one.
Please uninstall old versions and compile and load the new version from github as described in the README on github (using make etc.), again.
@johnfanv2 Thanks for the prompt fix. The module can be loaded now, however, tests revealed that both temperature and fan speed were not reported correctly. Please see the logs below:
sudo reloadmodule
I didn't continue with the "Initial Usage Testing" at this point, as the latter parts involve non-readonly operations.
@ronyclau This seems to be a new software on the embedded controller. I disabled everything using specifics of the embedded controller and just use generic WMI methods for now.
Please uninstall old versions and compile and load the new version from github as described in the README on github (using make etc.), again.
Most stuff should work except setting the fancurve. You should be able to proceed testing except fan curve settings. To make the fan curve work, please change the power mode with Fn+Q and provide the output of the following commands in each mode.
sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
sudo cat /sys/kernel/debug/legion/fancurve
@johnfanv2 I cloned the latest repo
commit c2eb040de864da0a30f7e0b3b0f91ec2dcd43cf6 (HEAD -> main, origin/main, origin/HEAD)
Author: johnfan <johndoe@example.com>
Date: Mon Jun 12 23:50:49 2023 +0200
Use WMI methods for bios KWCN and disable fancurve access
and tried the 'make' method. Seems that the kernel module was loaded. I attached some outputs as follows,
Setting the fancurve does not work, nor does reading it. It complains about /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon6/pwm1_auto_point1_pwm
being missing.
Setting the power mode works, but not reading the power limits. If you want any logs or anything, please ask. I would really be happy to get LenovoLegionLinux working on my laptop.
This new model is a little different, but we will get there to support probably all features. I created a new version to get some more output/logs and already began with implementing temp and fan sensors. Please get the newest version from git and recompile and reload the kernel module.
We will start by confirming that power mode change work and to get me more debug info. Please change the power mode with Fn+Q and provide the output of the following commands in each mode.
sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
sudo cat /sys/kernel/debug/legion/fancurve
Then please also check if the power mode is read correctly in the OS (see README). Then please check if you can set the power mode with the software (see README) and the LED changes accordingly. Also check custom mode.
@lithces Thanks for the debug output. Some ACPI errors are from stuff unrelated to the module and some errors are from this module. We have to adapt the software to this new model to get rid of them.
@potatoalienof13 The fan curve is currently not available for this model before we adapt it. I disabled it so that everything is safe and we can set/change all features without accidentally setting something in the embedded controller that is not tested yet for this model.
It is reading and setting the power mode correctly with software. The LED changes correctly. Here are the outputs of the commands.
Quiet mode: sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000600
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
00000000 00 00 00 02 00 00 00 00 00 00 10 00 00 00 1e 28 |...............(|
00000010 00 00 80 00 05 00 10 06 00 01 06 00 00 00 20 00 |.............. .|
00000020 02 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 82 |..............@.|
00000040 11 01 02 00 50 01 00 00 00 00 00 00 bb 56 00 00 |....P........V..|
00000050 2c 01 e6 00 00 00 c0 81 00 07 00 09 00 00 00 08 |,...............|
00000060 00 80 02 03 00 00 00 08 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 00 00 00 00 04 00 00 00 c0 00 42 00 80 08 01 53 |..........B....S|
00000090 4d 50 00 32 30 32 32 00 4c 32 32 4d 34 50 43 31 |MP.2022.L22M4PC1|
000000a0 00 09 00 8e 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 33 25 00 26 27 27 00 27 02 11 00 00 00 80 01 00 |3%.&''.'........|
000000c0 70 00 45 20 a7 09 bb 41 a0 3c 06 27 55 28 50 00 |p.E ...A.<.'U(P.|
000000d0 00 00 00 00 00 00 00 1c 77 11 00 00 00 00 00 00 |........w.......|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 |................|
000000f0 01 00 00 40 98 56 88 45 00 00 00 00 00 00 00 00 |...@.V.E........|
00000100 80 00 00 00 00 00 06 06 77 77 77 77 77 77 66 77 |........wwwwwwfw|
00000110 00 00 ff ff 00 00 00 00 00 00 35 7f 2f 00 00 00 |..........5./...|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 00 00 03 01 00 00 00 00 92 00 00 00 00 00 00 00 |................|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001d0 10 0a 00 50 00 00 00 00 00 00 00 00 00 00 00 00 |...P............|
000001e0 77 46 03 37 6f 19 37 57 50 00 37 00 00 00 00 00 |wF.7o.7WP.7.....|
000001f0 01 02 03 04 05 06 07 08 08 08 02 01 08 00 00 00 |................|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 |................|
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000220 00 00 00 00 00 00 00 00 01 00 01 00 45 20 00 00 |............E ..|
00000230 30 00 00 00 00 00 00 31 31 00 00 00 00 00 00 01 |0......11.......|
00000240 00 00 00 00 00 00 00 1e 00 00 03 00 00 00 00 00 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 58 33 58 50 33 34 52 30 32 44 37 00 00 00 00 00 |X3XP34R02D7.....|
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000280 a5 f3 64 03 00 00 00 00 00 00 00 00 00 00 00 00 |..d.............|
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000002e0 00 00 00 00 00 00 00 64 00 00 00 01 01 00 00 00 |.......d........|
000002f0 00 00 00 00 00 00 00 00 00 00 00 00 25 27 00 00 |............%'..|
00000300
sudo cat /sys/kernel/debug/legion/fancurve
EC Chip ID: 5507
EC Chip Version: 2a4
legion_laptop features: fancurve powermode platformprofile platformprofilenotify minifancurve
legion_laptop ec_readonly: 0
ACPI CFG error: 0
ACPI CFG: 2081289494
temperature access method: 3
CPU temperature error: 0
CPU temperature: 0
CPU temperature EC error: 0
CPU temperature EC: 55
CPU temperature ACPI error: 0
CPU temperature ACPI: 51
CPU temperature WMI error: 0
CPU temperature WMI: 0
CPU temperature WMI2 error: 0
CPU temperature WMI2: 0
CPU temperature WMI3 error: 0
CPU temperature WMI3: 51
GPU temperature error: 0
GPU temperature: 0
GPU temperature EC error: 0
GPU temperature EC: 87
GPU temperature ACPI error: 0
GPU temperature ACPI: 39
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: 0
GPU temperature WMI2: 0
GPU temperature WMI3 error: 0
GPU temperature WMI3: 39
fan speed access method: 3
1 fanspeed error: 0
1 fanspeed: 0
1 fanspeed EC error: 0
1 fanspeed EC: 18039
1 fanspeed ACPI error: 0
1 fanspeed ACPI: 0
1 fanspeed WMI error: 0
1 fanspeed WMI: 0
1 fanspeed WMI2 error: 0
1 fanspeed WMI2: 0
1 fanspeed WMI3 error: 0
1 fanspeed WMI3: 0
2 fanspeed error: 0
2 fanspeed: 0
2 fanspeed EC error: 0
2 fanspeed EC: 14083
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 0
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 0
2 fanspeed WMI3 error: 0
2 fanspeed WMI3: 0
powermode access method: 3
powermode error: 0
powermode: 1
powermode EC error: 0
powermode EC: 2
powermode ACPI error: -5
powermode ACPI: 0
powermode WMI error: 0
powermode WMI: 1
has custom powermode: 1
ACPI rapidcharge error: 0
ACPI rapidcharge: 0
WMI backlight 2 state: 0
WMI backlight 3 state: 0
WMI light IO port: 0
WMI light y logo/lid: 0
EC minifancurve feature enabled: 0
EC minifancurve on cool: error
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 0
EC fan curve points size: 0
Current fan curve in hardware (embedded controller):
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
=====================
Balance mode: sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000600
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
00000000 00 00 00 02 00 00 00 00 00 00 10 00 00 00 1e 28 |...............(|
00000010 00 00 80 00 05 00 10 06 00 01 06 00 00 00 00 00 |................|
00000020 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 82 |..............@.|
00000040 11 01 02 00 50 01 00 00 00 00 00 00 bb 56 00 00 |....P........V..|
00000050 2c 01 e6 00 00 00 c0 81 00 07 00 09 00 00 00 08 |,...............|
00000060 00 80 02 03 00 00 00 08 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 00 00 00 00 04 00 00 00 c0 00 42 00 80 08 01 53 |..........B....S|
00000090 4d 50 00 32 30 32 32 00 4c 32 32 4d 34 50 43 31 |MP.2022.L22M4PC1|
000000a0 00 09 00 8e 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 33 25 00 26 27 27 38 27 02 11 00 00 00 80 01 00 |3%.&''8'........|
000000c0 70 00 45 20 a7 09 bb 41 a0 3c 06 27 55 28 50 00 |p.E ...A.<.'U(P.|
000000d0 00 00 00 00 00 00 00 1c bb 08 00 00 00 00 00 00 |................|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 |................|
000000f0 01 00 00 40 98 56 88 45 00 00 00 00 00 00 00 00 |...@.V.E........|
00000100 80 00 00 00 00 00 00 00 77 3c 13 70 67 77 77 77 |........w<.pgwww|
00000110 00 00 ff ff 00 00 00 00 00 00 39 37 32 00 00 00 |..........972...|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 00 00 24 02 00 00 00 00 92 00 00 00 00 00 00 00 |..$.............|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001d0 10 0a 00 50 00 00 00 00 00 00 00 00 00 00 00 00 |...P............|
000001e0 77 46 03 37 6f 19 37 57 50 00 37 00 00 00 00 00 |wF.7o.7WP.7.....|
000001f0 01 02 03 04 05 06 07 08 08 08 02 01 08 00 00 00 |................|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 |................|
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000220 00 00 00 00 00 00 00 00 01 00 00 00 45 20 00 00 |............E ..|
00000230 30 00 00 00 00 00 00 31 31 00 00 00 00 03 00 01 |0......11.......|
00000240 00 00 00 00 00 00 00 1e 00 00 03 00 00 00 00 00 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 58 33 58 50 33 34 52 30 32 44 37 00 00 00 00 00 |X3XP34R02D7.....|
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000280 a8 f3 64 03 00 00 00 00 00 00 00 00 00 00 00 00 |..d.............|
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000002e0 00 00 00 00 00 00 00 64 00 00 00 01 01 00 00 00 |.......d........|
000002f0 00 00 00 00 00 00 00 00 00 00 00 00 25 27 00 00 |............%'..|
00000300
sudo cat /sys/kernel/debug/legion/fancurve
EC Chip ID: 5507
EC Chip Version: 2a4
legion_laptop features: fancurve powermode platformprofile platformprofilenotify minifancurve
legion_laptop ec_readonly: 0
ACPI CFG error: 0
ACPI CFG: 2081289494
temperature access method: 3
CPU temperature error: 0
CPU temperature: 0
CPU temperature EC error: 0
CPU temperature EC: 55
CPU temperature ACPI error: 0
CPU temperature ACPI: 51
CPU temperature WMI error: 0
CPU temperature WMI: 0
CPU temperature WMI2 error: 0
CPU temperature WMI2: 0
CPU temperature WMI3 error: 0
CPU temperature WMI3: 51
GPU temperature error: 0
GPU temperature: 0
GPU temperature EC error: 0
GPU temperature EC: 87
GPU temperature ACPI error: 0
GPU temperature ACPI: 39
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: 0
GPU temperature WMI2: 0
GPU temperature WMI3 error: 0
GPU temperature WMI3: 39
fan speed access method: 3
1 fanspeed error: 0
1 fanspeed: 0
1 fanspeed EC error: 0
1 fanspeed EC: 18039
1 fanspeed ACPI error: 0
1 fanspeed ACPI: 0
1 fanspeed WMI error: 0
1 fanspeed WMI: 0
1 fanspeed WMI2 error: 0
1 fanspeed WMI2: 0
1 fanspeed WMI3 error: 0
1 fanspeed WMI3: 0
2 fanspeed error: 0
2 fanspeed: 0
2 fanspeed EC error: 0
2 fanspeed EC: 14083
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 0
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 0
2 fanspeed WMI3 error: 0
2 fanspeed WMI3: 0
powermode access method: 3
powermode error: 0
powermode: 2
powermode EC error: 0
powermode EC: 0
powermode ACPI error: -5
powermode ACPI: 0
powermode WMI error: 0
powermode WMI: 2
has custom powermode: 1
ACPI rapidcharge error: 0
ACPI rapidcharge: 0
WMI backlight 2 state: 0
WMI backlight 3 state: 0
WMI light IO port: 0
WMI light y logo/lid: 0
EC minifancurve feature enabled: 0
EC minifancurve on cool: error
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 0
EC fan curve points size: 0
Current fan curve in hardware (embedded controller):
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
=====================
Performance mode: sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000600
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
00000000 00 00 00 02 00 00 00 00 00 00 10 00 00 00 1e 28 |...............(|
00000010 00 00 80 00 05 00 10 06 00 01 06 00 00 00 00 00 |................|
00000020 01 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 82 |..............@.|
00000040 11 01 02 00 50 01 00 00 00 00 00 00 bb 56 00 00 |....P........V..|
00000050 2c 01 e6 00 00 00 c0 81 00 07 00 09 00 00 00 08 |,...............|
00000060 00 80 02 03 00 00 00 08 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 00 00 00 00 04 00 00 00 c0 00 42 00 80 08 01 53 |..........B....S|
00000090 4d 50 00 32 30 32 32 00 4c 32 32 4d 34 50 43 31 |MP.2022.L22M4PC1|
000000a0 00 09 00 8e 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 33 25 00 26 28 27 00 27 02 11 00 00 00 80 01 00 |3%.&('.'........|
000000c0 70 00 45 20 a7 09 bc 41 a0 3c 06 27 55 28 50 00 |p.E ...A.<.'U(P.|
000000d0 00 00 00 00 00 00 00 1c 77 11 00 00 00 00 00 00 |........w.......|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 |................|
000000f0 01 00 00 40 98 56 88 45 00 00 00 00 00 00 00 00 |...@.V.E........|
00000100 80 00 00 00 00 00 03 03 dd 77 77 70 77 77 dd 77 |.........wwpww.w|
00000110 00 00 ff ff 00 00 00 00 00 00 3f 45 40 00 00 00 |..........?E@...|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 00 00 42 03 00 00 00 00 92 00 00 00 00 00 00 00 |..B.............|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001d0 10 19 00 50 00 00 00 00 00 00 00 00 00 00 00 00 |...P............|
000001e0 77 46 03 37 6f 19 37 57 50 00 37 00 00 00 00 00 |wF.7o.7WP.7.....|
000001f0 01 02 03 04 05 06 07 08 08 08 02 01 08 00 00 00 |................|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 |................|
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000220 00 00 00 00 00 00 00 00 01 00 00 00 45 20 00 00 |............E ..|
00000230 30 00 00 00 00 00 00 31 31 00 00 00 00 01 00 00 |0......11.......|
00000240 00 00 00 00 00 00 00 1e 00 00 03 00 00 00 00 00 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 58 33 58 50 33 34 52 30 32 44 37 00 00 00 00 00 |X3XP34R02D7.....|
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000280 b7 f3 64 03 00 00 00 00 00 00 00 00 00 00 00 00 |..d.............|
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000002e0 00 00 00 00 00 00 00 64 00 00 00 01 01 00 00 00 |.......d........|
000002f0 00 00 00 00 00 00 00 00 00 00 00 00 25 28 00 00 |............%(..|
00000300
sudo cat /sys/kernel/debug/legion/fancurve
EC Chip ID: 5507
EC Chip Version: 2a4
legion_laptop features: fancurve powermode platformprofile platformprofilenotify minifancurve
legion_laptop ec_readonly: 0
ACPI CFG error: 0
ACPI CFG: 2081289494
temperature access method: 3
CPU temperature error: 0
CPU temperature: 0
CPU temperature EC error: 0
CPU temperature EC: 55
CPU temperature ACPI error: 0
CPU temperature ACPI: 51
CPU temperature WMI error: 0
CPU temperature WMI: 0
CPU temperature WMI2 error: 0
CPU temperature WMI2: 0
CPU temperature WMI3 error: 0
CPU temperature WMI3: 51
GPU temperature error: 0
GPU temperature: 0
GPU temperature EC error: 0
GPU temperature EC: 87
GPU temperature ACPI error: 0
GPU temperature ACPI: 40
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: 0
GPU temperature WMI2: 0
GPU temperature WMI3 error: 0
GPU temperature WMI3: 40
fan speed access method: 3
1 fanspeed error: 0
1 fanspeed: 0
1 fanspeed EC error: 0
1 fanspeed EC: 18039
1 fanspeed ACPI error: 0
1 fanspeed ACPI: 0
1 fanspeed WMI error: 0
1 fanspeed WMI: 0
1 fanspeed WMI2 error: 0
1 fanspeed WMI2: 0
1 fanspeed WMI3 error: 0
1 fanspeed WMI3: 0
2 fanspeed error: 0
2 fanspeed: 0
2 fanspeed EC error: 0
2 fanspeed EC: 14083
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 0
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 0
2 fanspeed WMI3 error: 0
2 fanspeed WMI3: 0
powermode access method: 3
powermode error: 0
powermode: 3
powermode EC error: 0
powermode EC: 1
powermode ACPI error: -5
powermode ACPI: 0
powermode WMI error: 0
powermode WMI: 3
has custom powermode: 1
ACPI rapidcharge error: 0
ACPI rapidcharge: 0
WMI backlight 2 state: 0
WMI backlight 3 state: 0
WMI light IO port: 0
WMI light y logo/lid: 0
EC minifancurve feature enabled: 0
EC minifancurve on cool: error
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 0
EC fan curve points size: 0
Current fan curve in hardware (embedded controller):
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
=====================
Custom mode: sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000600
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
00000000 00 00 00 02 00 00 00 00 00 00 10 00 00 00 1e 29 |...............)|
00000010 00 00 80 00 05 00 10 06 00 01 06 00 00 11 00 00 |................|
00000020 01 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 82 |..............@.|
00000040 11 01 02 00 50 01 00 00 00 00 00 00 bb 56 00 00 |....P........V..|
00000050 2c 01 e6 00 00 00 c0 81 00 07 00 09 00 00 00 08 |,...............|
00000060 00 80 02 03 00 00 00 08 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 00 00 00 00 04 00 00 00 c0 00 42 00 80 08 01 53 |..........B....S|
00000090 4d 50 00 32 30 32 32 00 4c 32 32 4d 34 50 43 31 |MP.2022.L22M4PC1|
000000a0 00 09 00 8e 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 34 26 00 27 29 28 00 27 02 11 00 00 00 80 01 00 |4&.')(.'........|
000000c0 70 00 45 20 a7 09 bb 41 a0 3c 06 27 55 28 50 00 |p.E ...A.<.'U(P.|
000000d0 00 00 00 00 00 00 00 1c bb 08 00 00 00 00 00 00 |................|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 |................|
000000f0 01 00 00 40 98 56 88 45 00 00 00 00 00 00 00 00 |...@.V.E........|
00000100 80 00 00 00 00 00 06 06 77 77 77 77 77 77 77 77 |........wwwwwwww|
00000110 00 00 ff ff 00 00 00 00 00 00 39 37 32 00 00 00 |..........972...|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 00 00 55 07 00 00 00 00 92 00 00 00 00 00 00 00 |..U.............|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001d0 10 19 00 50 00 00 00 00 00 00 00 00 00 00 00 00 |...P............|
000001e0 77 46 03 37 6f 19 37 57 50 00 37 00 00 00 00 00 |wF.7o.7WP.7.....|
000001f0 01 02 03 04 05 06 07 08 08 08 02 01 08 00 00 00 |................|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 |................|
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000220 00 00 00 00 00 00 00 00 01 00 00 00 45 20 00 00 |............E ..|
00000230 30 00 00 00 00 00 00 31 31 00 00 00 00 01 00 00 |0......11.......|
00000240 00 00 00 00 00 00 00 1e 00 00 03 00 00 00 00 00 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 58 33 58 50 33 34 52 30 32 44 37 00 00 00 00 00 |X3XP34R02D7.....|
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000280 fd f3 64 03 00 00 00 00 00 00 00 00 00 00 00 00 |..d.............|
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000002e0 00 00 00 00 00 00 00 64 00 00 00 01 01 00 00 00 |.......d........|
000002f0 00 00 00 00 00 00 00 00 00 00 00 00 26 29 00 00 |............&)..|
00000300
sudo cat /sys/kernel/debug/legion/fancurve
EC Chip ID: 5507
EC Chip Version: 2a4
legion_laptop features: fancurve powermode platformprofile platformprofilenotify minifancurve
legion_laptop ec_readonly: 0
ACPI CFG error: 0
ACPI CFG: 2081289494
temperature access method: 3
CPU temperature error: 0
CPU temperature: 0
CPU temperature EC error: 0
CPU temperature EC: 55
CPU temperature ACPI error: 0
CPU temperature ACPI: 52
CPU temperature WMI error: 0
CPU temperature WMI: 0
CPU temperature WMI2 error: 0
CPU temperature WMI2: 0
CPU temperature WMI3 error: 0
CPU temperature WMI3: 52
GPU temperature error: 0
GPU temperature: 0
GPU temperature EC error: 0
GPU temperature EC: 87
GPU temperature ACPI error: 0
GPU temperature ACPI: 41
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: 0
GPU temperature WMI2: 0
GPU temperature WMI3 error: 0
GPU temperature WMI3: 41
fan speed access method: 3
1 fanspeed error: 0
1 fanspeed: 0
1 fanspeed EC error: 0
1 fanspeed EC: 18039
1 fanspeed ACPI error: 0
1 fanspeed ACPI: 0
1 fanspeed WMI error: 0
1 fanspeed WMI: 0
1 fanspeed WMI2 error: 0
1 fanspeed WMI2: 0
1 fanspeed WMI3 error: 0
1 fanspeed WMI3: 0
2 fanspeed error: 0
2 fanspeed: 0
2 fanspeed EC error: 0
2 fanspeed EC: 14083
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 0
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 0
2 fanspeed WMI3 error: 0
2 fanspeed WMI3: 0
powermode access method: 3
powermode error: 0
powermode: 255
powermode EC error: 0
powermode EC: 1
powermode ACPI error: -5
powermode ACPI: 0
powermode WMI error: 0
powermode WMI: 255
has custom powermode: 1
ACPI rapidcharge error: 0
ACPI rapidcharge: 0
WMI backlight 2 state: 0
WMI backlight 3 state: 0
WMI light IO port: 0
WMI light y logo/lid: 0
EC minifancurve feature enabled: 0
EC minifancurve on cool: error
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 0
EC fan curve points size: 0
Current fan curve in hardware (embedded controller):
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
=====================
Great. Now that power mode works, we can fix and test sensor values. Please get the modified code again, recompile, and test sensor values (see README). It should display correct temperature values (except for IC/chip) and correct fan speeds. Please put some load onto your CPU and GPU to check that everything is labelled correctly. Note that GPU temp might be 0 if the GPU is off or not used.
I also made some changes to read the EC memory. Please provide again the output of:
sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
It suffices to provide the output in one power mode.
I can confirm that sensors work, including fan speeds. Everything is labeled correctly.
Here are the command outputs:
sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
00000000 00 01 00 02 00 00 11 00 33 17 10 00 00 00 1f 2a |........3......*|
00000010 00 00 80 00 05 00 10 06 00 01 06 00 00 00 00 00 |................|
00000020 01 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 82 |..............@.|
00000040 11 01 02 00 50 01 00 00 00 00 00 00 bb 56 00 00 |....P........V..|
00000050 2c 01 e6 00 00 00 c0 81 00 07 00 09 00 00 00 08 |,...............|
00000060 00 80 02 03 00 00 00 08 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 00 00 00 00 04 00 00 00 c0 00 42 00 80 08 01 53 |..........B....S|
00000090 4d 50 00 32 30 32 32 00 4c 32 32 4d 34 50 43 31 |MP.2022.L22M4PC1|
000000a0 00 09 00 8e 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 32 27 00 28 27 29 39 29 02 11 00 00 00 80 01 00 |2'.(')9)........|
000000c0 70 00 dd 1f a7 09 b5 41 a0 3c 06 27 55 28 4f 00 |p......A.<.'U(O.|
000000d0 00 00 00 00 00 00 00 1b 77 11 00 00 00 00 00 00 |........w.......|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 |................|
000000f0 01 00 00 40 98 56 88 45 00 00 00 00 01 00 11 00 |...@.V.E........|
00000100 80 00 00 00 00 00 07 07 77 77 77 77 77 77 77 77 |........wwwwwwww|
00000110 00 00 ff ff 00 00 00 00 00 00 3f 45 40 00 00 00 |..........?E@...|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 00 00 32 71 00 00 00 00 92 00 00 00 00 00 00 00 |..2q............|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001d0 10 19 00 50 00 00 00 00 00 00 00 00 00 00 00 00 |...P............|
000001e0 77 46 03 37 6f 19 37 57 50 00 37 00 00 00 00 00 |wF.7o.7WP.7.....|
000001f0 01 02 03 04 05 06 07 08 08 08 02 01 08 00 00 00 |................|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 |................|
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000220 00 00 00 00 00 00 00 00 01 00 01 00 dd 1f 00 00 |................|
00000230 30 00 00 00 00 00 00 31 31 00 00 00 00 00 00 01 |0......11.......|
00000240 00 00 00 00 00 00 00 1e 00 00 03 00 00 00 00 00 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 58 33 58 50 33 34 52 30 32 44 37 00 00 00 00 00 |X3XP34R02D7.....|
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000280 76 f3 64 03 00 00 00 00 00 00 00 00 00 00 00 00 |v.d.............|
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000002e0 00 00 00 00 00 00 00 64 00 00 00 01 01 00 00 00 |.......d........|
000002f0 00 00 00 00 00 00 00 00 00 00 00 00 27 27 00 00 |............''..|
00000300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000320 00 20 33 00 00 3a 20 33 00 00 3d 20 3f 00 ff ff |. 3..: 3..= ?...|
*
00000340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000380 ff 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000390 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
000003e0 ff 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
000003f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000480 40 eb bf 4c 1e 9b 11 b2 a8 5c 84 f0 82 a6 ef 3f |@..L.....\.....?|
00000490 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
000004a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000500 00 00 00 00 00 00 00 00 00 00 32 d2 00 00 00 00 |..........2.....|
00000510 80 02 00 00 01 0b 00 00 00 00 00 00 00 02 0a 01 |................|
00000520 80 02 01 00 01 09 00 00 00 00 00 00 00 03 0a 01 |................|
00000530 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 |................|
00000540 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 |................|
00000550 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000570 02 00 00 40 00 00 00 00 00 00 00 00 02 00 00 40 |...@...........@|
00000580 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000005c0 80 40 80 80 00 00 00 00 00 00 01 00 80 40 80 80 |.@...........@..|
000005d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000600
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
00000000 00 01 00 02 00 00 11 00 33 17 10 00 00 00 1f 2a |........3......*|
00000010 00 00 80 00 05 00 10 06 00 01 06 00 00 00 00 00 |................|
00000020 01 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 82 |..............@.|
00000040 11 01 02 00 50 01 00 00 00 00 00 00 bb 56 00 00 |....P........V..|
00000050 2c 01 e6 00 00 00 c0 81 00 07 00 09 00 00 00 08 |,...............|
00000060 00 80 02 03 00 00 00 08 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 00 00 00 00 04 00 00 00 c0 00 42 00 80 08 01 53 |..........B....S|
00000090 4d 50 00 32 30 32 32 00 4c 32 32 4d 34 50 43 31 |MP.2022.L22M4PC1|
000000a0 00 09 00 8e 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 32 27 00 28 27 29 00 29 02 11 00 00 00 80 01 00 |2'.(').)........|
000000c0 70 00 dd 1f a7 09 b3 41 a0 3c 06 27 55 28 4f 00 |p......A.<.'U(O.|
000000d0 00 00 00 00 00 00 00 1b 77 11 00 00 00 00 00 00 |........w.......|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 |................|
000000f0 01 00 00 40 98 56 88 45 00 00 00 00 01 00 11 00 |...@.V.E........|
00000100 80 00 00 00 00 00 04 04 77 77 77 77 77 77 77 77 |........wwwwwwww|
00000110 00 00 ff ff 00 00 00 00 00 00 3f 45 40 00 00 00 |..........?E@...|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 00 00 61 71 00 00 00 00 92 00 00 00 00 00 00 00 |..aq............|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001d0 10 19 00 50 00 00 00 00 00 00 00 00 00 00 00 00 |...P............|
000001e0 77 46 03 37 6f 19 37 57 50 00 37 00 00 00 00 00 |wF.7o.7WP.7.....|
000001f0 01 02 03 04 05 06 07 08 08 08 02 01 08 00 00 00 |................|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 |................|
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000220 00 00 00 00 00 00 00 00 01 00 01 00 dd 1f 00 00 |................|
00000230 30 00 00 00 00 00 00 31 31 00 00 00 00 02 00 02 |0......11.......|
00000240 00 00 00 00 00 00 00 1e 00 00 03 00 00 00 00 00 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 58 33 58 50 33 34 52 30 32 44 37 00 00 00 00 00 |X3XP34R02D7.....|
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000280 73 f3 64 03 00 00 00 00 00 00 00 00 00 00 00 00 |s.d.............|
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000002e0 00 00 00 00 00 00 00 64 00 00 00 01 01 00 00 00 |.......d........|
000002f0 00 00 00 00 00 00 00 00 00 00 00 00 27 27 00 00 |............''..|
00000300
@johnfanv2 Can also confirm that both the sensor values and power profile work. Thank you!
Here's my dump of EC memory (balance mode when dumped):
sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
Thanks for the feedback. Now, that these basic features work. Let's test some of the miscellaneous features before we come to fan control.
Please get the new code for kernel module and GUI. Recompile kernel module and reload and perform the following tests with the GUI. Please check that if works or otherwise give precise information about what does not work. Please try to check that reading and writing works with the software. Provide the log output from the GUI.
In order to fix/configure the keyboard backlight and begin with setting fan curves, please put your keyboard backlight to off, medium, or bright. Provide the output of the following commands (in that order) in each backlight state:
sudo cat /sys/kernel/debug/legion/fancurve
sudo dmesg | tail -n 30
@johnfanv2
INFO:legion_linux.legion:Feature TouchpadFeature with path None
WARNING:legion_linux.legion:Feature TouchpadFeature exist not. exits: 0
This model has 4 levels of backlight: off, low, medium, and bright.
Commands output at each level:
Please get the new code for kernel module and GUI. Recompile kernel module and reload and perform the following tests with the GUI. Please check that if works or otherwise give precise information about what does not work. Please try to check that reading and writing works with the software. Provide the log output from the GUI.
Please try the updated version of the GUI and kernel module.
So I guess, changing the setting has an effect. It is just delayed.
@ronyclau Is it correct that you have a RGB backlight? This might be controlled by USB or another method. You could try https://openrgb.org/ . Can you control it in Windows with Vantage and Legion Toolkit?
Please give again the output of
sudo cat /sys/kernel/debug/legion/fancurve
sudo dmesg | tail -n 30
@johnfanv2 Thanks for the update. Touchpad control (both read and write) is working now.
My model has per-key RGB. I can control it with Lenovo Vantage and Legion Toolkit in Windows, but OpenRGB doesn't detect my keyboard in Linux (didn't try in Windows though).
Below is the fan curve dump. I have included a bit more of dmesg
output, as it includes a backtrace of an array OOB access:
I will have to look into the backlight stuff. Sorry, for the out of bounds access of the array and the crash. I suggest restarting. I fixed it in the code just uploaded. Please try it and report the output from above.
@johnfanv2 Rebuilt and reloaded the module. Looks like the OOB is fixed now (saw your fix, straight to the point :smile:)
@johnfanv2 I pulled the latest code "commit 611f97b4d83ceb0c45aea415ac771a0173e89853"
Seems that there are still problem with FanCurve. See below for the output,
sudo dmesg | tail -n 30
EC Chip ID: 5507
EC Chip Version: 2a4
legion_laptop features: fancurve powermode platformprofile platformprofilenotify minifancurve
legion_laptop ec_readonly: 0
ACPI CFG error: 0
ACPI CFG: 2081289494
temperature access method: 5
CPU temperature error: 0
CPU temperature: 44
CPU temperature EC error: 0
CPU temperature EC: 80
CPU temperature ACPI error: 0
CPU temperature ACPI: 44
CPU temperature WMI error: 0
CPU temperature WMI: 0
CPU temperature WMI2 error: 0
CPU temperature WMI2: 0
CPU temperature WMI3 error: 0
CPU temperature WMI3: 44
GPU temperature error: 0
GPU temperature: 0
GPU temperature EC error: 0
GPU temperature EC: 87
GPU temperature ACPI error: 0
GPU temperature ACPI: 0
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: 0
GPU temperature WMI2: 0
GPU temperature WMI3 error: 0
GPU temperature WMI3: 0
fan speed access method: 5
1 fanspeed error: 0
1 fanspeed: 1700
1 fanspeed EC error: 0
1 fanspeed EC: 18039
1 fanspeed ACPI error: 0
1 fanspeed ACPI: 1700
1 fanspeed WMI error: 0
1 fanspeed WMI: 0
1 fanspeed WMI2 error: 0
1 fanspeed WMI2: 0
1 fanspeed WMI3 error: 0
1 fanspeed WMI3: 1700
2 fanspeed error: 0
2 fanspeed: 1700
2 fanspeed EC error: 0
2 fanspeed EC: 14083
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 1700
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 0
2 fanspeed WMI3 error: 0
2 fanspeed WMI3: 1700
powermode access method: 3
powermode error: 0
powermode: 1
powermode EC error: 0
powermode EC: 2
powermode ACPI error: -5
powermode ACPI: 0
powermode WMI error: 0
powermode WMI: 1
has custom powermode: 1
ACPI rapidcharge error: 0
ACPI rapidcharge: 1
WMI backlight 2 state: 0
WMI backlight 3 state: 0
WMI light IO port: 0
WMI light y logo/lid: 0
EC minifancurve feature enabled: 0
EC minifancurve on cool: error
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 0
EC fan curve points size: 0
Current fan curve in hardware (embedded controller):
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
=====================
Current fan curve in hardware (WMI) (might be empty)
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
100 0 0 0 0 0 0 0 0 0
200 0 0 0 0 0 0 0 0 0
300 0 0 0 0 0 0 0 0 0
400 0 0 0 0 0 0 0 0 0
500 0 0 0 0 0 0 0 0 0
600 0 0 0 0 0 0 0 0 0
700 0 0 0 0 0 0 0 0 0
800 0 0 0 0 0 0 0 0 0
900 0 0 0 0 0 0 0 0 0
900 0 0 0 0 0 0 0 0 0
=====================
[ 681.108968] legion_laptop: ACPI result for 8C5B9127-ECD4-4657-980F-851019F99CA5:1: ACPI buffer length: 2
[ 681.109074] legion_laptop: Unexpected value in MINIFANCURVE register:0
[ 681.109302] legion_laptop: No access method for fancurve:0
[ 681.109304] legion_laptop: Size of object: 48
[ 681.109443] legion_laptop: ACPI result for 92549549-4bde-4f06-ac04-ce8bf898dbaa:5: ACPI buffer length: 88
[ 751.168154] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PC00.LPCB.EC0._Q44.WM00], AE_NOT_FOUND (20230331/psargs-330)
[ 751.168186] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0._Q44 due to previous error (AE_NOT_FOUND) (20230331/psparse-529)
[ 751.177513] ideapad_acpi VPC2004:00: Unknown event: 12
[ 751.561461] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PC00.LPCB.EC0._Q44.WM00], AE_NOT_FOUND (20230331/psargs-330)
[ 751.561495] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0._Q44 due to previous error (AE_NOT_FOUND) (20230331/psparse-529)
[ 751.572308] ideapad_acpi VPC2004:00: Unknown event: 12
[ 751.831263] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PC00.LPCB.EC0._Q44.WM00], AE_NOT_FOUND (20230331/psargs-330)
[ 751.831297] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0._Q44 due to previous error (AE_NOT_FOUND) (20230331/psparse-529)
[ 751.841533] ideapad_acpi VPC2004:00: Unknown event: 12
[ 752.381159] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PC00.LPCB.EC0._Q44.WM00], AE_NOT_FOUND (20230331/psargs-330)
[ 752.381188] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0._Q44 due to previous error (AE_NOT_FOUND) (20230331/psparse-529)
[ 752.391392] ideapad_acpi VPC2004:00: Unknown event: 12
[ 752.640835] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PC00.LPCB.EC0._Q44.WM00], AE_NOT_FOUND (20230331/psargs-330)
[ 752.640848] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0._Q44 due to previous error (AE_NOT_FOUND) (20230331/psparse-529)
[ 752.651834] ideapad_acpi VPC2004:00: Unknown event: 12
[ 752.914553] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PC00.LPCB.EC0._Q44.WM00], AE_NOT_FOUND (20230331/psargs-330)
[ 752.914587] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0._Q44 due to previous error (AE_NOT_FOUND) (20230331/psparse-529)
[ 752.925223] ideapad_acpi VPC2004:00: Unknown event: 12
[ 827.888453] legion_laptop: ACPI result for 8C5B9127-ECD4-4657-980F-851019F99CA5:1: ACPI buffer length: 2
[ 827.888496] legion_laptop: ACPI result for 8C5B9127-ECD4-4657-980F-851019F99CA5:1: ACPI buffer length: 2
[ 827.888904] legion_laptop: ACPI result for 8C5B9127-ECD4-4657-980F-851019F99CA5:1: ACPI buffer length: 2
[ 827.889019] legion_laptop: Unexpected value in MINIFANCURVE register:0
[ 827.889250] legion_laptop: No access method for fancurve:0
[ 827.889252] legion_laptop: Size of object: 48
[ 827.889410] legion_laptop: ACPI result for 92549549-4bde-4f06-ac04-ce8bf898dbaa:5: ACPI buffer length: 88
@johnfanv2 I don't have my Legion 7i Pro Gen 8 yet, but it seems a common issue that people are seeing messages like these pretty regularly:
[ 587.416970] No Local Variables are initialized for Method [SNTM]
[ 587.416971] No Arguments are initialized for method [SNTM]
[ 587.416972] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0.SNTM due to previous error (AE_NOT_EXIST) (20230331/psparse-529)
[ 587.416975] ACPI Error: Aborting method \_SB.PC00.LPCB.EC0._Q77 due to previous error (AE_NOT_EXIST) (20230331/psparse-529)
[ 588.424882] ACPI Error: No handler for Region [RTCM] (0000000007a2f8f3) [SystemCMOS] (20230331/evregion-130)
[ 588.424889] ACPI Error: Region SystemCMOS (ID=5) has no handler (20230331/exfldio-261)
You'll see a few on the initial boot, and it seems that's all... But after resuming from sleep, messages relating to SNTM and RTCM occur pretty regularly (once per second it sounds like). Is this also something you can help with?
Let me know if you need a new issue. I've posted here since you can see some of these messages showing up under this issue already.
@johnfanv2 Seems the fan curve for RTX4080 is working now, but for RTX4090 there is still some work to do. Do you need some information from me (with RTX4090)?
It looks like reading of the fan curve in custom mode works. It displays 100, 200, 300, ... in the output of @lithces . In the output of @ronyclau it shows 0, 0, 0, ... . I am not sure why it is 0. Maybe this is the default value or was set with Windows tools.
I added the feature to set the fan curve. Please use the GUI and enter custom mode. Then change the fan curve (currently only the first row for fan 1), write it to hardware, and read it back. Please report back if it works and provide the log output from the GUI and dmesg.
Note that this is a new model and I am not sure what the unit for fan speed is. I guess currently, 1000 = 100%. Moreover, the new WMI interface to control fan speed in custom mode only allows to set one fan speed value for each step and does not have so many options like the old one. We can try later if we can write directly to the embedded controller like in the old models to get more features in all modes.
@camberkenpas You can open a new issue. This might be an issue of another component (not the embedded controller). The reason might be a problem in the ACPI firmware in the newer models or a missing implementation of some "ACPI calls" in Linux. Currently, I think this is no problem for fan control etc.
@johnfanv2 Unfortunately, I won't have my Legion 7i Pro Gen 8 until July at some point (and perhaps not until mid July or later as the shipping date has already been pushed back a bit). I'm just being proactive at trying to resolve any issues. :smile:
I've asked other Gen 8 owners to see if any of them can open the issue. Failing that, I'll open one myself once I have my Gen 8 in the next month or so.
I suspect it's a problem in the ACPI firmware itself, but I'm unsure how well that could be worked around.
Thank you so much for your time!
@johnfanv2 I (rtx4090) tried to set 250 to the first point (default to 100), and second point (default to 200), both attempts lead to immediate hang of the system (Screen stops updating, no response from mouse and keyboard)
Is there any way we could see the logs?
Sorry for the crash. It is a little hard to develop for the newer models without having one. I heavily rely on the ACPI disassembly and the provided memory dumps.
Please try the new version.
@johnfanv2 Seems that we are able to adjust the rpm for points ID other the first. I changed the value for the second, third point and Apply to HW, then I read the curve, I got this
Current fan curve in hardware:
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
100 0 0 0 0 0 0 0 0 0
300 0 0 0 0 0 0 0 0 0
400 0 0 0 0 0 0 0 0 0
400 0 0 0 0 0 0 0 0 0
500 0 0 0 0 0 0 0 0 0
600 0 0 0 0 0 0 0 0 0
700 0 0 0 0 0 0 0 0 0
800 0 0 0 0 0 0 0 0 0
800 0 0 0 0 0 0 0 0 0
800 0 0 0 0 0 0 0 0 0
=====================
Current fan curve in hardware (WMI; might be empty)
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
100 0 0 0 0 0 0 0 0 0
300 0 0 0 0 0 0 0 0 0
400 0 0 0 0 0 0 0 0 0
400 0 0 0 0 0 0 0 0 0
500 0 0 0 0 0 0 0 0 0
600 0 0 0 0 0 0 0 0 0
700 0 0 0 0 0 0 0 0 0
800 0 0 0 0 0 0 0 0 0
800 0 0 0 0 0 0 0 0 0
800 0 0 0 0 0 0 0 0 0
Any way to apply the pressure so that it could exactly reach the 2rd or 3rd level?
@johnfanv2 I have another question regarding to the GPU power settings. Currently is limited to 80W from nvidia-smi, on windows it is set to 175W..
I do find the following errors ''' 2023-07-01 08:19:04,023 - ERROR: Feature GPUCTGPPowerLimit reading error [Errno 22] Invalid argument '''
Any insight that we could increase the GPU power?
@johnfanv2 I have another question regarding to the GPU power settings. Currently is limited to 80W from nvidia-smi, on windows it is set to 175W..
I do find the following errors ''' 2023-07-01 08:19:04,023 - ERROR: Feature GPUCTGPPowerLimit reading error [Errno 22] Invalid argument '''
Any insight that we could increase the GPU power?
I know this a bit odd but the gpu power boost is not controller by the LLL module but by the nvidia driver, for getting the boost you need to enable nvidia-powerd.service, nvidia powerd is a bit buggy on older driver i recommend 535 or newer. For example i can get the full 130w in my RTX 3070 with powerd enable.
I know it new model it can be possible to change the gpu power using the LLL kernel like LLT on windows but i dont have a new model to test [see sreenshot]
You can try the option on your device if there are not at 0 [zero values means is not supported]
By the way GPUCTGPPowerLimit for what i remeber is the lowest boost in watts in other words, base wattage + boost, in mine GPU is 125+15, but i can only get 130W because is not a Legion 5 pro (Legion 5 Gen 6 is limited to 130W max even with custom vbios)
By the way for people using the aur @lithces @ronyclau @potatoalienof13 @camberkenpas The aur now use the latest git every time independent of version reported in the aur website, you can use without problems. I gonna close this as complete any problems with support for your laptop pls reopen.
Problem Descripition I am running latest Arch Linux and I successfully installed the kernel dkms.
The modules
legion_laptop
are loaded, however in dmesg I found that legion PNP0C09:00: legion_laptop not loaded for this device.Just wondering if we can use the tool for the latest Legion 7i Pro 2023, in China Y9000P 至尊版 2023
Model and Debug Info
Distribution: 6.3.4-2-MANJARO (64-bit) (including version, e.g. Ubuntu 24.04) Model name: Legion Y9000P IRX8H CPU model: Intel 13900HX (e.g. AMD Ryzen 7 5800H) GPU model: NVIDIA RTX 4090 (e.g NVIDIA RTX 3700) Keyboard backlight: single color with off/medium/bright (RGB, single color with off/on, single color with off/medium/bright) Light in lid or logo: ??? (yes/no) Light at IO-Ports at back: ??? (yes/no)
Output of
sudo dmidecode -t system
. Please remove Serial Number and UUID for privacy:Output of
sudo dmidecode -t bios
:Output of
sudo cat /sys/kernel/debug/legion/fancurve
: