Battery indicator not reporting correct power status until delay on Lenovo laptop

I am using a Lenovo Yoga C940 15" laptop with Fedora 34 and the battery indicator is giving false information for when the laptop is charging and not charging for some obscure reason. That is, when removed from power, the battery indicator still shows it is charging even when it is on battery. And when plugged in, it will still show that it is on battery. This corrects itself, but It takes about three minutes for it to ‘correct’ and show the accurate status of plugged in or on battery. This behavior is odd, and I don’t see anything suspicious in the system logs related to this, so I don’t know what is going on. Has anyone experienced this odd delay in the battery status indicator reporting the correct power status? I can’t seem to figure this out. The battery also sometimes doesn’t charge to 100%, instead stopping with “fully charged” status at 95% to 99%. I find this behavior very strange and can’t seem to figure it out.

1 Like

Interestingly, restarting the upower service using sudo service upower restart or issuing a refresh command to upower via busctl like so: busctl call --system org.freedesktop.UPower /org/freedesktop/UPower/devices/battery_BAT0 org.freedesktop.UPower.Device Refresh instantly resolves this issue. It appears that the upower service is not updating frequently enough. I have filed a bug here: https://bugzilla.redhat.com/show_bug.cgi?id=1960997 to address this issue with the upower service. In the meantime, using the script from here seems to work: https://askubuntu.com/questions/878556/get-battery-status-to-update-more-often-or-on-ac-power-wake/878579#878579

1 Like

Hey and welcome @nstommel

Do you have installed tlp and tlp-rdw? I use these two ones and it works for me.

Check out the link for more info:

https://linrunner.de/tlp/installation/fedora.html

Cheers

Andi

Your Yoga C940 is a standard Intel x86 laptop, so it is using the ACPI battery driver to provide this information. Normally the firmware will send an ACPI notify to the kernel’s battery driver on unplug/replug of the charger and this gets forwarded to upower which then immediately updates.

It seems that for some reason on the C940 these ACPI notify calls are not happening and this is something which is outside of Linux’ control, so there really is not much what we can do here.

Increasing the default polling rate in Fedora is not a good idea because the polling itself uses battery so we don’t want to do it too often; and normally we get the notifications on unplug/replug so the polling is only necessary to keep an eye on the battery percentage.

As for using TLP I personally advice against using that, since this Fedora change:
https://fedoraproject.org/wiki/Changes/ImprovedLaptopBatteryLife

Fedora has pretty good settings by default and TLP regularly causes various problems for people.