All of lore.kernel.org
 help / color / mirror / Atom feed
* Power supply detection issue caused by ucsi_psy?
@ 2020-11-09 10:48 Vladimir Yerilov
  2020-11-09 11:20 ` Heikki Krogerus
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Yerilov @ 2020-11-09 10:48 UTC (permalink / raw)
  To: linux-usb, Heikki Krogerus, Greg KH

[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]

Good day everyone,

Since linux 5.8 I'm experiencing a problem related to power source
detection on my laptop. My machine is equipped with 2 typec ports, one
of them has power delivery and is used for charging, another one has
only data transfer capability. The issue is, when I unplug the power
cable, the OS is reporting something like "Battery at 100%, plugged in
but still discharging" (KDE Plasma notification) - whether another
port is used or not. I checked with upower, you can see the output for
kernel 5.4 and 5.10 attached. In brief, on 5.8 onwards I have some
"line_power_ucsi_source_psy_USBC000o001" device which is considered a
power supply and that prevents OS to switch to "battery mode" when
unplugging the cable, instead it thinks there's a power source but not
powerful enough to charge the battery, upower says this: "on-battery:
    no", but actually no ac power source is connected.
I did some research with git bisect up to the merge commit
`e611c0fe318c6d6827ee2bba660fbc23cf73f7dc` ("Merge tag 'usb-5.8-rc1'
of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb"), and
looked through its content. My wild guess based on upower output is
that a new driver introduced there, /drivers/usb/typec/ucsi/psy.c, is
responsible for this wrong behavior.

Could you please look into that based on info I'm providing?
Thank you!

-- 
----
Best regards,
Vladimir Yerilov

[-- Attachment #2: upower_5.10.txt --]
[-- Type: text/plain, Size: 2381 bytes --]

Device: /org/freedesktop/UPower/devices/line_power_ADP0
  native-path:          ADP0
  power supply:         yes
  updated:              Sun 08 Nov 2020 15:27:39 +10 (97 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/battery_BAT0
  native-path:          BAT0
  vendor:               SUNWODA
  model:                R15B01W
  serial:               ACFA
  power supply:         yes
  updated:              Sun 08 Nov 2020 15:27:39 +10 (97 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              46.198 Wh
    energy-empty:        0 Wh
    energy-full:         46.664 Wh
    energy-full-design:  60.04 Wh
    energy-rate:         2.059 W
    voltage:             8.672 V
    time to full:        13.6 minutes
    percentage:          99%
    capacity:            77.7215%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'
  History (charge):
    1604813259	0.000	unknown
  History (rate):
    1604813259	0.000	unknown

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
  native-path:          ucsi-source-psy-USBC000:001
  power supply:         yes
  updated:              Sun 08 Nov 2020 15:27:39 +10 (97 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/DisplayDevice
  power supply:         yes
  updated:              Sun 08 Nov 2020 15:27:39 +10 (97 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               charging
    warning-level:       none
    energy:              46.198 Wh
    energy-full:         46.664 Wh
    energy-rate:         2.059 W
    time to full:        13.6 minutes
    percentage:          99%
    icon-name:          'battery-full-charging-symbolic'

Daemon:
  daemon-version:  0.99.11
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep

[-- Attachment #3: upower_5.10_bat.txt --]
[-- Type: text/plain, Size: 2368 bytes --]

Device: /org/freedesktop/UPower/devices/line_power_ADP0
  native-path:          ADP0
  power supply:         yes
  updated:              Sun 08 Nov 2020 15:29:25 +10 (18 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/battery_BAT0
  native-path:          BAT0
  vendor:               SUNWODA
  model:                R15B01W
  serial:               ACFA
  power supply:         yes
  updated:              Sun 08 Nov 2020 15:29:25 +10 (18 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              46.198 Wh
    energy-empty:        0 Wh
    energy-full:         46.664 Wh
    energy-full-design:  60.04 Wh
    energy-rate:         1.998 W
    voltage:             8.44 V
    time to empty:       23.1 hours
    percentage:          99%
    capacity:            77.7215%
    technology:          lithium-ion
    icon-name:          'battery-full-symbolic'
  History (charge):
    1604813365	99.000	charging
  History (rate):
    1604813365	1.998	charging

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
  native-path:          ucsi-source-psy-USBC000:001
  power supply:         yes
  updated:              Sun 08 Nov 2020 15:27:39 +10 (124 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/DisplayDevice
  power supply:         yes
  updated:              Sun 08 Nov 2020 15:29:25 +10 (18 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              46.198 Wh
    energy-full:         46.664 Wh
    energy-rate:         1.998 W
    time to empty:       23.1 hours
    percentage:          99%
    icon-name:          'battery-full-symbolic'

Daemon:
  daemon-version:  0.99.11
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-11-10 10:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 10:48 Power supply detection issue caused by ucsi_psy? Vladimir Yerilov
2020-11-09 11:20 ` Heikki Krogerus
2020-11-09 11:36   ` Benjamin Berg
2020-11-09 12:55     ` Vladimir Yerilov
     [not found]     ` <CAB31r6XWQqM-kLYm4vb8H=45grhuwsHDYT94y5QJZVtP8w_sXg@mail.gmail.com>
2020-11-09 17:02       ` Fwd: " Vladimir Yerilov
2020-11-10  8:31         ` Heikki Krogerus
2020-11-10 10:15           ` Heikki Krogerus
     [not found]           ` <CAB31r6Wq5c7n=Ywdq1KAgRZFemH6Wx2b-9tq46k=ipZrqarmdA@mail.gmail.com>
2020-11-10 10:30             ` Heikki Krogerus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.