Repository navigation
Description
System Model or SKU
Framework Laptop 13 (AMD Ryzen™ AI 300 Series)
BIOS Version
04.02
DIY Edition Information
Memory: 2x Crucial CT48G56C46S5 (48 GB DDR5-5600 CL46)
Storage: WD_BLACK SN8100 8000GB
Port/Peripheral Information
None involved. On battery, no charger or other device connected.
Standalone Operation
Full System, Standalone mode NOT enabled (normal usage)
Describe the Bug
On a Laptop 13 Pro with the AMD Ryzen AI 300 Series mainboard (Ryzen AI 9 HX 370), BIOS 04.02 and EC lilac-4.0.2-fdbf549, the EC's replies to host commands regularly arrive corrupted while on battery. The kernel logs:
cros_ec_lpcs FRMWC004:00: packet too long (65535 bytes, expected 248)
cros_ec_lpcs FRMWC004:00: packet too long (65280 bytes, expected 248)
cros_ec_lpcs FRMWC004:00: packet too long (255 bytes, expected 248)
cros_ec_lpcs FRMWC004:00: bad packet checksum ff
cros_ec_lpcs FRMWC004:00: bad packet checksum fd
and framework_tool console following fails with UnknownResponseCode(255) or InvalidChecksum. The kernel reads the reply with one I/O port read per byte from the host command window at 0x800. The lengths 65535, 65280 and 255 are a reply length with one or both of its bytes read as 0xFF, which is the value of a failed port read, and the EC never writes such a length. So single eSPI reads fail, not the EC's reply.
The trigger is the CPUs' deepest idle state, ACPI C3. With the system idle on battery and sudo framework_tool --console follow running (restarted whenever it exited), the kernel logged:
| Time | cpuidle state3 (C3) | Errors |
|---|---|---|
| 18:10:30-18:20:30 (10 min) | enabled | 17 |
| 18:20:30-18:37:19 (17 min) | disabled on all CPUs | 0 |
| 18:37:19-18:38:07 (48 s) | enabled again | 4 |
Keeping the CPUs out of C3 by load also stops them: a loop reading fan1_target of the cros_ec hwmon device (an EC host command) about 35 times per second, in its second half also the battery's uevent, for 3 minutes (18:14:36-18:17:36) gave no errors, and the console follow running at the same time had none from 18:12:47 to 18:17:39. The next one came 3 s after the loop ended.
The idle states (acpi_idle driver, menu governor) are C1 (ACPI FFH MWAIT 0x0), C2 (ACPI IOPORT 0x414, latency 18 us) and C3 (ACPI IOPORT 0x415, latency 350 us). C2 stayed enabled during the test, so only C3 matters. At idle the cores spend most of their time in C3 (CPU 0: 639 s of about 700 s since boot).
Outside this test the kernel logged 185 of these errors between 2026-09-21 and 2026-11-19, up to 36 a day. The EC is read there by the Linux drivers, by a GNOME extension which reads the EC's hwmon sensors every 2 seconds, and sometimes by framework_tool. UPower's history covers the last 11 of them: 10 happened on battery and one 11 s after a charger was plugged in. On AC, hours of console follow on 2026-11-17 and 2026-11-18 gave none.
Effects:
- A failed reply fails the host command. The kernel retries only on
EC_RES_IN_PROGRESS, so drivers on top ofcros_ec(hwmon, charge control) and tools likeframework_toolreceive the error. - Probably the same failure behind the corrupt battery readings on battery in community thread 85243 (lilac-3.0.5, the same kernel errors together with garbage
_BSTvalues and false "battery critical" actions) and community thread 38056 (Ryzen AI 300 owners report 0% readings, mostly on battery, also on recent kernels). If the BIOS's ACPI code reads the battery values from the EC over the same bus, a failed read there gives a wrong value instead of an error. I have not verified this part.
Steps To Reproduce
- On battery, leave the system idle and check that the cores use C3:
grep . /sys/devices/system/cpu/cpu0/cpuidle/state3/usagegrows quickly. - Run
sudo framework_tool --console follow(restart it when it exits) andjournalctl -kf | grep cros_ec_lpcs. - See
packet too longorbad packet checksumevery few seconds to a minute. - Disable C3:
sudo sh -c 'for f in /sys/devices/system/cpu/cpu*/cpuidle/state3/disable; do echo 1 > $f; done'. The errors stop. - Enable it again (
echo 0). The errors return within a minute.
Expected Behavior
EC host command replies are read correctly in every CPU idle state, on battery as on AC.
Screenshots
No response
Operating System
Ubuntu 26.04.1 LTS
Linux Kernel Version
7.0.0-43-generic
Additional Context
- I did not find a cause in the EC firmware. On the EC side (
fdbf549and Zephyr8bdbcbbbe6):power_sequence.cof azalea keeps the EC out of deep sleep in S0 (SLEEP_MASK_AP_RUN), shared memory window 1 has no read protection (host_hcmd_init()), andhost_packet_respond()fills in the reply, its length (clipped to the window) and its checksum beforelpc_send_response_packet()writes the result byte and clears the processing flag. - I could not check whether the EC sees eSPI errors at the same time:
espi_bus_err_isr()logseSPI Bus Errorfrom an interrupt, and the shim's printk hook (zephyr_shim_console_out()) skips the host console buffer in interrupts, so only the EC UART would show it. The console buffer showed nothing unusual at the error times. - Possibly related, on the EC's side: the APU's SB-TSI (
cpu@4coni2c7_0) failed on about 4 of 5 reads while the cores idled mostly in C3, read fine under load, and stopped failing when C3 was disabled (EmbeddedController#69 comment). - Disabling C3 avoids the errors but costs battery life, so it is not a fix. I do not know whether the eSPI controller of the APU or the EC drops these reads, nor whether a BIOS setting (for example for eSPI or C-states) changes it.
Activity