FS#71772 - Battery charge limit broken in lg_laptop kernel module (kernel 5.13)

Attached to Project: Arch Linux
Opened by Mahesh Padmanabhan (sutram) - Sunday, 08 August 2021, 19:27 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 06 June 2023, 03:35 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The battery charging limit functionality of the lg_laptop module included with kernel 5.13.5 does not work with my LG gram (2021) laptop


Additional info:
* package version(s)

core/linux513 5.13.5-1 [installed]
The Linux513 kernel and modules

--- TLP 1.3.1 --------------------------------------------

+++ System Info
System = LG Electronics 0.1 15Z95N-G.AAC6U1
BIOS = T1ZF0220 X64
Release = "Manjaro Linux"
Kernel = 5.13.5-1-MANJARO #1 SMP PREEMPT Mon Jul 26 07:43:29 UTC 2021 x86_64
/proc/cmdline = BOOT_IMAGE=/@/boot/vmlinuz-5.13-x86_64 root=UUID=bc38ca56-b94f-4ffd-a945-4774f83da22d rw rootflags=subvol=@ quiet splash apparmor=1 security=apparmor udev.log_priority=3
Init system = systemd
Boot mode = UEFI


+++ Battery Status: CMB0
/sys/class/power_supply/CMB0/manufacturer = LG
/sys/class/power_supply/CMB0/model_name = LGC-LGC
/sys/class/power_supply/CMB0/cycle_count = 1
/sys/class/power_supply/CMB0/energy_full_design = 80000 [mWh]
/sys/class/power_supply/CMB0/energy_full = 78240 [mWh]
/sys/class/power_supply/CMB0/energy_now = 54320 [mWh]
/sys/class/power_supply/CMB0/power_now = 5226 [mW]
/sys/class/power_supply/CMB0/status = Discharging

Charge = 69.4 [%]
Capacity = 97.8 [%]



* config and/or log files etc.

lsmod | grep lg_laptop  ✔
lg_laptop 20480 0
sparse_keymap 16384 1 lg_laptop
wmi 36864 2 lg_laptop,wmi_bmof


* link to upstream bug report, if any

Steps to reproduce:

Once the module is loaded, I was trying to set the charge limit to 80 (stands for 80%)

cat /sys/devices/platform/lg-laptop/battery_care_limit

0

echo 80 > /sys/devices/platform/lg-laptop/battery_care_limit

cat /sys/devices/platform/lg-laptop/battery_care_limit

0

All other functionality that I care about works with this module.

Thanks.
This task depends upon

Closed by  Toolybird (Toolybird)
Tuesday, 06 June 2023, 03:35 GMT
Reason for closing:  Fixed
Additional comments about closing:  See comments
Comment by Mahesh Padmanabhan (sutram) - Sunday, 08 August 2021, 19:29 GMT
I contacted the lg_laptop module developer directly at Matan Ziv-Av <matan@svgalib.org> but there has been no response from the developer for the past six days. Thanks.
Comment by Mahesh Padmanabhan (sutram) - Wednesday, 24 November 2021, 18:08 GMT
Hi,

With kernel 5.15.x, Matan created a new patch for lg_laptop.c that solves this issue but he thinks, it may not get included anytime soon in the 5.15.x kernel. It would be great to get this included as a patch to the Arch kernel instead

"https://lore.kernel.org/platform-driver-x86/c752b3b2-9718-bd9a-732d-e165aa8a1fca@svgalib.org/"

Please let me know how I can help get this included in the Arch kernel

Thank you,
Mahesh
Comment by Jan Alexander Steffens (heftig) - Thursday, 25 November 2021, 23:02 GMT
Should be fixed in linux 5.15.5.arch1-1
Comment by Mahesh Padmanabhan (sutram) - Friday, 26 November 2021, 00:09 GMT
Awesome! Thank you!

Loading...