wifi: wilc1000: disable SDIO func IRQ before suspend
authorAlexis Lothoré <alexis.lothore@bootlin.com>
Thu, 13 Jun 2024 14:06:45 +0000 (16:06 +0200)
committerKalle Valo <kvalo@kernel.org>
Tue, 18 Jun 2024 10:23:16 +0000 (13:23 +0300)
Issuing a system suspend command raises the following warning:
WARNING: CPU: 0 PID: 15 at drivers/mmc/core/sdio.c:1042 mmc_sdio_suspend+0xd4/0x19c
CPU: 0 PID: 15 Comm: kworker/u2:1 Not tainted 6.7.0-rc1-wt+ #710
Hardware name: Atmel SAMA5
Workqueue: events_unbound async_run_entry_fn
 unwind_backtrace from show_stack+0x18/0x1c
 show_stack from dump_stack_lvl+0x34/0x48
 dump_stack_lvl from __warn+0x98/0x160
 __warn from warn_slowpath_fmt+0xcc/0x140
 warn_slowpath_fmt from mmc_sdio_suspend+0xd4/0x19c
 mmc_sdio_suspend from mmc_bus_suspend+0x50/0x70
 mmc_bus_suspend from dpm_run_callback+0xe4/0x248
 dpm_run_callback from __device_suspend+0x234/0x91c
 __device_suspend from async_suspend+0x24/0x9c
 async_suspend from async_run_entry_fn+0x6c/0x210
 async_run_entry_fn from process_one_work+0x3a0/0x870
[...]

This warning is due to a check in SDIO core ensuring that interrupts do not
remain enabled for cards being powered down during suspend. WILC driver
currently does not set the MMC_PM_KEEP_POWER flag, so disable interrupt
when entering resume.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240613-wilc_suspend-v1-6-c2f766d0988c@bootlin.com
drivers/net/wireless/microchip/wilc1000/sdio.c

index 4e70146709455bdefc355366b0875bd57a3db479..0043f7a0fdf97b5b6788e478166a18de4c967de2 100644 (file)
@@ -982,6 +982,8 @@ static int wilc_sdio_suspend(struct device *dev)
 
        host_sleep_notify(wilc);
 
+       wilc_sdio_disable_interrupt(wilc);
+
        ret = wilc_sdio_reset(wilc);
        if (ret) {
                dev_err(&func->dev, "Fail reset sdio\n");
@@ -998,6 +1000,7 @@ static int wilc_sdio_resume(struct device *dev)
 
        dev_info(dev, "sdio resume\n");
        wilc_sdio_init(wilc, true);
+       wilc_sdio_enable_interrupt(wilc);
 
        host_wakeup_notify(wilc);