[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1009262: linux-image-5.16.0-0.bpo.4-arm64: power supply incorrectly reported as offline



On dinsdag 19 april 2022 01:29:04 CEST Diederik de Haas wrote:
> On Sunday, 10 April 2022 13:39:54 CEST James Valleroy wrote:
> > In the log it showed "WARNING System is on battery power, stopping".
> > It uses the on_ac_power command from powermgmt-base package.
> 
> Pretty sure the problem is in the on_ac_power script from powermgmt-base.
> It appears to be a really simplistic script which searches through 4
> categories and I checked (with `ls -l <path>` what it would do on my Rock64:
> 
> 1) /sys/class/power_supply/
> total 0
> (iow: that directory does exist, but is empty)

It turns out that directory isn't empty on a RockPro64 and it returns '0' with
``cat /sys/class/power_supply/tcpm-source-psy-4-0022/online``
(the type property returns 'USB' fwiw)

Which in turn makes the script conclude it's offline/on battery power.
Someone running a manjaro kernel on a RockPro64 also got '0', which makes it 
unlikely to be a Debian kernel issue.

FTR: on my other Rock64's one running LibreELEC and the other armbian, they 
all have an empty power_supply directory.
It was also empty on a RPi 2B running an raspbian.org kernel and a RPi 3B 
running a Debian kernel

> My guess is that it's unaware of device-tree ... which is a problem (for ARM
> devices).

While I didn't see any reference to DT in the powermgmt-base source code, that 
may not be important.

What I don't know is whether the (upstream) kernel is reporting an incorrect 
value for the 'online' property or whether the script makes an incorrect 
assumption wrt what that property's return value represents.

This is as far as I can provide input on this issue. Now someone with 
knowledge about ``/sys/class/power_supply`` should take over.

HTH,
  Diederik

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: