https://bugs.kde.org/show_bug.cgi?id=472657

--- Comment #9 from Oded Arbel <o...@geek.co.il> ---
This is still an issue I'm having with current Neon testing, Plasma 6.0 RC1,
with Kernel 6.5.0-14-generic #14~22.04.1-Ubuntu.

I've noticed a weird thing in `upower -d` output: my laptop does not have a
dedicated AC-powered charger (calling it "AC line power" is silly because it's
a DC power connection), instead this laptop has 3 USB-C ports (and an SC slot,
but that' it). Upower seem to list all USB-C port as possible power connectors,
though I normally only connect USB-C 1 (the farthest port from me on the left
side) and sometimes USB-C 2 (if I miss the first, it is the other one on the
left side).

So here's `upower -d` output when the laptop is *connected* to a USB-C dock
(not thunderbolt), trimmed to only show `line_power_AC` and `line_power_usci`:

---8<---
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Fri 19 Jan 2024 14:51:34 (429 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
  native-path:          ucsi-source-psy-USBC000:001
  power supply:         yes
  updated:              Fri 19 Jan 2024 14:51:34 (429 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o002
  native-path:          ucsi-source-psy-USBC000:002
  power supply:         yes
  updated:              Fri 19 Jan 2024 14:51:34 (429 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/line_power_ucsi_source_psy_USBC000o003
  native-path:          ucsi-source-psy-USBC000:003
  power supply:         yes
  updated:              Fri 19 Jan 2024 14:51:34 (429 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'
---8<---

As far as I understand, "/org/freedesktop/UPower/devices/line_power_AC" is "any
connection provides line power" while the separate
"org/freedesktop/UPower/devices/line_power_ucsi_source_psy*" devices are "this
is the physical connection that can take line power". We can clearly see that
AC line power is provided and the first of the 3 USBC devices is "online" -
which I think describes my setup correctly.

And here is the relevant output of `upower -d` when the laptop is *not
connected*:

---8<---
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Fri 19 Jan 2024 15:00:13 (11 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/line_power_ucsi_source_psy_USBC000o001
  native-path:          ucsi-source-psy-USBC000:001
  power supply:         yes
  updated:              Fri 19 Jan 2024 14:51:34 (530 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes
    icon-name:          'ac-adapter-symbolic'
---8<---

As you can see, the "line_power_AC" device is no longer online, though the 1st
USBC PSY still reports that it is online!

This reports tracks with the content of the files
`/sys/class/power_supply/AC/online` and
`/sys/class/power_supply/ucsi-source-psy-USBC000:00*/online`. I've tested
several different chargers and docks on different USB-C ports, and while always
correctly represents the powered state of the laptop, the USBC PSY "online"
files always say 1=1, 2=0, 3=0.

I've found this LKML discussion from 2020:
https://lore.kernel.org/all/20201110101519.gc1224...@kuha.fi.intel.com/T/ which
seems to describe my situation well, though the kernel I'm using (6.5.0) is
supposed to have the patch that is discussed in that thread, and that appeared
to resolve the complaint.

It seems to me that Plasma checks if *any* UPower device is "online" to trigger
the "on battery" behavior, though it should only take into consideration the
overall system state as reported by the "line_power_AC" device.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to