Bugzilla – Bug 1216806
[aarch64][LenovoX13s] [power supply] Battery percentage is always 0%
Last modified: 2023-12-06 08:02:38 UTC
Created attachment 870581 [details] battery_fail.png Tested ISO: openSUSE-Tumbleweed-DVD-aarch64-Snapshot20231029-Media.iso Link: https://download.opensuse.org/ports/aarch64/tumbleweed/iso/openSUSE-Tumbleweed-DVD-aarch64-Current.iso Install steps: https://en.opensuse.org/HCL:ThinkpadX13s#ISO_Installation Symptom: When booting to the installed tumbleweed, the battery percentage is not able to be measured so it always shows 0% (See attached screenshot). In the meanwhile, the readings dumped by the 'upower' command are all zero.
Created attachment 870584 [details] batt_ok.png By tracing the QCOM battery driver [qcom_battmgr.c], I realized that the qcom_battmgr driver needs a notification from the pdr_interface in order to activate the battery measurement, which should be the way originated from the Android systems running on Qualcomm's mobile application processors. To solve this issue, we will need a net/qrtr[1] lib and a pd-mapper[2][3] program running in userspace in order to trigger the event required by the battery sensor (via QRTR/remoteproc) and its associated battery driver. I have temporarily packaged these two in my OBS home subject[4], and the result shows that the battery percentage can be fixed after running the pd-mapper. I will submit these two packages to the openSUSE network project. [1] https://github.com/andersson/qrtr [2] https://github.com/andersson/pd-mapper [3] https://groups.google.com/g/linux.debian.devel/c/gZWi4_ca9yw [4] https://build.opensuse.org/project/show/home:clin:branches:devel:ARM:qcom-qrtr
(In reply to Chester Lin from comment #1) > Created attachment 870584 [details] > batt_ok.png > > By tracing the QCOM battery driver [qcom_battmgr.c], I realized that the > qcom_battmgr driver needs a notification from the pdr_interface in order to > activate the battery measurement, which should be the way originated from > the Android systems running on Qualcomm's mobile application processors. > > To solve this issue, we will need a net/qrtr[1] lib and a pd-mapper[2][3] > program running in userspace in order to trigger the event required by the > battery sensor (via QRTR/remoteproc) and its associated battery driver. > > I have temporarily packaged these two in my OBS home subject[4], and the > result shows that the battery percentage can be fixed after running the > pd-mapper. I will submit these two packages to the openSUSE network project. > > [1] https://github.com/andersson/qrtr > [2] https://github.com/andersson/pd-mapper > [3] https://groups.google.com/g/linux.debian.devel/c/gZWi4_ca9yw > [4] > https://build.opensuse.org/project/show/home:clin:branches:devel:ARM:qcom- > qrtr The same approach can also be seen in other distros, such as Debian and Fedora.
Thanks, it looks reasonable to me. You can add a proper "Supplements" tag to the package, so that it can be automatically installed for the target hardware.
(In reply to Takashi Iwai from comment #3) > Thanks, it looks reasonable to me. > > You can add a proper "Supplements" tag to the package, so that it can be > automatically installed for the target hardware. Thanks for the suggestion. I have submitted packages with a "Supplements" tag in the "pd-mapper.spec". Here are PRs: libqrtr1: https://build.opensuse.org/request/show/1123703 pd-mapper: https://build.opensuse.org/request/show/1123705
(In reply to Chester Lin from comment #4) > (In reply to Takashi Iwai from comment #3) > > Thanks, it looks reasonable to me. > > > > You can add a proper "Supplements" tag to the package, so that it can be > > automatically installed for the target hardware. > > Thanks for the suggestion. I have submitted packages with a "Supplements" > tag in the "pd-mapper.spec". Here are PRs: > > libqrtr1: https://build.opensuse.org/request/show/1123703 > pd-mapper: https://build.opensuse.org/request/show/1123705 Accepted by network and now I have submitted to openSUSE:Factory: libqrtr1: https://build.opensuse.org/request/show/1124452 pd-mapper: https://build.opensuse.org/request/show/1124453
This is an autogenerated message for OBS integration: This bug (1216806) was mentioned in https://build.opensuse.org/request/show/1125577 Factory / qrtr https://build.opensuse.org/request/show/1125579 Factory / pd-mapper
(In reply to OBSbugzilla Bot from comment #6) > This is an autogenerated message for OBS integration: > This bug (1216806) was mentioned in > https://build.opensuse.org/request/show/1125577 Factory / qrtr > https://build.opensuse.org/request/show/1125579 Factory / pd-mapper I have refreshed the SRs but the qrtr package still needs some improvements based on the reviewer's comment: qrtr: https://build.opensuse.org/request/show/1125577?notification_id=44316417 pd-mapper: https://build.opensuse.org/request/show/1124453?notification_id=44135231
This is an autogenerated message for OBS integration: This bug (1216806) was mentioned in https://build.opensuse.org/request/show/1127853 Factory / qrtr
This is an autogenerated message for OBS integration: This bug (1216806) was mentioned in https://build.opensuse.org/request/show/1127861 Factory / qrtr
Current pd-mapper and qrtr-ns do not work. qrtr-ns service reports: ERROR: qrtr-ns: nameserver already runnin, going dormant: Address already in use and was started by qrtr-ns.service with: /usr/sbin/qrtr-ns -f 1