Bug 2365909 - hardware capability for charge threshold is unsupported in the Linux kernel
Summary: hardware capability for charge threshold is unsupported in the Linux kernel
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 42
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-05-13 12:35 UTC by bnx4cw8b1
Modified: 2025-07-01 08:56 UTC (History)
13 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-07-01 08:56:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description bnx4cw8b1 2025-05-13 12:35:35 UTC
I have a Lenovo Yoga 7 ARP8, my hw can support the charge limit, i already checked it on kde plasma and windows, in gnome 48 this feature didn't show up so i checked with this command: "upower --dump" and i saw that there isn't any line about "charge-threshold-supported:    yes or no " so a Gnome Dev suggested to me to open a bug in this thread.

Reproducible: Always

Comment 1 bnx4cw8b1 2025-05-23 12:32:59 UTC
here's my upower -dump:

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               SMP
  model:                L22M4PA1
  serial:               5089
  power supply:         yes
  updated:              ven 23 mag 2025, 14:32:16 (13 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              50,8 Wh
    energy-empty:        0 Wh
    energy-full:         64,63 Wh
    energy-full-design:  71 Wh
    energy-rate:         3,889 W
    voltage:             16,141 V
    charge-cycles:       143
    time to empty:       13,1 hours
    percentage:          78%
    capacity:            91,0282%
    technology:          lithium-polymer
    icon-name:          'battery-full-symbolic'
  History (rate):
    1748003536	3,889	discharging
    1748003506	6,180	discharging
    1748003476	4,541	discharging
    1748003446	6,469	discharging

Device: /org/freedesktop/UPower/devices/line_power_ACAD
  native-path:          ACAD
  power supply:         yes
  updated:              ven 23 mag 2025, 14:22:59 (570 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              ven 23 mag 2025, 14:32:16 (13 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              50,8 Wh
    energy-full:         64,63 Wh
    energy-rate:         3,889 W
    charge-cycles:       N/A
    time to empty:       13,1 hours
    percentage:          78%
    icon-name:          'battery-full-symbolic'

Daemon:
  daemon-version:  1.90.9
  on-battery:      yes
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: PowerOff

Comment 2 bnx4cw8b1 2025-06-19 18:58:35 UTC
(In reply to vmjizkya4 from comment #1)
> here's my upower -dump:
> 
> Device: /org/freedesktop/UPower/devices/battery_BAT0
>   native-path:          BAT0
>   power supply:         yes
>   updated:              ven 23 mag 2025, 14:32:16 (13 seconds ago)
>   has history:          yes
>   has statistics:       yes
>   battery
>     present:             yes
>     rechargeable:        yes
>     state:               discharging
>     warning-level:       none
>     energy:              50,8 Wh
>     energy-empty:        0 Wh
>     energy-full:         64,63 Wh
>     energy-full-design:  71 Wh
>     energy-rate:         3,889 W
>     voltage:             16,141 V
>     charge-cycles:       143
>     time to empty:       13,1 hours
>     percentage:          78%
>     capacity:            91,0282%
>     technology:          lithium-polymer
>     icon-name:          'battery-full-symbolic'
>   History (rate):
>     1748003536	3,889	discharging
>     1748003506	6,180	discharging
>     1748003476	4,541	discharging
>     1748003446	6,469	discharging
> 
> Device: /org/freedesktop/UPower/devices/line_power_ACAD
>   native-path:          ACAD
>   power supply:         yes
>   updated:              ven 23 mag 2025, 14:22:59 (570 seconds ago)
>   has history:          no
>   has statistics:       no
>   line-power
>     warning-level:       none
>     online:              no
>     icon-name:          'ac-adapter-symbolic'
> 
> Device: /org/freedesktop/UPower/devices/DisplayDevice
>   power supply:         yes
>   updated:              ven 23 mag 2025, 14:32:16 (13 seconds ago)
>   has history:          no
>   has statistics:       no
>   battery
>     present:             yes
>     state:               discharging
>     warning-level:       none
>     energy:              50,8 Wh
>     energy-full:         64,63 Wh
>     energy-rate:         3,889 W
>     charge-cycles:       N/A
>     time to empty:       13,1 hours
>     percentage:          78%
>     icon-name:          'battery-full-symbolic'
> 
> Daemon:
>   daemon-version:  1.90.9
>   on-battery:      yes
>   lid-is-closed:   no
>   lid-is-present:  yes
>   critical-action: PowerOff

Comment 3 Hans de Goede 2025-07-01 08:30:01 UTC
(In reply to vmjizkya4 from comment #0)
> I have a Lenovo Yoga 7 ARP8, my hw can support the charge limit, i already
> checked it on kde plasma and windows, in gnome 48 this feature didn't show
> up so i checked with this command: "upower --dump" and i saw that there
> isn't any line about "charge-threshold-supported:    yes or no " so a Gnome
> Dev suggested to me to open a bug in this thread.

Your laptop likely uses a ideapad custom kernel interface, specifically it likely has the following file:

ls /sys/bus/platform/devices/VPC2004:*/conservation_mode

KDE has chosen to add support for this laptop specific API to KDE.

For GNOME we really want a standardized kernel API for other similar laptops which do not have start / stop thresholds in % but instead have a single toggle.

The new charge_types API for this has been merged in the kernel recently:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/power/supply/power_supply_sysfs.c?id=d24bf99214b199c25f9c2cb04b3a4993d1c7ab60

And a patch is pending upstream (will be in kernel 6.17) to add support for this to the ideapad driver:

https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?id=da8f2708f9b69707f4efeb432a18395e46b4666f

The last bit necessary is adding support to upower for this, this will be exposed to GNOME through the existing upower dbusAPI for this, so no GNOME changes will be necessary. The upower code is currently being worked on by my colleague Kate Hsuan.

TL;DR: support for this is coming, but it will still be a while before it lands.

Note in the mean time if you prefer using GNOME, you can enable the conservation_mode by doing:

echo 1 > /sys/bus/platform/devices/VPC2004:*/conservation_mode

as root (after a sudo su -).

Comment 4 bnx4cw8b1 2025-07-01 08:55:25 UTC
Hi Hans,
thank you so much for your exaustive response, im glad to know that support is coming.
Thanks for your work!


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