I’m on the 12th gen i5-1240P, running Arch Linux (kernel 6.5.6, older ones reproduce this issue too), and sometimes see the battery charge get misreported as 0%. This causes the system to immediately power down, which is extremely inconvenient. Has anyone seen similar behavior?
(the popup is lying, the battery is charging just fine)
dmesg output doesn’t show anything unusual, but a few instances of this EC error are present (I think those are normal though?):
[267610.915734] cros_ec_lpcs cros_ec_lpcs.0: packet too long (4 bytes, expected 0)
Based on the error itself, my first question is what power charger are you using and if it’s FW official, have you tried other outlets? If it’s not one of our chargers, what is the exact model and power provided?
Additionally, what is the output of:
cat /sys/class/power_supply/ACAD/online
(Should be 1)
and now let’s compare with, provide all output here as well:
I was seeing sort of similar behavior, also Arch 6.5.? x64 kernel Ave Plasma desktop, but on 11th Gen i5. Except my case it wouldn’t pop up 0%, it was a random number around 9%, so it didn’t force a shutdown. By the time I could try to troubleshoot, the battery reading was back to my charge target number. Haven’t seen it do it since my last kernel update a few days ago, but I’ll keep an eye out. I suspect a KDE/Plasma bug…
Using third party USB-PD 2.0 100W chargers and e-marked 5A cables, if it matters.
The error is wrong, the charger is working fine with the laptop. This has also happened to me before while on battery, around the time it discharged just below 70%, shutting down the machine. After turning it back on the battery charge was reported correctly again.
I will keep upower --monitor-detail running in the background in case it happens again. I hope that at least lets me find out what’s shutting down the machine when the battery reports 0% and how to stop it from doing that (KDE is configured to ignore low battery levels, so it must be something else doing it).
I’m not familiar with how exactly battery state is reported to the system, does it go through the EC? If so, could interference by the BIOS cause this, similar to how it causes the Fn key to stop working occasionally?
I’ve disabled and masked upower.service, which apparently is incapable of not shutting down the system when the battery reports 0%. Hopefully this will at least let me read the journal for anything suspicious and also run the commands you posted if this happens again.
+1 for me too! I also see the popup occasionally on my 12th gen i5-1240P. I am running kubuntu, and it would occasionally pop saying battery was at 5%, 9%, and so on. I never got around to finding out where it’s wrong though.
As for my device, I’ve seen it happen on different chargers in different places:
@Matt_Hartley This seems to be an issue in your firmware, so I do hope you are tracking it internally. Disabling the kernel modules can only work around the issue by reducing communication with the EC (so that the race condition is less likely to happen). I will give that a try though.
@jschievink Regarding your inability to prevent the shutdown in an orderly fashion, read this for some background:
Be advised: it’s a depressing reading. In short: authoritarian tendencies of some free software developers at full display.
FYI, I’ve had a similar issue on a previous laptop (where the battery was at fault) and I believe I was able to prevent the shutdown by setting PercentageAction to 0 in /etc/UPower/UPower.conf.
Framework 12th gen i5-1240P, 3.04 firmware, Ubuntu/Kubuntu 23.10 and now 24.04.
While whatever is happening in the kernel happens regardless of DE, the alerts only pops up under KDE, not Gnome. What is interesting to me is that when warning appears, KDE seems to think that the battery state of charge is less than 10% (it will report varying numbers) and then within a second it will report the correct state of charge.
I do see the cros_ec_lpcs packet too long errors from dmesg.
My laptop generally stays plugged in, so I have enabled the charge limit at 75%. I have been charging the laptop through a USB-C hub so that I can have one connection to the laptop. Based on this thread I’m trying providing power on a different port that is directly connected to the power supply and not going through the USB-C hub. I use an Anker GaN power supply. I have already tried plugging the hub into different ports on the laptop. My next experiment if the dedicated power line doesn’t resolve it will be to use the OEM Framework charger, and I will also try switching the USB-C cable (one experiment at a time).