Firmware instability, ACPI delays

Hi,

I recently updated (batch 4, DIY, if it matters) to the 3.07 firmware to try out the battery charge limiting feature. I set the max to 70% and set about using the system as normal (running FreeBSD 14.0-CURRENT). Things started out great, but as the battery capacity hit ~70-80%, the system became unstable. Within ~30-60s seconds of a fresh boot with the battery within that range, the machine would become completely unresponsive with the framebuffer contents remaining intact – this is a pretty unusual failure mode on this machine, neither panicking nor simply rebooting but seemingly deadlocked.

I removed the limitation and noted the erratic behavior continued until the battery hit somewhere around 80-82%, at which point the machine would remain stable. I noticed with the new firmware we suddenly see these messages (apparently from the firmware?):

ACPI Warning: Firmware issue: Excessive sleep time (0x00000000000003E8 ms > 10 ms) in ACPI Control Method (20220331/exsystem-347)

These appear at all times with some frequency, but it seemed much more frequent during the period of erratic behavior I observed. We’ve tickled EC bugs in the past on the framework (crashed the EC with the touchpad), so it wouldn’t entirely surprise me if we’ve managed to tickle another one somehow.

Any thoughts? CC @Kieran_Levin. I’m not at all familiar with how our ACPI stuff works, but if you’ve any questions about how our kernel works I can certainly get an answer to them.