Old Bay Trail laptop dies with the lid closed and leaves no logs? Cap the C-states

My Linux Chromebook (Celeron N2840, Bay Trail) kept "turning itself off" while the lid was closed. When I opened it the screen was black, and only a long press on Power brought it back. I never shut it down, and the lid action was set to "display off" rather than suspend.

The journal confirmed every boot ended without any shutdown sequence:

journalctl --list-boots
sudo journalctl -b -1 -n 30 --no-pager

The previous boots just stopped. earlyoom logs a line every minute, and that line simply ended. Nothing else was there either: no oops, nothing in /var/lib/systemd/pstore/, memory and temperatures fine. A hard freeze that writes nothing, and only while the machine is idle, is the classic Bay Trail deep C-state bug (kernel bugzilla 109051). It still shows up on a 6.12 kernel.

The usual workaround is to keep the CPU out of the deep idle states:

sudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"/' /etc/default/grub
sudo update-grub

After a reboot, check it took:

cat /sys/module/intel_idle/parameters/max_cstate      # 1
cat /sys/devices/system/cpu/cpu0/cpuidle/state*/name  # only POLL and C1

The cost is a little more idle power, which hardly matters on AC. If it still freezes, add processor.max_cstate=1 as well.

While I was in there, I found that MX Linux had installed broadcom-sta-dkms, and its wl module was loading on a machine with Intel wifi. That tainted the kernel and printed a WARNING at boot. If lspci shows no Broadcom card, blacklist it:

printf 'blacklist wl\n' | sudo tee /etc/modprobe.d/no-wl.conf
sudo update-initramfs -u

Comments

  1. Markdown is allowed. HTML tags allowed: <strong>, <em>, <blockquote>, <code>, <pre>, <a>.