On 8/27/24 17:20, Marek Vasut wrote: > On 8/27/24 11:53 AM, Alexis Lothoré wrote: [...] >>> - return 0; >>> + return sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); >>> } >> >> This change breaks suspend/resume on my wilc1000 setup (sama5d2 wlsom evk + >> wilc1000 sd): >> >> # echo mem > /sys/power/state >> PM: suspend entry (deep) >> Filesystems sync: 0.055 seconds >> Freezing user space processes >> Freezing user space processes completed (elapsed 0.018 seconds) >> OOM killer disabled. >> Freezing remaining freezable tasks >> Freezing remaining freezable tasks completed (elapsed 0.006 seconds) >> wilc1000_sdio mmc0:0001:1: sdio suspend >> wilc1000_sdio mmc0:0001:1: PM: dpm_run_callback(): pm_generic_suspend returns -22 >> wilc1000_sdio mmc0:0001:1: PM: failed to suspend async: error -22 >> PM: Some devices failed to suspend, or early wake event detected >> OOM killer enabled. >> Restarting tasks ... done. >> random: crng reseeded on system resumption >> PM: suspend exit >> sh: write error: Invalid argument >> >> But I have to dig more to really understand the root cause. > > Does your MMC controller struct mmc_host set .pm_caps |= MMC_PM_KEEP_POWER ? > Maybe that's the problem, that the controller does not set these PM caps ? It looks like you are right, my sdmmc controller was missing some keep-power-in-suspend flag in my device tree, preventing your change to work on my platform. So it behaves correctly for me with both wilc1000/wilc3000, thanks. Looks ok for me, but others may have a more informed opinion than me about the impact of this change. Thanks, Alexis -- Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com