johnfanv2 / LenovoLegionLinux

Driver and tools for controlling Lenovo Legion laptops in Linux including fan control and power mode.
https://github.com/johnfanv2/LenovoLegionLinux
GNU General Public License v2.0
1.31k stars 49 forks source link

Lenovo Legion Y9000X IAH7 (2022) Support #86

Open YisuiDenghua opened 11 months ago

YisuiDenghua commented 11 months ago

Model name: Lenovo Legion Y9000X IAH7 CPU model: 12th Gen Intel i7-12700H (20) @ 4.600GHz GPU model: NVIDIA GeForce RTX 3060 Mobile / Max-Q Keyboard backlight: single color with off/medium/bright System: GNU/Linux x86_64, NixOS

By default legion-laptop module will not loaded in this model:

[    2.584254] legion_laptop starts loading
[    2.584824] legion PNP0C09:00: legion_laptop platform driver probing
[    2.585834] legion PNP0C09:00: Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82TF; DMI_BIOS_VERSION:JYCN34WW
[    2.585839] legion PNP0C09:00: is_denied: 0; is_allowed: 0; do_load_by_list: 0; do_load: 0
[    2.585841] 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.
[    2.585842] legion PNP0C09:00: legion_laptop not loaded for this device
[    2.586469] legion: probe of PNP0C09:00 failed with error -12

output of sudo dmidecode -t system

# dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 3.4.0 present.

Handle 0x001F, DMI type 32, 11 bytes
System Boot Information
    Status: No errors detected

Handle 0x0021, DMI type 12, 5 bytes
System Configuration Options
    Option 1: J6H1:1-X Boot with Default; J8H1:1-X BIOS RECOVERY

Handle 0x001B, DMI type 1, 27 bytes
System Information
    Manufacturer: LENOVO
    Product Name: 82TF
    Version: Legion Y9000X IAH7

    Wake-up Type: Other
    SKU Number: LENOVO_MT_82TF_BU_idea_FM_Legion Y9000X IAH7
    Family: Legion Y9000X IAH7

Handle 0x0060, DMI type 15, 31 bytes
System Event Log
    Area Length: 98 bytes
    Header Start Offset: 0x0000
    Header Length: 16 bytes
    Data Start Offset: 0x0010
    Access Method: General-purpose non-volatile data functions
    Access Address: 0x00F0
    Status: Valid, Not Full
    Change Token: 0x00000005
    Header Format: Type 1
    Supported Log Type Descriptors: 4
    Descriptor 1: POST error
    Data Format 1: POST results bitmap
    Descriptor 2: PCI system error
    Data Format 2: None
    Descriptor 3: System reconfigured
    Data Format 3: None
    Descriptor 4: Log area reset/cleared
    Data Format 4: None

Output of dmidecode -t bios :

# dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 3.4.0 present.

Handle 0x0020, DMI type 13, 22 bytes
BIOS Language Information
    Language Description Format: Abbreviated
    Installable Languages: 1
        enUS
    Currently Installed Language: enUS

Handle 0x001A, DMI type 0, 26 bytes
BIOS Information
    Vendor: LENOVO
    Version: JYCN34WW
    Release Date: 05/07/2022
    ROM Size: 32 MB
    Characteristics:
        ACPI is supported
        USB legacy is supported
        LS-120 boot is supported
        ATAPI Zip drive boot is supported
        BIOS boot specification is supported
        Function key-initiated network boot is supported
        Targeted content distribution is supported
        UEFI is supported
    BIOS Revision: 1.34
    Firmware Revision: 1.34

Output of sudo cat /sys/kernel/debug/legion/fancurve :

cat: /sys/kernel/debug/legion/fancurve: No such file or directory

Inspecting WMI entries

fwts_wmi.log

Disassembling ACPI tables

(bash) # ls /sys/firmware/acpi/tables/
APIC  data  DMAR     FACP  HPET  MSDM  SSDT1   SSDT12  SSDT15  SSDT18  SSDT20  SSDT4  SSDT7  TPM2
BATB  DBG2  DSDT     FACS  LPIT  NHLT  SSDT10  SSDT13  SSDT16  SSDT19  SSDT21  SSDT5  SSDT8  UEFI
BGRT  DBGP  dynamic  FPDT  MCFG  PHAT  SSDT11  SSDT14  SSDT17  SSDT2   SSDT3   SSDT6  SSDT9  WSMT

(bash) # sudo cp --no-preserve=mode /sys/firmware/acpi/tables/*SDT* .

(bash) # iasl -e SSDT* -d DSDT

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

File appears to be binary: found 185208 non-ASCII characters, disassembling
Binary file appears to be a valid ACPI table, disassembling
Input file DSDT, Length 0x805A8 (525736) bytes
ACPI: DSDT 0x0000000000000000 0805A8 (v02 LENOVO ADL-P-M  00000002      01000013)
External object resolution file            SSDT9
Input file SSDT9, Length 0x8755 (34645) bytes
ACPI: SSDT 0x0000000000000000 008755 (v02 LENOVO TcssSsdt 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file            SSDT8
Input file SSDT8, Length 0x355A (13658) bytes
ACPI: SSDT 0x0000000000000000 00355A (v02 LENOVO IgfxSsdt 00003000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file            SSDT7
Input file SSDT7, Length 0x2B22 (11042) bytes
ACPI: SSDT 0x0000000000000000 002B22 (v02 LENOVO SaSsdt   00003000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file            SSDT6
Input file SSDT6, Length 0x60E (1550) bytes
ACPI: SSDT 0x0000000000000000 00060E (v02 LENOVO Tpm2Tabl 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file            SSDT5
Input file SSDT5, Length 0xFC (252) bytes
ACPI: SSDT 0x0000000000000000 0000FC (v01 LENOVO SmiTable 00000001 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file            SSDT4
Input file SSDT4, Length 0x1040 (4160) bytes
ACPI: SSDT 0x0000000000000000 001040 (v01 LENOVO WmiTable 00000001 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file            SSDT3
Input file SSDT3, Length 0x3293 (12947) bytes
ACPI: SSDT 0x0000000000000000 003293 (v02 LENOVO DptfTabl 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT21
Input file SSDT21, Length 0x1AB (427) bytes
ACPI: SSDT 0x0000000000000000 0001AB (v02 PmRef  Cpu0Psd  00003000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT20
Input file SSDT20, Length 0x144 (324) bytes
ACPI: SSDT 0x0000000000000000 000144 (v02 LENOVO ADebTabl 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file            SSDT2
Input file SSDT2, Length 0x5D01 (23809) bytes
ACPI: SSDT 0x0000000000000000 005D01 (v02 LENOVO CpuSsdt  00003000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT19
Input file SSDT19, Length 0x235 (565) bytes
ACPI: SSDT 0x0000000000000000 000235 (v02 LENOVO HgPeg    00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT18
Input file SSDT18, Length 0x2B2A (11050) bytes
ACPI: SSDT 0x0000000000000000 002B2A (v02 LENOVO SocCmn   00003000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT17
Input file SSDT17, Length 0x3AEA (15082) bytes
ACPI: SSDT 0x0000000000000000 003AEA (v02 LENOVO SocGpe   00003000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT16
Input file SSDT16, Length 0xDC1 (3521) bytes
ACPI: SSDT 0x0000000000000000 000DC1 (v02 LENOVO xh_adlMR 00000000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT15
Input file SSDT15, Length 0x5311 (21265) bytes
ACPI: SSDT 0x0000000000000000 005311 (v01 LENOVO NvdTable 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT14
Input file SSDT14, Length 0x124F (4687) bytes
ACPI: SSDT 0x0000000000000000 00124F (v02 LENOVO UsbCTabl 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT13
Input file SSDT13, Length 0x2233 (8755) bytes
ACPI: SSDT 0x0000000000000000 002233 (v02 LENOVO TbtTypeC 00000000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT12
Input file SSDT12, Length 0x2A83 (10883) bytes
ACPI: SSDT 0x0000000000000000 002A83 (v02 LENOVO PtidDevc 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT11
Input file SSDT11, Length 0x1F1A (7962) bytes
ACPI: SSDT 0x0000000000000000 001F1A (v02 LENOVO Ther_Rvp 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file           SSDT10
Input file SSDT10, Length 0x6C21 (27681) bytes
ACPI: SSDT 0x0000000000000000 006C21 (v02 LENOVO AdlP_2MR 00001000 INTL 20200717)
Pass 1 parse of [SSDT]
Firmware Error (ACPI): Failure creating named object [\_SB.PC00.PEG2.PEGP._S0W], AE_ALREADY_EXISTS (20220331/dswload-495)
ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20220331/psobject-372)
Could not parse external ACPI tables, AE_ALREADY_EXISTS

acpi_re.zip

Gathering WMI info in Windows

newfile.txt

Originally posted by @YisuiDenghua in https://github.com/johnfanv2/LenovoLegionLinux/issues/46#issuecomment-1635321621

johnfanv2 commented 11 months ago

@YisuiDenghua

Is Y9000X the original or Chinese name?

I added your model/BIOS to the kernel module. Please get the new version, recompile, and reload the kernel module (no need to force anymore).

Then, please test the following features. We have to try a bit to find the correct configuration.

Temperatures and Fan Speeds

Please read the fan speeds and temperatures (see README) and confirm that they are sensible and change accordingly, e.g. when you put load onto the CPU the CPU temp and the fan speeds should increase, but GPU temp should stay roughly the same.

Powermode

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 GUI (see README) and the LED changes accordingly.

Tests the following features 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.

Please provide the log output from the GUI from the log tab for all the tests.

Fn Lock

Win Key

Touchpad

Battery Conservation

Rapid Charging

Charge Output Always On

Display Overdrive

Keyboard Backlight

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

Fan curve

First, please give again the output of

sudo cat /sys/kernel/debug/legion/fancurve
sudo dmesg | tail -n 30

Second, please use the GUI and enter custom mode. Do you have a custom mode (e.g. in Legion Toolkit in Windows)? 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 sudo dmesg | tail -n 70.

YisuiDenghua commented 11 months ago

@YisuiDenghua

Is Y9000X the original or Chinese name?

I added your model/BIOS to the kernel module. Please get the new version, recompile, and reload the kernel module (no need to force anymore).

Then, please test the following features. We have to try a bit to find the correct configuration.

Temperatures and Fan Speeds

Please read the fan speeds and temperatures (see README) and confirm that they are sensible and change accordingly, e.g. when you put load onto the CPU the CPU temp and the fan speeds should increase, but GPU temp should stay roughly the same.

Powermode

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 GUI (see README) and the LED changes accordingly.

Tests the following features 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.

Please provide the log output from the GUI from the log tab for all the tests.

Fn Lock

* Enable fn-lock: A LED might turn on. fn functions now work without pressing Fn

* Disable fn-lock: A LED might turn on. fn functions now work only when pressing Fn

Win Key

* Enable Win Key: Win Key should work, e.g. open start menu or trigger some other action

* Disable Win Key: Win Key has no function anymore

Touchpad

* Enable Touchpad: Touchpad works

* Disable Touchpad: Touchpad does not work

Battery Conservation

* Enabled: charging stops if above 60 % (or 80% depending on model)

* Disabled: charging works up to 100%
  Note: Sometimes it takes a 10-20 seconds before it takes effect

Rapid Charging

* Enabled: Charging is faster; Check this by comparing the time until fully charged displayed in system information or by comparing charging current.

* Disabled: Charging is slower
  Note: Sometimes it takes a 10-20 seconds before it takes effect .

Charge Output Always On

* Enabled: Some USB output is always powered even when laptop is off or sleeping; Test e.g. by trying to charge your phone.

* Disabled: USB outputs are off when laptop is off

Display Overdrive

* Enabled: display somehow faster

* Disabled: display not faster
  Just check if checkbox can be checked or not if you cannot verify that it has an effect.

Keyboard Backlight

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

Fan curve

First, please give again the output of

sudo cat /sys/kernel/debug/legion/fancurve
sudo dmesg | tail -n 30

Second, please use the GUI and enter custom mode. Do you have a custom mode (e.g. in Legion Toolkit in Windows)? 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 sudo dmesg | tail -n 70.

Sorry, I don't know how to use the new version in my system.

johnfanv2 commented 11 months ago

I updated the code. You just have to download the code from github again. Then, compile/build it again (make), and load the module (make reloadmodule). See the README (https://github.com/johnfanv2/LenovoLegionLinux) for detailed instructions.

YisuiDenghua commented 11 months ago

I updated the code. You just have to download the code from github again. Then, compile/build it again (make), and load the module (make reloadmodule). See the README (https://github.com/johnfanv2/LenovoLegionLinux) for detailed instructions.

Since NixOS doesn't follow FHS, make is not usable on it. I'm still trying to package the new version of the driver. But I'm not familiar with packaging a kernel module.

johnfanv2 commented 11 months ago

Maybe you could install make like here https://stackoverflow.com/questions/74649163/how-to-install-the-make-command-in-nixos or here https://www.reddit.com/r/NixOS/comments/s71md4/installing_make/. It is enough to have the files in your home folder and compile it there. There is no need to install the new driver but insmod must be possible. It is used inside the makefile.

YisuiDenghua commented 11 months ago

@johnfanv2

Thanks. Tested with make , no errors found.

Y9000X is it's original name.

Conclusion : "Charge Output Always On", "Fan curve"

Temperatures and Fan Speeds

I tested CPU with stress --cpu 4 --timeout 60, then used psensor to monitor the temperature.

CPU temp raised, then I heard the sound of the fan. But on psensor , the speeds of the fan didn't raise.

And then I test with the Lenovo Legion Linux GUI, it shows that the speeds of the fan raised.

GPU temp stay roughly the same.

image

image

the 2nd image shows the temp and the fan's speeds when I'm putting load onto the CPU.

Powermode

These are outputs of sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C, sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C and sudo cat /sys/kernel/debug/legion/fancurve

ballance.txt

performance.txt

quiet.txt

Then I used the GUI tools to change power mode, it works fine and the LED changed its colour. I also tested it with powerprofilesctl list, no problems found.

Fn Lock

I used the GUI tools to change Fn Lock, it works as expected.

Win Key

Works.

Touchpad

Works.

Battery Conservation

Works.

Rapid Charging

Works.

*Charge Output Always On

Doesn't work.

Log:

INFO:legion_linux.legion:Click on UI Charge Output from USB always on element for AlwaysOnUSBChargingFeature
Error occured 
Traceback (most recent call last):
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/legion_gui.py", line 185, in update_feature_from_view
    self.feature.set(gui_value)
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 452, in set
    raise NotImplementedError()
NotImplementedError

Display Overdrive

Works.

Keyboard Backlight

off.txt medium.txt bright.txt

*Fan curve

Error.

ERROR:legion_linux.legion:[38003.058552] legion_laptop: Set fancurve
[38003.120511] legion_laptop: Set fancurve
[38003.182298] legion_laptop: Set fancurve
[38003.244527] legion_laptop: Set fancurve
[38003.306660] legion_laptop: Set fancurve
[38003.368817] legion_laptop: Set fancurve
[38003.430410] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 8
[38003.460389] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 8
[38003.490660] legion_laptop: Set fancurve
[38003.551943] legion_laptop: Set fancurve
[38003.613297] legion_laptop: Set fancurve
[38003.674760] legion_laptop: Set fancurve
[38003.736034] legion_laptop: Set fancurve
[38003.797313] legion_laptop: Set fancurve
[38003.858559] legion_laptop: Set fancurve
[38003.919722] legion_laptop: Set fancurve
[38003.981033] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 9
[38004.011085] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 9
[38081.441538] ACPI Error: Aborting method \_SB.GZFD.WMAD due to previous error (AE_AML_BUFFER_LIMIT) (20220331/psparse-529)
[38081.441545] legion_laptop: ACPI evaluation error for: 14afd777-106f-4c9b-b334-d388dc7809be:1

Error occured [Errno 22] 无效的参数
Traceback (most recent call last):
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/legion_gui.py", line 205, in update_view_from_feature
    feature_value = self.feature.get()
                    ^^^^^^^^^^^^^^^^^^
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 297, in get
    invalue = self._read_file_int(self.filename)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 231, in _read_file_int
    return int(self._read_file_str(file_path))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 228, in _read_file_str
    raise err
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 222, in _read_file_str
    out = str(filepointer.read()).strip()
              ^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] 无效的参数

Dmesg:

[38148.997516] legion_laptop: Set fancurve
[38149.058965] legion_laptop: Set fancurve
[38149.120227] legion_laptop: Set fancurve
[38149.181502] legion_laptop: Set fancurve
[38149.242746] legion_laptop: Set fancurve
[38149.304167] legion_laptop: Set fancurve
[38149.365391] legion_laptop: Set fancurve
[38149.426655] legion_laptop: Set fancurve
[38149.487865] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 3
[38149.518094] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 3
[38149.548167] legion_laptop: Set fancurve
[38149.609493] legion_laptop: Set fancurve
[38149.670691] legion_laptop: Set fancurve
[38149.732098] legion_laptop: Set fancurve
[38149.793410] legion_laptop: Set fancurve
[38149.854660] legion_laptop: Set fancurve
[38149.915852] legion_laptop: Set fancurve
[38149.977085] legion_laptop: Set fancurve
[38150.038469] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 4
[38150.068546] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 4
[38150.098615] legion_laptop: Set fancurve
[38150.159992] legion_laptop: Set fancurve
[38150.221250] legion_laptop: Set fancurve
[38150.282609] legion_laptop: Set fancurve
[38150.343827] legion_laptop: Set fancurve
[38150.405072] legion_laptop: Set fancurve
[38150.466317] legion_laptop: Set fancurve
[38150.527654] legion_laptop: Set fancurve
[38150.589093] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 5
[38150.619127] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 5
[38150.649177] legion_laptop: Set fancurve
[38150.710389] legion_laptop: Set fancurve
[38150.771575] legion_laptop: Set fancurve
[38150.832855] legion_laptop: Set fancurve
[38150.894161] legion_laptop: Set fancurve
[38150.955433] legion_laptop: Set fancurve
[38151.016783] legion_laptop: Set fancurve
[38151.078007] legion_laptop: Set fancurve
[38151.139215] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 6
[38151.169303] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 6
[38151.199551] legion_laptop: Set fancurve
[38151.260826] legion_laptop: Set fancurve
[38151.322161] legion_laptop: Set fancurve
[38151.383336] legion_laptop: Set fancurve
[38151.444654] legion_laptop: Set fancurve
[38151.505836] legion_laptop: Set fancurve
[38151.567197] legion_laptop: Set fancurve
[38151.628454] legion_laptop: Set fancurve
[38151.689694] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 7
[38151.719726] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 7
[38151.749809] legion_laptop: Set fancurve
[38151.811010] legion_laptop: Set fancurve
[38151.872210] legion_laptop: Set fancurve
[38151.933414] legion_laptop: Set fancurve
[38151.994804] legion_laptop: Set fancurve
[38152.056182] legion_laptop: Set fancurve
[38152.117437] legion_laptop: Set fancurve
[38152.178684] legion_laptop: Set fancurve
[38152.239918] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 8
[38152.270010] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 8
[38152.300060] legion_laptop: Set fancurve
[38152.361306] legion_laptop: Set fancurve
[38152.422512] legion_laptop: Set fancurve
[38152.483717] legion_laptop: Set fancurve
[38152.544998] legion_laptop: Set fancurve
[38152.606278] legion_laptop: Set fancurve
[38152.667540] legion_laptop: Set fancurve
[38152.728813] legion_laptop: Set fancurve
[38152.790004] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 9
[38152.820121] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 9
mxdh commented 10 months ago

IMO, Y9000X is the Chinese name.

When I enter the serial number of my laptop on pcsupport.lenovo.com, I get this link, so I think its international name is Legion S7 16IAH7 or Legion Slim 7i Gen 7.

MrDuartePT commented 8 months ago

@johnfanv2

Thanks. Tested with make , no errors found.

Y9000X is it's original name.

Conclusion : "Charge Output Always On", "Fan curve"

Temperatures and Fan Speeds

I tested CPU with stress --cpu 4 --timeout 60, then used psensor to monitor the temperature.

CPU temp raised, then I heard the sound of the fan. But on psensor , the speeds of the fan didn't raise.

And then I test with the Lenovo Legion Linux GUI, it shows that the speeds of the fan raised.

GPU temp stay roughly the same.

image

image

the 2nd image shows the temp and the fan's speeds when I'm putting load onto the CPU.

Powermode

These are outputs of sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C, sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C and sudo cat /sys/kernel/debug/legion/fancurve

ballance.txt

performance.txt

quiet.txt

Then I used the GUI tools to change power mode, it works fine and the LED changed its colour. I also tested it with powerprofilesctl list, no problems found.

Fn Lock

I used the GUI tools to change Fn Lock, it works as expected.

Win Key

Works.

Touchpad

Works.

Battery Conservation

Works.

Rapid Charging

Works.

*Charge Output Always On

Doesn't work.

Log:

INFO:legion_linux.legion:Click on UI Charge Output from USB always on element for AlwaysOnUSBChargingFeature
Error occured 
Traceback (most recent call last):
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/legion_gui.py", line 185, in update_feature_from_view
    self.feature.set(gui_value)
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 452, in set
    raise NotImplementedError()
NotImplementedError

Display Overdrive

Works.

Keyboard Backlight

off.txt medium.txt bright.txt

*Fan curve

Error.

ERROR:legion_linux.legion:[38003.058552] legion_laptop: Set fancurve
[38003.120511] legion_laptop: Set fancurve
[38003.182298] legion_laptop: Set fancurve
[38003.244527] legion_laptop: Set fancurve
[38003.306660] legion_laptop: Set fancurve
[38003.368817] legion_laptop: Set fancurve
[38003.430410] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 8
[38003.460389] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 8
[38003.490660] legion_laptop: Set fancurve
[38003.551943] legion_laptop: Set fancurve
[38003.613297] legion_laptop: Set fancurve
[38003.674760] legion_laptop: Set fancurve
[38003.736034] legion_laptop: Set fancurve
[38003.797313] legion_laptop: Set fancurve
[38003.858559] legion_laptop: Set fancurve
[38003.919722] legion_laptop: Set fancurve
[38003.981033] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 9
[38004.011085] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 9
[38081.441538] ACPI Error: Aborting method \_SB.GZFD.WMAD due to previous error (AE_AML_BUFFER_LIMIT) (20220331/psparse-529)
[38081.441545] legion_laptop: ACPI evaluation error for: 14afd777-106f-4c9b-b334-d388dc7809be:1

Error occured [Errno 22] 无效的参数
Traceback (most recent call last):
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/legion_gui.py", line 205, in update_view_from_feature
    feature_value = self.feature.get()
                    ^^^^^^^^^^^^^^^^^^
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 297, in get
    invalue = self._read_file_int(self.filename)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 231, in _read_file_int
    return int(self._read_file_str(file_path))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 228, in _read_file_str
    raise err
  File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 222, in _read_file_str
    out = str(filepointer.read()).strip()
              ^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] 无效的参数

Dmesg:

[38148.997516] legion_laptop: Set fancurve
[38149.058965] legion_laptop: Set fancurve
[38149.120227] legion_laptop: Set fancurve
[38149.181502] legion_laptop: Set fancurve
[38149.242746] legion_laptop: Set fancurve
[38149.304167] legion_laptop: Set fancurve
[38149.365391] legion_laptop: Set fancurve
[38149.426655] legion_laptop: Set fancurve
[38149.487865] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 3
[38149.518094] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 3
[38149.548167] legion_laptop: Set fancurve
[38149.609493] legion_laptop: Set fancurve
[38149.670691] legion_laptop: Set fancurve
[38149.732098] legion_laptop: Set fancurve
[38149.793410] legion_laptop: Set fancurve
[38149.854660] legion_laptop: Set fancurve
[38149.915852] legion_laptop: Set fancurve
[38149.977085] legion_laptop: Set fancurve
[38150.038469] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 4
[38150.068546] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 4
[38150.098615] legion_laptop: Set fancurve
[38150.159992] legion_laptop: Set fancurve
[38150.221250] legion_laptop: Set fancurve
[38150.282609] legion_laptop: Set fancurve
[38150.343827] legion_laptop: Set fancurve
[38150.405072] legion_laptop: Set fancurve
[38150.466317] legion_laptop: Set fancurve
[38150.527654] legion_laptop: Set fancurve
[38150.589093] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 5
[38150.619127] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 5
[38150.649177] legion_laptop: Set fancurve
[38150.710389] legion_laptop: Set fancurve
[38150.771575] legion_laptop: Set fancurve
[38150.832855] legion_laptop: Set fancurve
[38150.894161] legion_laptop: Set fancurve
[38150.955433] legion_laptop: Set fancurve
[38151.016783] legion_laptop: Set fancurve
[38151.078007] legion_laptop: Set fancurve
[38151.139215] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 6
[38151.169303] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 6
[38151.199551] legion_laptop: Set fancurve
[38151.260826] legion_laptop: Set fancurve
[38151.322161] legion_laptop: Set fancurve
[38151.383336] legion_laptop: Set fancurve
[38151.444654] legion_laptop: Set fancurve
[38151.505836] legion_laptop: Set fancurve
[38151.567197] legion_laptop: Set fancurve
[38151.628454] legion_laptop: Set fancurve
[38151.689694] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 7
[38151.719726] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 7
[38151.749809] legion_laptop: Set fancurve
[38151.811010] legion_laptop: Set fancurve
[38151.872210] legion_laptop: Set fancurve
[38151.933414] legion_laptop: Set fancurve
[38151.994804] legion_laptop: Set fancurve
[38152.056182] legion_laptop: Set fancurve
[38152.117437] legion_laptop: Set fancurve
[38152.178684] legion_laptop: Set fancurve
[38152.239918] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 8
[38152.270010] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 8
[38152.300060] legion_laptop: Set fancurve
[38152.361306] legion_laptop: Set fancurve
[38152.422512] legion_laptop: Set fancurve
[38152.483717] legion_laptop: Set fancurve
[38152.544998] legion_laptop: Set fancurve
[38152.606278] legion_laptop: Set fancurve
[38152.667540] legion_laptop: Set fancurve
[38152.728813] legion_laptop: Set fancurve
[38152.790004] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 9
[38152.820121] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 9

It look you introduce some zeros in the values try read from hardware after fn+q and change for example on value, record to hardware and verify the value apply.

About charge always on. Verify if you have the option in the bios if not, unfortunately your legion is not supported.