Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duo S: Suspend-to-RAM failure when aic8800 Wi-Fi driver is loaded #18

Open
ardangelo opened this issue Nov 23, 2024 · 2 comments
Open

Comments

@ardangelo
Copy link

Build of edb9ca4 for MilkV Duo S, configuration sg2000_milkv_duos_musl_riscv64_sd_defconfig. Following the steps on f11eb52 , I enabled CONFIG_KERNEL_SUSPEND in the defconfig file. Additionally, I added CONFIG_SUSPEND=y, CONFIG_SUSPEND_FREEZER=y, CONFIG_PM_SLEEP=y to the kernel configuration. Attempting suspend results in an error.

[root@milkv-duo]~# insmod /mnt/system/ko/cv181x_rtc.ko
[root@milkv-duo]~# hwclock -w
[root@milkv-duo]~# cat /sys/power/state
freeze mem
[root@milkv-duo]~# echo +30 >/sys/class/rtc/rtc0/wakealarm
[root@milkv-duo]~# echo mem > /sys/power/state
[   87.494847] PM: dpm_run_callback(): pm_generic_suspend+0x0/0x12 returns -22
[   87.494856] PM: Device mmc1:390b:2 failed to suspend async: error -22
[   87.494882] PM: Some devices failed to suspend, or early wake event detected
sh: write error: Invalid argument
@ardangelo
Copy link
Author

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

@ardangelo ardangelo changed the title Duo S: Suspend-to-RAM failure Duo S: Suspend-to-RAM failure when aic8800 Wi-Fi driver is loaded Nov 24, 2024
@ardangelo
Copy link
Author

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant