#4631·noctalia

[BUG] Charge threshold toggle locks after switching off on MSI laptops (msi-ec reports 90/100)

Author: vivekiistCreated Sep 29, 2026Updated Sep 29, 2026

Submission checklist

  • I have searched existing issues and confirmed this is not a duplicate. (Related: #4144 / #4353, which fixed the same lock for Huawei's 95/100 only.)
  • I am using the latest available version of Noctalia. (5.1.0; the relevant check is unchanged in 5.2.0 — see below.)

Bug description

On MSI laptops using the msi-ec driver, the Power tab's "Use charge thresholds" toggle locks itself ("Set by another tool. Configure UPower to manage charge thresholds.") as soon as it is switched off, so the charge limit can't be turned back on from Noctalia.

msi-ec cannot store an independent start threshold: it always derives start = end - 10. When UPower disables the limit it writes end=100, so the kernel reports start=90, end=100. UPowerChargeLimitState::hasRestrictiveThreshold() treats any start in (0, 100) as a limit, classifies the state as ExternallyManaged, and greys out the toggle / refuses EnableChargeThreshold.

This is the same class of problem as #4144. #4353 fixed it by special-casing Huawei's 95/100 sentinel, so MSI's 90/100 (and presumably other EC drivers with a fixed start offset) still hits it.

Steps to reproduce

  1. MSI laptop with msi-ec loaded, UPower ≥ 1.90 with ChargeThresholdSupported=true (here via a local hwdb CHARGE_LIMIT=50,60).
  2. busctl call org.freedesktop.UPower /org/freedesktop/UPower/devices/battery_BAT1 org.freedesktop.UPower.Device EnableChargeThreshold b true → kernel reports 50/60, Power tab shows the toggle enabled and working.
  3. In the Power tab, switch "Use charge thresholds" off.
  4. Kernel now reports charge_control_start_threshold=90, charge_control_end_threshold=100; ChargeThresholdEnabled=false.
  5. Try to switch the toggle back on.

Expected behavior

Toggle stays usable and re-enables the configured limit (50/60), as it does after the busctl call.

Actual behavior

Toggle is greyed out with "Set by another tool". Clicking it does nothing (no charge threshold change failed in the log, no PropertiesChanged from UPower). Only the manual busctl … EnableChargeThreshold b true restores it.

Power tab while locked:

Starts below 90% · Stops at 100%
Configured: Starts below 50% · Stops at 60%
Use charge thresholds            [greyed out]
Set by another tool. Configure UPower to manage charge thresholds.

Suggested fix

Rather than adding another per-vendor sentinel next to Huawei's 95/100 (and Apple Silicon's 100/100 from #4261), treat any pair with end >= 100 as unrestricted: if the battery is allowed to charge to 100%, the start value can't limit the maximum charge, whatever the driver reports. Nearby restrictive pairs like 95/99 and 75/80 would stay ExternallyManaged, as in the #4353 tests.

Noctalia version

v5.1.0 (Fedora package noctalia-5.1.0-1.fc44). Checked the 5.2.0 source: hasRestrictiveThreshold() only special-cases 95/100.

Compositor

niri 26.04

Distribution

Fedora 44

Environment information

Installation method: Fedora updates repo (noctalia-5.1.0-1.fc44)
Laptop: MSI GF63 Thin 9SC (MS-16R3), EC firmware 16R3EMS1.102
Kernel: 7.2.7-200.fc44.x86_64
Driver: msi-ec 0.13 (DKMS)
UPower: 1.91.4 (ChargeThresholdSettingsSupported=3)
CPU: Intel i7-9750H, iGPU: Intel UHD 630