Skip to contentSkip to conversation

wifi: wilc1000: Re-enable RTC clock on resume

PATCH In review Marek Vasut 3 participants 3 messages Aug 21, 2024 – Sep 3, 2024 Microchip WILC1000 wifi driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: wilc1000: Re-enable RTC clock on resume

The wilc_sdio_suspend() does clk_disable_unprepare() on rtc_clk clock, make sure wilc_sdio_resume() does matching clk_prepare_enable(), else any suspend/resume cycle leads to clock disable/enable imbalance. Fix the imbalance.

---
Cc: Ajay Singh <[email protected]>
Cc: Alexis Lothoré <[email protected]>
Cc: Claudiu Beznea <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: [email protected]

---
 drivers/net/wireless/microchip/wilc1000/sdio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/microchip/wilc1000/sdio.c +3 -0
index 7999aeb76901f..683a35c682a8f 100644
@@ -1006,6 +1006,9 @@ static int wilc_sdio_resume(struct device *dev)
 	if (!wilc->initialized)
 		return 0;
 
+	if (!IS_ERR(wilc->rtc_clk))
+		clk_prepare_enable(wilc->rtc_clk);
+
 	wilc_sdio_init(wilc, true);
 	wilc_sdio_enable_interrupt(wilc);
 
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Marek Vasut

The wilc_sdio_suspend() does clk_disable_unprepare() on rtc_clk clock, make sure wilc_sdio_resume() does matching clk_prepare_enable(), else any suspend/resume cycle leads to clock disable/enable imbalance. Fix the imbalance.

Quoted 8 lines

---
Cc: Ajay Singh <[email protected]>
Cc: Alexis Lothoré <[email protected]>
Cc: Claudiu Beznea <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: [email protected]

Signature · 3 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
In reply to Marek Vasut
Quoted 7 lines · Marek Vasut

The wilc_sdio_suspend() does clk_disable_unprepare() on rtc_clk clock, make sure wilc_sdio_resume() does matching clk_prepare_enable(), else any suspend/resume cycle leads to clock disable/enable imbalance. Fix the imbalance.

Patch applied to wireless-next.git, thanks.

0c896eceb5f3 wifi: wilc1000: Re-enable RTC clock on resume

Signature · 4 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
https://docs.kernel.org/process/submitting-patches.html