Path: csiph.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!bofh.it!news.nic.it!robomod From: Diederik de Haas Newsgroups: linux.debian.bugs.dist,linux.debian.kernel Subject: Bug#1009262: linux-image-5.16.0-0.bpo.4-arm64: power supply incorrectly reported as offline Date: Tue, 19 Apr 2022 18:10:01 +0200 Message-ID: References: X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Tue Apr 19 16:09:08 2022 Old-Return-Path: X-Spam-Flag: NO X-Spam-Score: -3.962 Reply-To: Diederik de Haas , 1009262@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: Debian Kernel Team X-Debian-Pr-Message: followup 1009262 X-Debian-Pr-Package: src:linux X-Debian-Pr-Source: linux Organization: Connecting Knowledge MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8098596.T7Z3S40VBb"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-Greylist: delayed 59775 seconds by postgrey-1.36 at buxtehude; Tue, 19 Apr 2022 16:05:37 UTC X-Debian-Message: from BTS X-Mailing-List: archive/latest/1714142 List-ID: List-URL: Approved: robomod@news.nic.it Lines: 65 Sender: robomod@news.nic.it X-Original-Date: Tue, 19 Apr 2022 18:05:11 +0200 X-Original-Message-ID: <3215665.44csPzL39Z@prancing-pony> X-Original-References: <164959079465.54401.13504889710316080606.reportbug@freedombox.jvalleroy.me> <3351355.QJadu78ljV@bagend> <164959079465.54401.13504889710316080606.reportbug@freedombox.jvalleroy.me> <3351355.QJadu78ljV@bagend> Xref: csiph.com linux.debian.bugs.dist:1100718 linux.debian.kernel:75088 --nextPart8098596.T7Z3S40VBb Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Diederik de Haas To: 1009262@bugs.debian.org Date: Tue, 19 Apr 2022 18:05:11 +0200 Message-ID: <3215665.44csPzL39Z@prancing-pony> Organization: Connecting Knowledge In-Reply-To: <3351355.QJadu78ljV@bagend> 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 ` 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 --nextPart8098596.T7Z3S40VBb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQT1sUPBYsyGmi4usy/XblvOeH7bbgUCYl7dtwAKCRDXblvOeH7b bn67AP9jknYEhB8cUsxdmQkfLP6FBOuKbLb3XiW4C+mmd3HZPQD/fp3vEQQlSMOk UWAUD1bFb9535uJCQhqgWobEqx9BzQI= =0Qgb -----END PGP SIGNATURE----- --nextPart8098596.T7Z3S40VBb--