Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

69 views
Skip to first unread message

James Valleroy

unread,
Apr 10, 2022, 7:50:03 AM4/10/22
to
Package: src:linux
Version: 5.16.12-1~bpo11+1
Severity: normal
X-Debbugs-Cc: jval...@mailbox.org

Dear Maintainer,

* What led up to the situation?

I'm using a ROCKPro64 with SPI firmware flashed to v2021.04 [1]. I
flashed Bullseye arm64 image (FreedomBox) to eMMC. The system is
running on wall power adapter and does not have a battery.

I noticed that unattended-upgrades was not doing upgrades. 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.

[1] https://github.com/sigmaris/u-boot/releases/tag/v2021.04-rockpro64-ci


* What exactly did you do (or not do) that was effective (or
ineffective)?

$ cat /sys/class/power_supply/tcpm-source-psy-4-0022/online


* What was the outcome of this action?

0 (the power supply is reported as offline)


* What outcome did you expect instead?

1 (the power supply should be reported as online)


-- Package-specific info:
** Version:
Linux version 5.16.0-0.bpo.4-arm64 (debian...@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.16.12-1~bpo11+1 (2022-03-08)

** Command line:
BOOT_IMAGE=/boot/vmlinuz-5.16.0-0.bpo.4-arm64 root=UUID=c7839694-fec7-461d-9c76-6fd693221829 ro quiet

** Tainted: C (1024)
* staging driver was loaded

** Kernel log:
[ 8.321008] systemd[1]: Mounted POSIX Message Queue File System.
[ 8.321670] systemd[1]: Mounted Kernel Debug File System.
[ 8.322625] systemd[1]: Mounted Kernel Trace File System.
[ 8.324663] systemd[1]: Finished Create list of static device nodes for the current kernel.
[ 8.326740] systemd[1]: modp...@configfs.service: Succeeded.
[ 8.328353] systemd[1]: Finished Load Kernel Module configfs.
[ 8.330248] systemd[1]: modp...@drm.service: Succeeded.
[ 8.331742] systemd[1]: Finished Load Kernel Module drm.
[ 8.333593] systemd[1]: modp...@fuse.service: Succeeded.
[ 8.334964] systemd[1]: Finished Load Kernel Module fuse.
[ 8.342414] systemd[1]: Mounting FUSE Control File System...
[ 8.347738] systemd[1]: Mounting Kernel Configuration File System...
[ 8.352665] systemd[1]: Finished Load Kernel Modules.
[ 8.359031] systemd[1]: Starting Apply Kernel Variables...
[ 8.365190] BTRFS info (device mmcblk2p2): disk space caching is enabled
[ 8.369324] systemd[1]: Mounted FUSE Control File System.
[ 8.374797] systemd[1]: Finished Remount Root and Kernel File Systems.
[ 8.377878] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
[ 8.378381] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped.
[ 8.385892] systemd[1]: Starting Load/Save Random Seed...
[ 8.392969] systemd[1]: Starting Create System Users...
[ 8.401177] systemd[1]: Mounted Kernel Configuration File System.
[ 8.416925] systemd[1]: Finished Apply Kernel Variables.
[ 8.656409] systemd[1]: Finished Create System Users.
[ 8.662105] systemd[1]: Starting Create Static Device Nodes in /dev...
[ 8.737900] systemd[1]: Finished Create Static Device Nodes in /dev.
[ 8.738774] systemd[1]: Reached target Local File Systems (Pre).
[ 8.748796] systemd[1]: Starting Rule-based Manager for Device Events and Files...
[ 8.871407] systemd[1]: Started Journal Service.
[ 8.916766] systemd-journald[296]: Received client request to flush runtime journal.
[ 9.495003] cpu cpu0: EM: created perf domain
[ 9.509606] cpu cpu4: EM: OPP:600000 is inefficient
[ 9.509630] cpu cpu4: EM: OPP:408000 is inefficient
[ 9.509908] cpu cpu4: EM: created perf domain
[ 9.605679] mc: Linux media interface: v0.10
[ 9.633782] videodev: Linux video capture interface: v2.00
[ 9.634669] dw_wdt ff848000.watchdog: No valid TOPs array specified
[ 9.701545] spi-nor spi0.0: gd25q128 (16384 Kbytes)
[ 9.730480] 4 fixed-partitions partitions found on MTD device spi0.0
[ 9.730510] Creating 4 MTD partitions on "spi0.0":
[ 9.730517] 0x000000000000-0x000000060000 : "u-boot-spl"
[ 9.750084] OF: graph: no port node found in /i2c@ff3d0000/typec-portc@22
[ 9.751358] 0x000000060000-0x0000003f8000 : "u-boot"
[ 9.751670] 0x0000003f8000-0x000000400000 : "u-boot-env"
[ 9.751982] 0x000000400000-0x000001000000 : "user"
[ 9.764323] es8316 1-0011: Failed to get IRQ 0: -22
[ 9.771072] rockchip_vdec: module is from the staging directory, the quality is unknown, you have been warned.
[ 9.778045] hantro_vpu: module is from the staging directory, the quality is unknown, you have been warned.
[ 9.780814] rkvdec ff660000.video-codec: Adding to iommu group 1
[ 9.796216] hantro-vpu ff650000.video-codec: Adding to iommu group 0
[ 9.803329] hantro-vpu ff650000.video-codec: registered rockchip,rk3399-vpu-enc as /dev/video1
[ 9.803449] hantro-vpu ff650000.video-codec: registered rockchip,rk3399-vpu-dec as /dev/video2
[ 9.873329] Registered IR keymap rc-cec
[ 9.877152] alg: No test for fips(ansi_cprng) (fips_ansi_cprng)
[ 9.877329] rc rc0: dw_hdmi as /devices/platform/ff940000.hdmi/rc/rc0
[ 9.877455] input: dw_hdmi as /devices/platform/ff940000.hdmi/rc/rc0/input1
[ 9.964501] panfrost ff9a0000.gpu: clock rate = 500000000
[ 10.070061] panfrost ff9a0000.gpu: mali-t860 id 0x860 major 0x2 minor 0x0 status 0x0
[ 10.070075] panfrost ff9a0000.gpu: features: 00000000,100e77bf, issues: 00000000,24040400
[ 10.070080] panfrost ff9a0000.gpu: Features: L2:0x07120206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xff JS:0x7
[ 10.070086] panfrost ff9a0000.gpu: shader_present=0xf l2_present=0x1
[ 10.081375] [drm] Initialized panfrost 1.2.0 20180908 for ff9a0000.gpu on minor 1
[ 10.453680] Bluetooth: Core ver 2.22
[ 10.453853] NET: Registered PF_BLUETOOTH protocol family
[ 10.453864] Bluetooth: HCI device and connection manager initialized
[ 10.453887] Bluetooth: HCI socket layer initialized
[ 10.453896] Bluetooth: L2CAP socket layer initialized
[ 10.453919] Bluetooth: SCO socket layer initialized
[ 10.499785] Bluetooth: HCI UART driver ver 2.3
[ 10.499801] Bluetooth: HCI UART protocol H4 registered
[ 10.499875] Bluetooth: HCI UART protocol LL registered
[ 10.499878] Bluetooth: HCI UART protocol ATH3K registered
[ 10.500079] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 10.500410] Bluetooth: HCI UART protocol Intel registered
[ 10.503817] Bluetooth: HCI UART protocol Broadcom registered
[ 10.505028] Bluetooth: HCI UART protocol QCA registered
[ 10.505038] Bluetooth: HCI UART protocol AG6XX registered
[ 10.506116] Bluetooth: HCI UART protocol Marvell registered
[ 10.528012] audit: type=1400 audit(1649415542.256:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/haveged" pid=475 comm="apparmor_parser"
[ 10.599690] audit: type=1400 audit(1649415542.328:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=479 comm="apparmor_parser"
[ 10.601688] audit: type=1400 audit(1649415542.328:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=479 comm="apparmor_parser"
[ 10.623524] dw-apb-uart ff180000.serial: failed to request DMA
[ 10.631719] audit: type=1400 audit(1649415542.360:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lsb_release" pid=478 comm="apparmor_parser"
[ 10.788473] audit: type=1400 audit(1649415542.516:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="tcpdump" pid=476 comm="apparmor_parser"
[ 11.121618] zram: Added device: zram0
[ 11.156544] zram0: detected capacity change from 0 to 3958712
[ 11.301969] random: crng init done
[ 11.301980] random: 7 urandom warning(s) missed due to ratelimiting
[ 11.444437] Adding 1979352k swap on /dev/zram0. Priority:100 extents:1 across:1979352k SSFS
[ 12.767315] Bluetooth: hci0: command 0x0c03 tx timeout
[ 13.147470] rk_gmac-dwmac fe300000.ethernet eth0: PHY [stmmac-0:00] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
[ 13.148323] rk_gmac-dwmac fe300000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 13.159275] rk_gmac-dwmac fe300000.ethernet eth0: No Safety Features support found
[ 13.159320] rk_gmac-dwmac fe300000.ethernet eth0: PTP not supported by HW
[ 13.160076] rk_gmac-dwmac fe300000.ethernet eth0: configuring for phy/rgmii link mode
[ 17.280877] rk_gmac-dwmac fe300000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 17.280967] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 20.959286] Bluetooth: hci0: BCM: Reset failed (-110)
[ 1121.006407] BTRFS warning (device mmcblk2p2): qgroup rescan init failed, qgroup is not enabled
[ 2608.692702] nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based firewall rule not found. Use the iptables CT target to attach helpers instead.

** Model information
Device Tree model: Pine64 RockPro64 v2.1

** Loaded modules:
nft_objref
nf_conntrack_netbios_ns
nf_conntrack_broadcast
nft_masq
nft_fib_inet
nft_fib_ipv4
nft_fib_ipv6
nft_fib
nft_reject_inet
nf_reject_ipv4
nf_reject_ipv6
nft_reject
nft_ct
nft_chain_nat
nf_nat
nf_conntrack
nf_defrag_ipv6
nf_defrag_ipv4
ip_set
nf_tables
nfnetlink
lz4
lz4_compress
zram
zsmalloc
hci_uart
btqca
btrtl
btbcm
btintel
bluetooth
nls_ascii
nls_cp437
vfat
fat
snd_soc_hdmi_codec
jitterentropy_rng
sha512_generic
ghash_ce
gf128mul
sha2_ce
sha512_arm64
sha256_arm64
evdev
governor_simpleondemand
sha1_ce
snd_soc_audio_graph_card
aes_neon_bs
snd_soc_spdif_tx
aes_neon_blk
panfrost
pwm_fan
aes_ce_blk
leds_gpio
snd_soc_simple_card
snd_soc_simple_card_utils
aes_ce_cipher
drbg
dw_hdmi_i2s_audio
dw_hdmi_cec
gpu_sched
ansi_cprng
hantro_vpu(C)
rockchip_vdec(C)
snd_soc_rockchip_i2s
ecdh_generic
snd_soc_es8316
v4l2_h264
rfkill
snd_soc_core
v4l2_mem2mem
ofpart
videobuf2_vmalloc
videobuf2_dma_contig
fusb302
videobuf2_memops
tcpm
snd_pcm_dmaengine
ecc
spi_nor
videobuf2_v4l2
snd_pcm
mtd
crc16
videobuf2_common
typec
dw_wdt
snd_timer
videodev
snd
io_domain
rockchip_saradc
soundcore
nvmem_rockchip_efuse
industrialio_triggered_buffer
kfifo_buf
mc
industrialio
rockchip_thermal
pwm_rockchip
efi_pstore
cpufreq_dt
fuse
configfs
efivarfs
ip_tables
x_tables
autofs4
btrfs
blake2b_generic
zstd_compress
raid10
raid456
async_raid6_recov
async_memcpy
async_pq
async_xor
async_tx
xor
xor_neon
realtek
xhci_plat_hcd
xhci_hcd
rk808_regulator
raid6_pq
libcrc32c
crc32c_generic
raid1
raid0
multipath
linear
md_mod
dwc3
udc_core
roles
ulpi
fan53555
rockchipdrm
dw_hdmi
dwmac_rk
cec
rc_core
stmmac_platform
crct10dif_ce
crct10dif_common
dw_mipi_dsi
stmmac
pwm_regulator
analogix_dp
dwc3_of_simple
fixed
drm_kms_helper
pcs_xpcs
phylink
gpio_keys
of_mdio
fixed_phy
ohci_platform
fwnode_mdio
ohci_hcd
ehci_platform
libphy
ehci_hcd
sdhci_of_arasan
usbcore
sdhci_pltfm
phy_rockchip_inno_usb2
ptp
dw_mmc_rockchip
cqhci
dw_mmc_pltfm
phy_rockchip_pcie
phy_rockchip_typec
phy_rockchip_emmc
pl330
drm
spi_rockchip
pps_core
i2c_rk3x
usb_common
sdhci
dw_mmc

** Network interface configuration:
*** /etc/network/interfaces:
source /etc/network/interfaces.d/*

** Network status:
*** IP interfaces and addresses:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether a6:3b:fb:b2:8e:34 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.196/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0
valid_lft 28567sec preferred_lft 28567sec
inet6 2601:40a:8200:c50a::23f/128 scope global dynamic noprefixroute
valid_lft 271294sec preferred_lft 271294sec
inet6 fd57:15e3:6862::23f/128 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fd57:15e3:6862:0:6a4a:d14f:d9d:3892/64 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 2601:40a:8200:c50a:e2c9:ca2a:976f:f47e/64 scope global dynamic noprefixroute
valid_lft 271295sec preferred_lft 271295sec
inet6 fe80::40af:9209:268c:3e3f/64 scope link noprefixroute
valid_lft forever preferred_lft forever

*** Device statistics:
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 117565121 412245 0 0 0 0 0 0 117565121 412245 0 0 0 0 0 0
eth0: 4082762827 2856191 0 23 0 0 0 0 75017887 327118 0 0 0 0 0 0


** PCI devices:

** USB devices:
not available


-- System Information:
Debian Release: 11.3
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: arm64 (aarch64)

Kernel: Linux 5.16.0-0.bpo.4-arm64 (SMP w/6 CPU threads)
Kernel taint flags: TAINT_CRAP
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages linux-image-5.16.0-0.bpo.4-arm64 depends on:
ii initramfs-tools [linux-initramfs-tool] 0.140
ii kmod 28-1
ii linux-base 4.6

Versions of packages linux-image-5.16.0-0.bpo.4-arm64 recommends:
ii apparmor 2.13.6-10
ii firmware-linux-free 20200122-1

Versions of packages linux-image-5.16.0-0.bpo.4-arm64 suggests:
pn debian-kernel-handbook <none>
pn linux-doc-5.16 <none>

Versions of packages linux-image-5.16.0-0.bpo.4-arm64 is related to:
pn firmware-amd-graphics <none>
pn firmware-atheros <none>
pn firmware-bnx2 <none>
pn firmware-bnx2x <none>
pn firmware-brcm80211 <none>
pn firmware-cavium <none>
pn firmware-intel-sound <none>
pn firmware-intelwimax <none>
pn firmware-ipw2x00 <none>
pn firmware-ivtv <none>
pn firmware-iwlwifi <none>
pn firmware-libertas <none>
pn firmware-linux-nonfree <none>
pn firmware-misc-nonfree <none>
pn firmware-myricom <none>
pn firmware-netxen <none>
pn firmware-qlogic <none>
pn firmware-realtek <none>
pn firmware-samsung <none>
pn firmware-siano <none>
pn firmware-ti-connectivity <none>
pn xen-hypervisor <none>

-- no debconf information

Diederik de Haas

unread,
Apr 11, 2022, 12:20:03 PM4/11/22
to
On 10 Apr 2022 07:39:54 -0400 James Valleroy <jval...@mailbox.org> 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

Diederik de Haas

unread,
Apr 18, 2022, 7:40:03 PM4/18/22
to
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)

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

Diederik de Haas

unread,
Apr 19, 2022, 12:10:03 PM4/19/22
to
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
signature.asc
0 new messages