Skip to content

Commit

Permalink
wifi: wilc1000: Do not operate uninitialized hardware during suspend/…
Browse files Browse the repository at this point in the history
…resume

In case the hardware is not initialized, do not operate it during
suspend/resume cycle, the hardware is already off so there is no
reason to access it.

In fact, wilc_sdio_enable_interrupt() in the resume callback does
interfere with the same call when initializing the hardware after
resume and makes such initialization after resume fail. Fix this
by not operating uninitialized hardware during suspend/resume.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240821183639.163187-1-marex@denx.de
  • Loading branch information
Marek Vasut authored and Kalle Valo committed Sep 3, 2024
1 parent d387922 commit b0dc701
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/wireless/microchip/wilc1000/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,9 @@ static int wilc_sdio_suspend(struct device *dev)

dev_info(dev, "sdio suspend\n");

if (!wilc->initialized)
return 0;

if (!IS_ERR(wilc->rtc_clk))
clk_disable_unprepare(wilc->rtc_clk);

Expand All @@ -999,6 +1002,10 @@ static int wilc_sdio_resume(struct device *dev)
struct wilc *wilc = sdio_get_drvdata(func);

dev_info(dev, "sdio resume\n");

if (!wilc->initialized)
return 0;

wilc_sdio_init(wilc, true);
wilc_sdio_enable_interrupt(wilc);

Expand Down

0 comments on commit b0dc701

Please sign in to comment.