Bug 459081 - Charge Limit section disappears upon changing the settings
Summary: Charge Limit section disappears upon changing the settings
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_powerdevil (show other bugs)
Version: 5.24.6
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-14 02:28 UTC by basm
Modified: 2023-12-21 02:13 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description basm 2022-09-14 02:28:54 UTC
The last time i saw the Charge Limit section was when i changed the settings to stop charging at 60% and start at 40%. Since then, when it has power, the battery is obligingly staying between 40% and 60%. However now when i bring up the "Advanced Power Settings" screen, the "Charge Limit" section shows for maybe a quarter of a second, then quickly disappears.

i first reported this on ubuntu focal: http://bugs.launchpad.net/ubuntu/+source/systemsettings/+bug/1951661

The symptoms are the same on Manjaro:
About this System: http://imgur.com/a/5JkksDx

This report is mostly written about my Thinkpad e540, tho just now i got an Elitebook 840 g2 with ubuntu oem preinstalled.  i installed manjaro kde minimal edition, and on this one i've not really seen the "Charge Limit" section, tho i do see the flash of it as it shows for maybe a quarter of a second, then quickly disappears, just like on the Thinkpad e540.

STEPS TO REPRODUCE
1. changed the settings to stop charging at 60% and start at 40%
2. reboot
3. return to the "Advanced Power Settings" screen

OBSERVED RESULT
when it has power, the battery is obligingly staying between 40% and 60%. However now when i bring up the "Advanced Power Settings" screen, the "Charge Limit" section shows for maybe a quarter of a second, then quickly disappears.

EXPECTED RESULT
Show the charge limit section.

SOFTWARE/OS VERSIONS
About this System at first encounter on manjaro: http://imgur.com/a/5JkksDx
Symptoms the same after full manjaro update:
[2022-09-04T22:01:39-0500] [ALPM] upgraded systemsettings (5.24.4-1 -> 5.24.6-3)

ADDITIONAL INFORMATION
 # inxi --admin --verbosity=7 --filter --width
System:
  Kernel: 5.16.0-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.16-x86_64
    root=UUID=b2d9c25b-03ab-4676-ae6e-cc4dce724d09 rw panic=30
    udev.log_priority=3
  Desktop: N/A wm: kwin_x11 vt: 1 dm: startx Distro: Manjaro Linux
    base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 20C6008SUS v: ThinkPad Edge E540
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: LENOVO model: 20C6008SUS v: 0B98401 WIN serial: <superuser required>
    UEFI: LENOVO v: J9ETA2WW (2.28 ) date: 06/20/2018
Battery:
  ID-1: BAT0 charge: 17.6 Wh (51.6%) condition: 34.1/52.8 Wh (64.5%)
    volts: 11.3 min: 11.1 model: LGC LNV-45N1 type: Li-ion serial: <filter>
    status: Not charging
Memory:
  RAM: total: 7.65 GiB used: 3.13 GiB (40.9%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i5-4200M bits: 64 type: MT MCP arch: Haswell
    family: 6 model-id: 0x3C (60) stepping: 3 microcode: 0x28
  Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache:
    L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB
    L3: 3 MiB desc: 1x3 MiB
  Speed (MHz): avg: 2494 high: 2495 min/max: 800/3100 scaling:
    driver: intel_cpufreq governor: schedutil cores: 1: 2494 2: 2495 3: 2494
    4: 2495 bogomips: 19961
  Flags: abm acpi aes aperfmperf apic arat arch_perfmon avx avx2 bmi1 bmi2
    bts clflush cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64
    dtherm dts epb erms est f16c flush_l1d fma fpu fsgsbase fxsr ht ibpb ibrs
    ida invpcid invpcid_single lahf_lm lm mca mce md_clear mmx monitor movbe
    msr mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs
    pge pln pni popcnt pse pse36 pti pts rdrand rdtscp rep_good sdbg sep smep
    ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tsc tsc_adjust
    tsc_deadline_timer vme xsave xsaveopt xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX unsupported
  Type: l1tf mitigation: PTE Inversion
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional,
    IBRS_FW, STIBP: conditional, RSB filling
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Lenovo
    driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:0416 class-ID: 0300
  Device-2: Realtek Integrated Camera type: USB driver: uvcvideo
    bus-ID: 3-12:7 chip-ID: 0bda:5719 class-ID: 0e02 serial: <filter>
  Display: server: X.Org 1.21.1.2 compositor: kwin_x11 driver:
    loaded: modesetting alternate: fbdev,vesa display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x2616 s-dpi: 96 s-size: 507x691mm (20.0x27.2")
    s-diag: 857mm (33.7")
  Message: Unable to show advanced data. Required tool glxinfo missing.
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio
    vendor: Lenovo driver: snd_hda_intel v: kernel bus-ID: 00:03.0
    chip-ID: 8086:0c0c class-ID: 0403
  Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Lenovo
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20
    class-ID: 0403
  Device-3: SteelSeries ApS SteelSeries Arctis 7 type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 3-1:2 chip-ID: 1038:12ad
    class-ID: 0300
  Sound Server-1: ALSA v: k5.16.0-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.19 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.40 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel port: 3000 bus-ID: 03:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Intel Wireless 7260 driver: iwlwifi v: kernel bus-ID: 04:00.0
    chip-ID: 8086:08b2 class-ID: 0280
  IF: wlp4s0 state: down mac: <filter>
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8
    bus-ID: 3-7:5 chip-ID: 8087:07dc class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 2 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 465.76 GiB used: 147.97 GiB (31.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: HGST (Hitachi) model: HTS725050A7E635
    size: 465.76 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: HDD rpm: 7200 serial: <filter> rev: A8Z0 scheme: GPT
  Optical-1: /dev/sr0 vendor: MATSHITA model: DVD-RAM UJ8E2 rev: 1.00
    dev-links: cdrom
  Features: speed: 24 multisession: yes audio: yes dvd: yes
    rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition:
  ID-1: / raw-size: 415.84 GiB size: 408.31 GiB (98.19%)
    used: 147.93 GiB (36.2%) fs: ext4 dev: /dev/sda2 maj-min: 8:2 label: N/A
    uuid: b2d9c25b-03ab-4676-ae6e-cc4dce724d09
  ID-2: /boot/efi raw-size: 476 MiB size: 475.1 MiB (99.80%)
    used: 38.7 MiB (8.1%) fs: vfat dev: /dev/sda1 maj-min: 8:1 label: N/A
    uuid: 1FEA-1CC9
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 16 GiB used: 0 KiB (0.0%) priority: -2
    file: /f/swapfile
Unmounted:
  ID-1: /dev/sda3 maj-min: 8:3 size: 16.76 GiB fs: ntfs label: N/A
    uuid: 03FDF2F31548EC3F
USB:
  Hub-1: 1-0:1 info: Full speed or root hub ports: 3 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Hub-2: 1-1:2 info: Intel Integrated Rate Matching Hub ports: 6 rev: 2.0
    speed: 480 Mb/s chip-ID: 8087:8008 class-ID: 0900
  Hub-3: 2-0:1 info: Full speed or root hub ports: 3 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-4: 2-1:2 info: Intel Integrated Rate Matching Hub ports: 8 rev: 2.0
    speed: 480 Mb/s chip-ID: 8087:8000 class-ID: 0900
  Hub-5: 3-0:1 info: Hi-speed hub with single TT ports: 14 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 3-1:2 info: SteelSeries ApS SteelSeries Arctis 7 type: Audio,HID
    driver: hid-generic,snd-usb-audio,usbhid interfaces: 6 rev: 1.1
    speed: 12 Mb/s power: 100mA chip-ID: 1038:12ad class-ID: 0300
  Device-2: 3-2:3 info: Dell KB216 Wired Keyboard type: Keyboard,HID
    driver: hid-generic,usbhid interfaces: 2 rev: 1.1 speed: 1.5 Mb/s
    power: 100mA chip-ID: 413c:2113 class-ID: 0300
  Device-3: 3-6:4 info: Dell Optical Wheel Mouse type: Mouse
    driver: hid-generic,usbhid interfaces: 1 rev: 2.0 speed: 1.5 Mb/s
    power: 100mA chip-ID: 413c:3012 class-ID: 0301
  Device-4: 3-7:5 info: Intel Bluetooth wireless interface type: Bluetooth
    driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA
    chip-ID: 8087:07dc class-ID: e001
  Device-5: 3-11:6 info: Validity Sensors VFS5011 Fingerprint Reader
    type: <vendor specific> driver: N/A interfaces: 1 rev: 1.1 speed: 12 Mb/s
    power: 100mA chip-ID: 138a:0011 class-ID: ff00 serial: <filter>
  Device-6: 3-12:7 info: Realtek Integrated Camera type: Video
    driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA
    chip-ID: 0bda:5719 class-ID: 0e02 serial: <filter>
  Hub-6: 4-0:1 info: Super-speed hub ports: 6 rev: 3.0 speed: 5 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 55.0 C mobo: N/A
  Fan Speeds (RPM): cpu: 0
Info:
  Processes: 213 Uptime: 1h 9m wakeups: 1 Init: systemd v: 249 tool: systemctl
  Compilers: gcc: N/A Packages: pacman: 1142 lib: 312 Shell: Bash v: 5.1.12
  running-in: tmux-master2021 inxi: 3.3.11
Comment 1 Nate Graham 2022-09-14 17:22:38 UTC
Strange. Cannot reproduce with my Lenovo ThinkPax X1 Yoga.
Comment 2 basm 2022-12-23 00:02:37 UTC
The symptoms are also the same on Tumbleweed.

With Tumbleweed on an HP Elitebook 840 G3 the Charge Limit subsection quickly disappears the very first time viewing the Advanced Power Settings section.  Could well be intentional as i remember reading somewhere that  so far Thinkpads are the only laptops that have software configurable charge limit settings.

And i just reinstalled my Thinkpad with Tumbleweed("About this System":https://imgur.com/a/V0Abtvd).  And just like with ubuntu, The first time i viewed the Advanced Power Settings, the Charge Limit subsection displayed and remained displayed, i chose an intentionally narrow charge range of 45-55%, applied the settings, and there ever after when i view the Advanced Power Settings section, the Charge Limit subsection displays for a couple hundred milliseconds and quickly disappears.
Comment 3 basm 2023-03-31 18:51:40 UTC
Ran tumbleweed updates on my thinkpad 2023-03-22, systemsettings5 updated to 5.27.3-1.2.  Happened to look at the Advanced Power Settings yesterday, the Charge Limit section stayed displayed!  And my battery was all charged up to 100%, so apparently at some point since my last comment above, it started behaving like i'd never changed the settings.  So i re-entered similar settings, this time stop charging at 67% and start at 33%.  And now as usual again, when i revisit Advanced Power Settings, the Charge Limit section disappears in a flash.  Today the battery's charge has sagged down to 96% so i expect like before my Charge Limit settings will be honored even tho not displayed.  No idea why they'd gotten forgotten in the meantime tho, perhaps something to do with package updates.
Comment 4 Jakob Petsovits 2023-12-15 06:28:47 UTC
Git commit 127f6aef4ec9626e95c200d5600655bc781b45d6 by Jakob Petsovits.
Committed on 15/12/2023 at 07:21.
Pushed by jpetso into branch 'master'.

Drop "Advanced Power Settings" KCM in favor of a new QML page

This commit removes the QWidgets-based KCM in kcmodule/global,
and instead adds a new QML page accessible via header action
in the existing "Energy Saving" (QML) KCM a.k.a. profiles config.
Renaming folder and class names of the profiles KCM to reflect
its combined scope is left for a later commit.

I modified the "Energy Saving" KCM's JSON file to declare it
on the top level of System Settings, and merged extra keywords
from the now deleted kcm_powerdevilglobalconfig.json.
We'll have to remove the "power-management" category from
System Settings after this, as only a single KCM is left.

New C++ KCM backend code is mostly moved from GeneralPage.{h,cpp}:

* PowerDevil::GlobalSettings provides kcm.settings.global for QML.
* KAuth-powered ChargeThresholdHelper settings are accessible via
  kcm.externalServiceSettings & left out of non-default highlighting.
* "Supports $X" properties are added to the KCM class directly.

All in all, it's a fairly straight port that doesn't change the
underlying data representation apart from the obvious C++/QML split.
Only the magic value -1 gets replaced by a constant named
ChargeThresholdUnsupported, plus functions for checking support.

The UI is also roughly the same. That said, there are some differences:

* I replaced the "Configure Notifications" button with a column of
  two ToolButtons in the style of Quick Settings' "Most used pages".

* The start-charging threshold, i.e. the lower bound, previously
  had a weirdly long spinbox field because it needed to fit the
  "special value" text "Always charge when plugged in".
  This looks awkward and is not easily discoverable. Furthermore,
  QQC2.SpinBox doesn't have a concept of a "special value" and
  doesn't pre-allocate item width for any given space. I decided to
  represent this state with numeric percentages only.
    * "Special value" means display text for the minimum value
      ("from") of a QSpinBox. The start-charging threshold QSpinBox
      had no minimum set in generalPage.ui, so its "special value"
      would have been 0. This makes little sense, "Always charge"
      for the start threshold is conceptually more similar to
      "start threshold equals stop threshold".
    * Hence, the start threshold SpinBox now starts at 1, not 0,
      and the maximum allowed value is that of the stop threshold
      from the other field above. If the maximum value is selected,
      we write the "special value" 0 to the backend. If the backend
      value changes to 0, we set the UI to the stop threshold value.
Related: bug 449254, bug 450276, bug 467797

M  +0    -2    kcmodule/CMakeLists.txt
M  +0    -1    kcmodule/common/CMakeLists.txt
D  +0    -90   kcmodule/common/ErrorOverlay.cpp
D  +0    -28   kcmodule/common/ErrorOverlay.h
D  +0    -19   kcmodule/global/CMakeLists.txt
D  +0    -266  kcmodule/global/GeneralPage.cpp
D  +0    -47   kcmodule/global/GeneralPage.h
D  +0    -4    kcmodule/global/Messages.sh
D  +0    -277  kcmodule/global/generalPage.ui
D  +0    -126  kcmodule/global/kcm_powerdevilglobalconfig.json
M  +3    -1    kcmodule/profiles/CMakeLists.txt
A  +190  -0    kcmodule/profiles/ExternalServiceSettings.cpp     [License: GPL(v2.0+)]
A  +66   -0    kcmodule/profiles/ExternalServiceSettings.h     [License: GPL(v2.0+)]
M  +0    -2    kcmodule/profiles/Messages.sh
M  +107  -5    kcmodule/profiles/ProfilesConfigKCM.cpp
M  +41   -2    kcmodule/profiles/ProfilesConfigKCM.h
M  +32   -31   kcmodule/profiles/kcm_powerdevilprofilesconfig.json
A  +364  -0    kcmodule/profiles/ui/GlobalConfig.qml     [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)]
A  +53   -0    kcmodule/profiles/ui/MostUsedItem.qml     [License: LGPL(v2.0)]
M  +8    -1    kcmodule/profiles/ui/main.qml

https://invent.kde.org/plasma/powerdevil/-/commit/127f6aef4ec9626e95c200d5600655bc781b45d6
Comment 5 Jakob Petsovits 2023-12-21 02:13:12 UTC
Plasma 6 Beta 2 has new UI code, though similar code as before in order to access the underlying system values for charge limits. Please retest once you have access to Beta 2 or newer. I don't think it should be possible for the new UI to just flicker in and out, because the query code is only run once at module load time. But if it still happens, feel free to reopen.