Summary: | Lenovo T470s fails to detect on-battery | ||
---|---|---|---|
Product: | upower | Reporter: | Julien Goodwin <jgoodwin> |
Component: | general | Assignee: | Richard Hughes <richard> |
Status: | RESOLVED NOTOURBUG | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Julien Goodwin
2017-04-01 07:54:59 UTC
Running Debian testing, upower package is version 0.99.4-4+b1. From the Debian bug report (which I now can't find, despite submitting it) -- System Information: Debian Release: 9.0 APT prefers testing APT policy: (500, 'testing'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores) Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: systemd (via /run/systemd/system) Versions of packages upower depends on: ii dbus 1.10.16-1 ii libc6 2.24-9 ii libglib2.0-0 2.50.3-1 ii libgudev-1.0-0 230-3 ii libimobiledevice6 1.2.0+dfsg-3.1 ii libplist3 1.12+git+1+e37ca00-0.1 ii libupower-glib3 0.99.4-4+b1 ii libusb-1.0-0 2:1.0.21-1 ii udev 232-19 Versions of packages upower recommends: ii policykit-1 0.105-17 upower suggests no packages. -- no debconf information Reading the source and looking at what I get from upower -d I think in ./src/up-daemon.c, up_daemon_get_on_battery_local would return true, but up_daemon_get_on_ac_local would *also* return true, which is enough to never set the exported on-battery to true. Debian bug is: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859105 This seems to be never refreshing the AC supply status. Battery status seems to update fairly frequently, but AC does not. (All while on battery) $ upower -d Device: /org/freedesktop/UPower/devices/line_power_AC native-path: AC power supply: yes updated: Mon 03 Apr 2017 14:34:59 AEST (179920 seconds ago) has history: no has statistics: no line-power warning-level: none online: yes icon-name: 'ac-adapter-symbolic' ... Daemon: daemon-version: 0.99.4 on-battery: no lid-is-closed: no lid-is-present: yes critical-action: PowerOff $ sudo systemctl restart upower $ upower -d Device: /org/freedesktop/UPower/devices/line_power_AC native-path: AC power supply: yes updated: Wed 05 Apr 2017 16:37:48 AEST (3 seconds ago) has history: no has statistics: no line-power warning-level: none online: no icon-name: 'ac-adapter-symbolic' ... Daemon: daemon-version: 0.99.4 on-battery: yes lid-is-closed: no lid-is-present: yes critical-action: PowerOff Can confirm on a T470s (tested with fedora 25, kernel 4.8.6-300.fc25.x86_64). It seems the root cause is that we don't get any udev events for the AC adapter. The following log is me unplugging and re-plugging the adapter (NB no events for AC): # udevadm monitor monitor will print the received events for: UDEV - the event which udev sends out after rule processing KERNEL - the kernel uevent KERNEL[611.708340] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) UDEV [611.711087] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) KERNEL[611.785185] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) UDEV [611.786809] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) KERNEL[617.946159] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) UDEV [617.948944] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) KERNEL[617.983067] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) UDEV [617.984088] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) After updating the firmware of the T470s to the version 1.10 this problem is gone and I am getting the proper udev events (NB the AC lines): KERNEL[419.475855] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) UDEV [419.481963] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) KERNEL[419.508922] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) UDEV [419.511957] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:01/power_supply/BAT1 (power_supply) KERNEL[419.981587] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply) UDEV [419.985512] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply) KERNEL[420.009402] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply) UDEV [420.015641] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply) These are properly picked up by UPower. Confirm that an update to 1.10 worked on my T470s as well. Thanks. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.