Open ardangelo opened 6 days ago
AIC driver is causing the suspend failure. Unloading the AIC driver allows suspend to succeed.
rmmod aic8800_fdrv
rmmod aic8800_bsp
insmod /mnt/system/ko/cv181x_rtc.ko
date -s 2024-11-23
hwclock -w
hwclock -w
echo +30 >/sys/class/rtc/rtc0/wakealarm
echo mem > /sys/power/state
no_console_suspend
will show more detail on the suspend failure when driver is loaded.
echo N | tee /sys/module/printk/parameters/console_suspend
echo mem > /sys/power/state
[ 328.663206] PM: suspend entry (deep)
[ 328.683683] Filesystems sync: 0.020 seconds
[ 328.683941] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 328.685555] OOM killer disabled.
[ 328.685562] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) do
ne.
[ 328.687340] aicbsp: aicbsp_sdio_suspend, func->num = 2
[ 328.687351] aicbsp: aicbsp_sdio_suspend: can't keep power while host is suspe
nded
[ 328.687374] PM: dpm_run_callback(): pm_generic_suspend+0x0/0x12 returns -22
[ 328.694637] aicsdio: aicwf_sdio_suspend enter
[ 328.694655] PM: dpm_run_callback(): pm_generic_suspend+0x0/0x12 returns -22
[ 328.701889] PM: Device mmc1:390b:2 failed to suspend async: error -22
[ 328.708582] PM: Device mmc1:390b:1 failed to suspend: error -22
[ 328.714748] PM: Some devices failed to suspend, or early wake event detected
[ 328.722663] OOM killer enabled.
[ 328.722671] Restarting tasks ... done.
[ 328.725157] PM: suspend exit
In drivers/net/wireless/aicsemi/aic8800/aic8800_fdrv/aicwf_sdio.c
, there is a check for the MMC_PM_KEEP_POWER
flag in PM capabilities, it is not enabled, so suspend fails.
sdio_flags = sdio_get_host_pm_caps(sdiodev->func);
if (!(sdio_flags & MMC_PM_KEEP_POWER))
return -EINVAL;
Build of edb9ca4 for MilkV Duo S, configuration
sg2000_milkv_duos_musl_riscv64_sd_defconfig
. Following the steps on https://github.com/milkv-duo/duo-buildroot-sdk-v2/commit/f11eb52dd744ebc0fd57da7f71bb06ff94ad74e6 , I enabledCONFIG_KERNEL_SUSPEND
in the defconfig file. Additionally, I addedCONFIG_SUSPEND=y
,CONFIG_SUSPEND_FREEZER=y
,CONFIG_PM_SLEEP=y
to the kernel configuration. Attempting suspend results in an error.