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

2022-04-19 Thread Diederik de Haas
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

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


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

2022-04-18 Thread Diederik de Haas
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)

2) ACPI (through /proc/acpi/ac_adapter)
ls: cannot access '/proc/acpi': No such file or directory

3) PMU (through /proc/pmu/info)
ls: cannot access '/proc/pmu/info': No such file or directory

4) APM (through /proc/apm)
ls: cannot access '/proc/apm': No such file or directory

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

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


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

2022-04-11 Thread Diederik de Haas
On 10 Apr 2022 07:39:54 -0400 James Valleroy  wrote:
> Package: src:linux
> Version: 5.16.12-1~bpo11+1
> 
> I'm using a ROCKPro64 ... The system is
> running on wall power adapter and does not have a battery.
> 
> In the log it showed "WARNING System is on battery power, stopping". 
> It uses the on_ac_power command from powermgmt-base package.
> 
> Initially, I was using the kernel package from Bullseye when I noticed
> this issue. I upgraded to bullseye-backports kernel, and saw that the
> issue remained.

When switching to the 5.16 bpo kernel, did you also update the dtb to that 
version?

I asked on IRC (Pine64:#rock64) and got the following responses:
- it seems like the Type-C port is misreported as a power input, which it 
can't be in case of the RP64
- When asked for the DT used, I said Debian uses upstream dtbs
- there's no Type-C for the RP64 in the upstream DT, so perhaps Debian did 
something wrong in the patches that added Type-C to the RP64 DT they're using

@Vagrant: I checked the kernel patches dir and I didn't see one which would've 
changed the dtb for the RockPro64, but you likely know better then I do.
Does Debian use the exact same DT/dtb as upstream on the RockPro64?

Cheers,
  Diederik

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