Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Lenovo Legion 7 2022 - Legion 7 16ARHA7 #23

Closed
albsen opened this issue Mar 7, 2023 · 6 comments
Closed

Support for Lenovo Legion 7 2022 - Legion 7 16ARHA7 #23

albsen opened this issue Mar 7, 2023 · 6 comments

Comments

@albsen
Copy link

albsen commented Mar 7, 2023

Hi,

I found your project when looking around for options to tweak power profiles so that I can get more battery life.

From a previous ticket I saw you guiding the reporter to provide you the DSDT.dsl file ( #13 ) so I went ahead and already uploaded that.

The current code compiles but the module refuses to load on 6.1, 6.2 and 6.3 the messages are identical.

sudo make reloadmodule

...
[ 1741.406538] legion_laptop 0.1 starts unloading
[ 1741.406569] legion_laptop 0.1 unloaded
[ 1741.421131] legion_laptop 0.1 starts loading
[ 1741.421133] Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82UH; DMI_BIOS_VERSION:K9CN38WW
[ 1741.421193] legion PNP0C09:00: legion_laptop platform driver 0.1 probing
[ 1741.421194] Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82UH; DMI_BIOS_VERSION:K9CN38WW
[ 1741.421196] legion PNP0C09:00: is_denied: 0; is_allowed: 0; do_load_by_list: 0; do_load: 0
[ 1741.421197] 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.
[ 1741.421198] legion PNP0C09:00: legion_laptop not loaded for this device
[ 1741.421237] legion: probe of PNP0C09:00 failed with error -12

When trying to load with forcereload I get the following:

sudo make forcereloadmodule

...
[ 1686.086164] legion_laptop 0.1 starts unloading
[ 1686.086203] legion_laptop 0.1 unloaded
[ 1686.097996] legion_laptop 0.1 starts loading
[ 1686.097998] Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82UH; DMI_BIOS_VERSION:K9CN38WW
[ 1686.098058] legion PNP0C09:00: legion_laptop platform driver 0.1 probing
[ 1686.098060] Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82UH; DMI_BIOS_VERSION:K9CN38WW
[ 1686.098061] legion PNP0C09:00: is_denied: 0; is_allowed: 0; do_load_by_list: 0; do_load: 1
[ 1686.098063] legion PNP0C09:00: legion_laptop is forced to load.
[ 1686.098063] legion PNP0C09:00: legion_laptop is forced to load and would otherwise be not loaded
[ 1686.098064] legion PNP0C09:00: Using configuration for system: GKCN
[ 1686.098078] Succeffuly mapped embedded controller: 0xfe00d400 (in RAM)/0xc400 (in EC) to virtual 0x00000000f573450b
[ 1686.098174] legion PNP0C09:00: Read embedded controller ID 0x5507
[ 1686.098175] legion PNP0C09:00: Expected EC chip id 0x8227 but read 0x5507
[ 1686.098176] Unloading legion ecram
[ 1686.098176] Unmapping embedded controller memory at 0xfe00d400 (in RAM)/0xc400 (in EC) at virtual 0x00000000f573450b
[ 1686.098177] Unloading legion ecram done
[ 1686.098177] Unloading legion shared
[ 1686.098178] Unloading legion shared done
[ 1686.098178] legion PNP0C09:00: legion_laptop not loaded for this device
[ 1686.098238] legion: probe of PNP0C09:00 failed with error -12

As requested in the other ticket, please find attached the DSDT.dsl file:

DSDT_16ARHA7.zip

I took a look around and found the region with most of the fields is at: 0xFE0B0400

OperationRegion (ERAX, SystemMemory, 0xFE0B0400, 0xFF)
                    Field (ERAX, ByteAcc, Lock, Preserve)

The next best list of fields was a bit further down:

                    Scope (\)
                    {
                        OperationRegion (LFCN, SystemMemory, 0x92DD2298, 0x0377)
                        Field (LFCN, AnyAcc, Lock, Preserve)

I also had a look at your code but couldn't figure out how you know what to map.

Thank you for this project. Let me know if any further information is needed.

@johnfanv2
Copy link
Owner

johnfanv2 commented Mar 7, 2023

I used the offset from your file (0xFE0B0400) and updated the code to use this offset for your BIOS. Let's try it with it.

Please pull new version, build with make and load with make forcereloadmodulereadonly. Then give the output from dmesg (should be outputted after loading) and (if possible) from cat /sys/kernel/debug/legion/fancurve. Also output cat /sys/kernel/debug/legion/ecmemory | hexdump -C after you changed the powermode with Fn+Q (three times).

What exactly do mean by "tweak power profiles so that I can get more battery life"? Most of the power saving should be possible without this module.

  • CPU: use correct driver, select correct governor, disable boost if you want, throttle max frequency if you want
  • GPU: use iGPU in CPU instead of discrete GPU such that GPU can power down; This can be done in hybrid mode for a NVIDIA GPU. I guess you have a AMD GPU, so this might be similar.
  • Screen: reduce frame rate, reduce brightness
  • WiFi: power save mode

@albsen
Copy link
Author

albsen commented Mar 8, 2023

Thanks for the changes and the detailed response, I really appreciate it. Looks like its working.
The test confirms that I can alter the fan curve as suggested in the test pack as well.

Here is what I ran and observed in detail on 6.2-rc8:

> $ make clean                                                                                                      ∞  [±main ●]
make -C /lib/modules/6.2.0-rc8-seb/build M=/home/albsen/Software/LenovoLegionLinux/kernel_module clean
make[1]: Entering directory '/home/albsen/projects/albsen/fedora_kernel/test_kernel/linux-6.2-rc8-21-ge1c04510f521'
  CLEAN   /home/albsen/Software/LenovoLegionLinux/kernel_module/Module.symvers
make[1]: Leaving directory '/home/albsen/projects/albsen/fedora_kernel/test_kernel/linux-6.2-rc8-21-ge1c04510f521'

> $ make                                                                                                            ∞  [±main ●]
make -C /lib/modules/6.2.0-rc8-seb/build M=/home/albsen/Software/LenovoLegionLinux/kernel_module modules
make[1]: Entering directory '/home/albsen/projects/albsen/fedora_kernel/test_kernel/linux-6.2-rc8-21-ge1c04510f521'
  CC [M]  /home/albsen/Software/LenovoLegionLinux/kernel_module/legion-laptop.o
  MODPOST /home/albsen/Software/LenovoLegionLinux/kernel_module/Module.symvers
  CC [M]  /home/albsen/Software/LenovoLegionLinux/kernel_module/legion-laptop.mod.o
  LD [M]  /home/albsen/Software/LenovoLegionLinux/kernel_module/legion-laptop.ko
make[1]: Leaving directory '/home/albsen/projects/albsen/fedora_kernel/test_kernel/linux-6.2-rc8-21-ge1c04510f521'
sudo make reloadmodule
...
[60203.985842] legion_laptop: loading out-of-tree module taints kernel.
[60203.985897] legion_laptop: module verification failed: signature and/or required key missing - tainting kernel
[60203.986680] legion_laptop 0.1 starts loading
[60203.986681] Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82UH; DMI_BIOS_VERSION:K9CN38WW
[60203.986735] legion PNP0C09:00: legion_laptop platform driver 0.1 probing
[60203.986736] Read identifying information: DMI_SYS_VENDOR: LENOVO; DMI_PRODUCT_NAME: 82UH; DMI_BIOS_VERSION:K9CN38WW
[60203.986738] legion PNP0C09:00: is_denied: 0; is_allowed: 1; do_load_by_list: 1; do_load: 1
[60203.986739] legion PNP0C09:00: Using configuration for system: K9CN
[60203.986754] Succeffuly mapped embedded controller: 0xfe0b0400 (in RAM)/0xc400 (in EC) to virtual 0x00000000602102cc
[60203.986756] Unexpected read at offset 8192 into EC RAM
[60203.986757] Error reading EC RAM at 0x2000
[60203.986757] Unexpected read at offset 8193 into EC RAM
[60203.986758] Error reading EC RAM at 0x2001
[60203.986758] legion PNP0C09:00: Read embedded controller ID 0x0
[60203.986759] legion PNP0C09:00: Skipped checking embedded controller id
[60203.986759] legion PNP0C09:00: Creating debugfs inteface
[60203.986764] Creating sysfs inteface
[60203.986766] Creating hwmon interface
[60203.986808] Creating platform profile support
[60203.986810] Init WMI driver support
[60203.986825] legion_wmi 887B54E3-DDDC-4B2C-8B88-68A26A8835D0: Register after probing for WMI.
[60203.986844] legion_wmi BFD42481-AEE3-4501-A107-AFB68425C5F8: Register after probing for WMI.
[60203.986851] legion_wmi BFD42481-AEE3-4502-A107-AFB68425C5F8: Register after probing for WMI.
[60203.986857] legion_wmi D062906B-12D4-4510-999D-4831EE80E985: Register after probing for WMI.
[60203.986863] legion_wmi BC72A435-E8C1-4275-B3E2-D8B8074ABA59: Register after probing for WMI.
[60203.986869] legion_wmi 10AFC6D9-EA8B-4590-A2E7-1CD3C84BB4B1: Register after probing for WMI.
[60203.986874] legion_wmi D320289E-8FEA-41E0-86F9-611D83151B5F: Register after probing for WMI.
[60203.986893] legion PNP0C09:00: legion_laptop loaded for this device

The fancurve is showing:

> $ sudo cat /sys/kernel/debug/legion/fancurve                                                                                               ∞  [±main ●]
EC Chip ID: 0
EC Chip Version: 0
legion_laptop version: 0.1
legion_laptop features: fancurve powermode platformprofile platformprofilenotify minifancurve
legion_laptop ec_readonly: 0
minifancurve feature enabled: 0
minifancurve on cool: true
lock fan controller: false
enable maximumfanspeed: false
enable maximumfanspeed status: 0
fan curve current point id: 2
fan curve points size: 4
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
0        0       2       2       0       127     0       127     0       37
1600     1600    2       2       127     127     127     127     33      41
1700     1600    2       2       127     127     127     127     38      46
1900     1800    2       2       127     127     127     127     41      127

The test confirms that I can alter the fancurves as suggested in the test pack as well.

For your other suggestions, I'm currently on a journey to address compatibility issues one by one, so far I managed to:

  • CPU: I've not been aware that I can select a driver, I'll research what to do on 6800H -(edit) I am using amd-pstate
  • GPU: I had some rendering issues that I addressed using a custom patch based on a suggestion from AMD, didn't even get to finding out why vgaswitcheroo isn't working yet. It's been surprisingly difficult to get the dGPU to turn off, I mostly use the iGPU as it's perfect for most my work needs.
  • Screen: the screen is reporting 60Hz, but that might not be true, not sure how to test that
  • Wifi: I switched the card for a Intel Corp. AX210 since the built in card was bad. I didn't know one can trigger power save mode on the card. Will also investigate this.

@albsen albsen closed this as completed Mar 8, 2023
@johnfanv2
Copy link
Owner

Hmm. I am a bit surprised that it works.

Could you please make the following tests and report back:

  • Quick Test: Read Sensor Values from Hardware (for details see README): Are the RPM and temperature values plausible and increase/decrease?
  • Change the fancurve. Does the fans react according to the settings of the fan curve and attain approximately the set values.
  • Test according to "Change power mode from software" from README. Does powerprofilesctl list and powerprofilesctl set balanced and powerprofilesctl set performance work? Does the LED on the laptop change accordingly?
  • Does disabling mini fancurve works described in "Enable or disable the mini fan curve"
  • Does "Lock and Unlock the Fan Controller and Fan Speed" works?

@johnfanv2 johnfanv2 reopened this Mar 8, 2023
@albsen
Copy link
Author

albsen commented Apr 20, 2023

Hi @johnfanv2 apologies for the late reply. I been busy at work. Will do the above and report back in the next couple of days.

@johnfanv2
Copy link
Owner

johnfanv2 commented Apr 21, 2023

@albsen Greats thanks a lot!

@albsen
Copy link
Author

albsen commented Apr 23, 2023

@johnfanv2 Here are the results you asked for, please let me know if there is something else I can do to help.

sudo dmidecode -t system

sudo dmidecode -t system
# dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 3.3.0 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: LENOVO
        Product Name: 82UH
        Version: Legion 7 16ARHA7
        Serial Number: PF3WZ411
        UUID: 0cc4b303-da6c-11ec-80f2-6c2408849b2e
        Wake-up Type: Power Switch
        SKU Number: LENOVO_MT_82UH_BU_idea_FM_Legion 7 16ARHA7
        Family: Legion 7 16ARHA7

Handle 0x001B, DMI type 12, 5 bytes
System Configuration Options
        Option 1: String1 for Type12 Equipment Manufacturer
        Option 2: String2 for Type12 Equipment Manufacturer
        Option 3: String3 for Type12 Equipment Manufacturer
        Option 4: String4 for Type12 Equipment Manufacturer

Handle 0x0029, DMI type 32, 20 bytes
System Boot Information
        Status: No errors detected

sudo dmidecode -t bios

sudo dmidecode -t bios

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

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
        Vendor: LENOVO
        Version: K9CN41WW
        Release Date: 02/16/2023
        Address: 0xE0000
        Runtime Size: 128 kB
        ROM Size: 32 MB
        Characteristics:
                PCI is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
                Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
                5.25"/360 kB floppy services are supported (int 13h)
                5.25"/1.2 MB floppy services are supported (int 13h)
                3.5"/720 kB floppy services are supported (int 13h)
                3.5"/2.88 MB floppy services are supported (int 13h)
                8042 keyboard services are supported (int 9h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                BIOS boot specification is supported
                Targeted content distribution is supported
                UEFI is supported
        BIOS Revision: 1.41
        Firmware Revision: 1.41

Handle 0x001C, DMI type 13, 22 bytes
BIOS Language Information
        Language Description Format: Long
        Installable Languages: 4
                en|US|iso8859-1
                fr|FR|iso8859-1
                ja|JP|unicode
                zh|TW|unicode
        Currently Installed Language: en|US|iso8859-1

sudo cat /sys/kernel/debug/legion/fancurve

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: 2081289482
temperature access method: 1
CPU temperature error: 0
CPU temperature: 43
CPU temperature EC error: 0
CPU temperature EC: 43
CPU temperature ACPI error: 0
CPU temperature ACPI: 43
CPU temperature WMI error: 0
CPU temperature WMI: 0
CPU temperature WMI2 error: 0
CPU temperature WMI2: 43
GPU temperature error: 0
GPU temperature: 0
GPU temperature EC error: 0
GPU temperature EC: 0
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
fan speed access method: 1
1 fanspeed error: 0
1 fanspeed: 1767
1 fanspeed EC error: 0
1 fanspeed EC: 1767
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: 1700
2 fanspeed error: 0
2 fanspeed: 1663
2 fanspeed EC error: 0
2 fanspeed EC: 1663
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 1600
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 1600
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
EC minifancurve feature enabled: 1
EC minifancurve on cool: true
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 2
EC fan curve points size: 4
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
0        0       2       2       0       127     0       127     0       37
1600     1600    2       2       127     127     127     127     33      41
1700     1600    2       2       127     127     127     127     38      46
1900     1800    2       2       127     127     127     127     41      127
=====================

quicktest read sensors

quicktest read sensors

> $ sensors                                                                                                                                      ∞  [±main ✓]
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +37.0°C

amdgpu-pci-3700
Adapter: PCI adapter
vddgfx:        1.45 V
vddnb:         1.04 V
edge:         +40.0°C
PPT:          34.23 W

legion_hwmon-isa-0000
Adapter: ISA adapter
Fan 1:           1761 RPM
Fan 2:           1658 RPM
CPU Temperature:  +54.0°C
GPU Temperature:  +43.0°C
IC Temperature:   +39.0°C

nvme-pci-0700
Adapter: PCI adapter
Composite:    +38.9°C  (low  = -273.1°C, high = +75.8°C)
                       (crit = +86.8°C)
Sensor 1:     +38.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +33.9°C  (low  = -273.1°C, high = +65261.8°C)

BAT0-acpi-0
Adapter: ACPI interface
in0:          17.34 V

hidpp_battery_0-hid-3-8
Adapter: HID adapter
in0:           3.92 V

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +52.5°C

amdgpu-pci-0300
Adapter: PCI adapter
vddgfx:        6.00 mV
fan1:           0 RPM  (min =    0 RPM, max = 3800 RPM)
edge:         +42.0°C  (crit = +100.0°C, hyst = -273.1°C)
                       (emerg = +105.0°C)
junction:     +42.0°C  (crit = +100.0°C, hyst = -273.1°C)
                       (emerg = +105.0°C)
mem:          +40.0°C  (crit = +105.0°C, hyst = -273.1°C)
                       (emerg = +110.0°C)
PPT:           6.00 W  (cap = 135.00 W)

nvme-pci-0400
Adapter: PCI adapter
Composite:    +26.9°C  (low  = -20.1°C, high = +74.8°C)
                       (crit = +79.8°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +54.0°C  (crit = +110.0°C)

quick test 2 - change fan curve

quick test 2 - change fan curve

[root@enceladus ~]# cat /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon*/pwm1_auto_point2_pwm
1600
[root@enceladus ~]# cat /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon*/pwm2_auto_point2_pwm
1600
[root@enceladus ~]# cat /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon*/pwm1_auto_point3_pwm
1700
[root@enceladus ~]# cat /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon*/pwm2_auto_point3_pwm
1600

[root@enceladus ~]# 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: 2081289482
temperature access method: 1
CPU temperature error: 0
CPU temperature: 44
CPU temperature EC error: 0
CPU temperature EC: 44
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: 44
GPU temperature error: 0
GPU temperature: 43
GPU temperature EC error: 0
GPU temperature EC: 43
GPU temperature ACPI error: 0
GPU temperature ACPI: 42
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: 0
GPU temperature WMI2: 42
fan speed access method: 1
1 fanspeed error: 0
1 fanspeed: 1761
1 fanspeed EC error: 0
1 fanspeed EC: 1761
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: 1700
2 fanspeed error: 0
2 fanspeed: 1658
2 fanspeed EC error: 0
2 fanspeed EC: 1658
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 1600
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 1600
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
EC minifancurve feature enabled: 1
EC minifancurve on cool: true
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 2
EC fan curve points size: 4
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
0        0       2       2       0       127     0       127     0       37
1600     1600    2       2       127     127     127     127     33      41
1700     1600    2       2       127     127     127     127     38      46
1900     1800    2       2       127     127     127     127     41      127



############### test

[root@enceladus ~]# echo 1500 > /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon*/pwm1_auto_point2_pwm
[root@enceladus ~]# echo 1600 > /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon*/pwm2_auto_point2_pwm
[root@enceladus ~]# echo 1700 > /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon*/pwm1_auto_point3_pwm
[root@enceladus ~]# echo 1800 > /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon*/pwm2_auto_point3_pwm
[root@enceladus ~]# 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: 2081289482
temperature access method: 1
CPU temperature error: 0
CPU temperature: 44
CPU temperature EC error: 0
CPU temperature EC: 44
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: 44
GPU temperature error: 0
GPU temperature: 42
GPU temperature EC error: 0
GPU temperature EC: 42
GPU temperature ACPI error: 0
GPU temperature ACPI: 42
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: 0
GPU temperature WMI2: 42
fan speed access method: 1
1 fanspeed error: 0
1 fanspeed: 1571
1 fanspeed EC error: 0
1 fanspeed EC: 1571
1 fanspeed ACPI error: 0
1 fanspeed ACPI: 1500
1 fanspeed WMI error: 0
1 fanspeed WMI: 0
1 fanspeed WMI2 error: 0
1 fanspeed WMI2: 1500
2 fanspeed error: 0
2 fanspeed: 1663
2 fanspeed EC error: 0
2 fanspeed EC: 1663
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 1600
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 1600
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
EC minifancurve feature enabled: 1
EC minifancurve on cool: true
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 1
EC fan curve points size: 4
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
0        0       2       2       0       127     0       127     0       37
1500     1600    2       2       127     127     127     127     33      41
1700     1800    2       2       127     127     127     127     38      46
1900     1800    2       2       127     127     127     127     41      127

powerprofilesctl

powerprofilesctl

> $ powerprofilesctl list                                                                                                                        ∞  [±main ✓]
  performance:
    Driver:     platform_profile
    Degraded:   no

* balanced:
    Driver:     platform_profile

  power-saver:
    Driver:     platform_profile
 
> $ powerprofilesctl set performance
> $ powerprofilesctl list                                                                                                                        ∞  [±main ✓]
* performance:
    Driver:     platform_profile
    Degraded:   no

  balanced:
    Driver:     platform_profile

  power-saver:
    Driver:     platform_profile

Enable or disable the mini fan curve

Enable or disable the mini fan curve

> $ sudo python/legion_linux/legion_cli.py minifancurve-status                                                                                   ∞  [±main ✓]
True

> $ sudo python/legion_linux/legion_cli.py minifancurve-enable                                                                                   ∞  [±main ✓]

> $ sudo cat /sys/kernel/debug/legion/fancurve                                                                                                   ∞  [±main ✓]
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: 2081289482
temperature access method: 1
CPU temperature error: 0
CPU temperature: 44
CPU temperature EC error: 0
CPU temperature EC: 44
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: 44
GPU temperature error: 0
GPU temperature: 44
GPU temperature EC error: 0
GPU temperature EC: 44
GPU temperature ACPI error: 0
GPU temperature ACPI: 43
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: 0
GPU temperature WMI2: 43
fan speed access method: 1
1 fanspeed error: 0
1 fanspeed: 1779
1 fanspeed EC error: 0
1 fanspeed EC: 1779
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: 1700
2 fanspeed error: 0
2 fanspeed: 1727
2 fanspeed EC error: 0
2 fanspeed EC: 1727
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: 1700
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
EC minifancurve feature enabled: 1
EC minifancurve on cool: true
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 2
EC fan curve points size: 4
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
0        0       2       2       0       127     0       127     0       37
1600     1600    2       2       127     127     127     127     33      41
1700     1700    2       2       127     127     127     127     38      46
1900     1900    2       2       127     127     127     127     41      127
=====================

lock / unlock fan controller

lock / unlock fan controller

> $ sudo python/legion_linux/legion_cli.py lockfancontroller-status                                                                              ∞  [±main ✓]
False
> $ sudo python/legion_linux/legion_cli.py lockfancontroller-enable                                                                              ∞  [±main ✓]
> $ sudo python/legion_linux/legion_cli.py lockfancontroller-status                                                                              ∞  [±main ✓]
True

> $ sudo cat /sys/kernel/debug/legion/fancurve                                                                                                   ∞  [±main ✓]
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: 2081289482
temperature access method: 1
CPU temperature error: 0
CPU temperature: 45
CPU temperature EC error: 0
CPU temperature EC: 45
CPU temperature ACPI error: 0
CPU temperature ACPI: 46
CPU temperature WMI error: 0
CPU temperature WMI: 0
CPU temperature WMI2 error: 0
CPU temperature WMI2: 46
GPU temperature error: 0
GPU temperature: 44
GPU temperature EC error: 0
GPU temperature EC: 44
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
fan speed access method: 1
1 fanspeed error: 0
1 fanspeed: 1779
1 fanspeed EC error: 0
1 fanspeed EC: 1779
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: 1700
2 fanspeed error: 0
2 fanspeed: 1727
2 fanspeed EC error: 0
2 fanspeed EC: 1727
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: 1700
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
EC minifancurve feature enabled: 1
EC minifancurve on cool: false
EC lockfancontroller error: 0
EC lockfancontroller: true
EC fanfullspeed error: error
EC fanfullspeed status: -1
EC fan curve current point id: 2
EC fan curve points size: 10
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
0        0       5       5       0       41      0       65      0       37
1700     1700    5       5       35      45      60      65      33      41
1900     1900    5       5       42      49      60      65      38      46
2100     2000    5       5       46      54      60      65      41      127
2300     2300    2       2       52      64      60      65      127     127
2600     2500    2       2       62      68      60      65      127     127
2900     2800    2       2       65      72      60      65      127     127
3100     3000    2       2       69      76      60      75      127     127
3400     3400    2       2       73      80      72      88      127     127
3600     3600    2       2       77      127     85      127     127     127
=====================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants