RK3326: default to fake-suspend, kernel suspend proven unwakeable

Hardware test on the Soysauce (2026-07-07) killed both kernel suspend
paths: SuspendState=mem hangs on entry and freeze (s2idle) enters but
never wakes, not even from an armed RTC alarm with every wakeup source
enabled (PMIC pwrkey, rk817 i2c and rtc0 all report enabled). Real
debugging needs UART on the pads.

Make the power button useful instead of a lockup: ship the RK3326
sleep.conf with AllowSuspend=no so logind's HandlePowerKey=suspend
becomes a no-op, and seed system.suspendmode=off through a platform
030-suspend_mode quirk so the archr-fake-suspend path (already wired
to the power key via input_sense) stops exiting early. The quirk also
serves the "default" choice of the ES SUSPEND MODE menu, and on boot
it repairs pacman-upgraded installs whose storage still carries the
old mem-first sleep.conf. Users can still opt in to real suspend
through the same menu (the suspendmode script rewrites the conf with
AllowSuspend=yes), and the sleep.sh state-preservation hooks stay in
place for the day s2idle works.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Douglas Teles
2026-07-07 19:20:16 -03:00
parent 62edc065ad
commit 34b76db065
2 changed files with 29 additions and 4 deletions
@@ -0,0 +1,19 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2026-present ArchR (https://github.com/archr-linux/Arch-R)
# Kernel suspend does not survive on px30 mainline (mem hangs on entry,
# freeze never wakes, RTC alarm included; tested 2026-07-07 on the
# Soysauce). Default the suspend mode to "off" so the power button
# takes the archr-fake-suspend path (display off, audio muted,
# powersave governors, input grabbed) instead of a hard lockup.
#
# Runs in two roles: at boot it seeds the default once (covers pacman
# upgrades whose storage still carries the old mem-first sleep.conf),
# and the suspendmode script calls it when the user picks "default" in
# the ES SUSPEND MODE menu. Explicit user choices are never overridden.
. /etc/profile
if [ -z "$(get_setting system.suspendmode)" ]; then
/usr/bin/suspendmode off >/dev/null 2>&1
fi
@@ -14,10 +14,16 @@ makeinstall_target() {
mkdir -p ${INSTALL}/usr/config/sleep.conf.d
cp sleep.conf ${INSTALL}/usr/config/sleep.conf.d/sleep.conf
if [ "${DEVICE}" = "RK3326" ]; then
# px30 mainline has no working S3: with the stock order the kernel
# tries "mem" first and the console hangs instead of sleeping. Land
# on s2idle directly; the PMIC pwrkey is a wakeup-source in every
# board DTS so the power button wakes it back up.
# px30 mainline has no working kernel suspend at all: "mem" hangs
# on entry and "freeze" (s2idle) enters but never wakes, not even
# from an armed RTC alarm (tested 2026-07-07 on the Soysauce with
# every wakeup source enabled; real debugging needs UART). Inhibit
# real suspend by default so the power button falls through to
# archr-fake-suspend; the ES SUSPEND MODE menu rewrites this file
# via the suspendmode script, so advanced users can still opt in
# to experiment. Keep freeze first for that case: it is the least
# bad state on this SoC.
sed -i 's/^AllowSuspend=.*/AllowSuspend=no/' ${INSTALL}/usr/config/sleep.conf.d/sleep.conf
sed -i 's/^SuspendState=.*/SuspendState=freeze/' ${INSTALL}/usr/config/sleep.conf.d/sleep.conf
fi
cp modules.bad ${INSTALL}/usr/config