diff mbox series

[1/6] wifi: wilc1000: disable power sequencer

Message ID 20240613-wilc_suspend-v1-1-c2f766d0988c@bootlin.com
State New
Headers show
Series wifi: wilc1000: update power management | expand

Commit Message

Alexis Lothoré June 13, 2024, 2:06 p.m. UTC
From: Ajay Singh <ajay.kathat@microchip.com>

Driver systematically disables some power mechanism each time it starts the
chip firmware (so mostly when interface is brought up). This has a negative
impact on some specific scenarios when the chip is exposed as a
hotpluggable SDIO card (eg: WILC1000 SD):
- when executing suspend/resume sequence while interface has been brought
  up
- rebooting the platform while module is plugged and interface has been
  brought up
Those scenarios lead to mmc core trying to initialize again the chip which
is now unresponsive (because of the power sequencer setting), so it fails
in mmc_rescan->mmc_attach_sdio and enter a failure loop while trying to
send CMD5:
mmc0: error -110 whilst initialising SDIO card
mmc0: error -110 whilst initialising SDIO card
mmc0: error -110 whilst initialising SDIO card
[...]

Preventing the driver from disabling this "power sequencer" fixes those
enumeration issues without affecting nominal operations.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/wireless/microchip/wilc1000/sdio.c | 15 ---------------
 drivers/net/wireless/microchip/wilc1000/wlan.h |  1 -
 2 files changed, 16 deletions(-)

Comments

Kalle Valo June 18, 2024, 10:24 a.m. UTC | #1
Alexis Lothoré <alexis.lothore@bootlin.com> wrote:

> From: Ajay Singh <ajay.kathat@microchip.com>
> 
> Driver systematically disables some power mechanism each time it starts the
> chip firmware (so mostly when interface is brought up). This has a negative
> impact on some specific scenarios when the chip is exposed as a
> hotpluggable SDIO card (eg: WILC1000 SD):
> - when executing suspend/resume sequence while interface has been brought
>   up
> - rebooting the platform while module is plugged and interface has been
>   brought up
> Those scenarios lead to mmc core trying to initialize again the chip which
> is now unresponsive (because of the power sequencer setting), so it fails
> in mmc_rescan->mmc_attach_sdio and enter a failure loop while trying to
> send CMD5:
> mmc0: error -110 whilst initialising SDIO card
> mmc0: error -110 whilst initialising SDIO card
> mmc0: error -110 whilst initialising SDIO card
> [...]
> 
> Preventing the driver from disabling this "power sequencer" fixes those
> enumeration issues without affecting nominal operations.
> 
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>

6 patches applied to wireless-next.git, thanks.

70ed0bdab1ca wifi: wilc1000: disable power sequencer
301e44e973eb wifi: wilc1000: let host->chip suspend/resume notifications manage chip wake/sleep
25d086ba1964 wifi: wilc1000: do not keep sdio bus claimed during suspend/resume
a814112e9545 wifi: wilc1000: move sdio suspend method next to resume and pm ops definition
1e9e258d9fb5 wifi: wilc1000: remove suspend/resume from cfg80211 part
5ad8897fd15a wifi: wilc1000: disable SDIO func IRQ before suspend
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c
index e6e20c86b791..6461a3ec0120 100644
--- a/drivers/net/wireless/microchip/wilc1000/sdio.c
+++ b/drivers/net/wireless/microchip/wilc1000/sdio.c
@@ -907,27 +907,12 @@  static int wilc_sdio_sync_ext(struct wilc *wilc, int nint)
 {
 	struct sdio_func *func = dev_to_sdio_func(wilc->dev);
 	struct wilc_sdio *sdio_priv = wilc->bus_data;
-	u32 reg;
 
 	if (nint > MAX_NUM_INT) {
 		dev_err(&func->dev, "Too many interrupts (%d)...\n", nint);
 		return -EINVAL;
 	}
 
-	/**
-	 *      Disable power sequencer
-	 **/
-	if (wilc_sdio_read_reg(wilc, WILC_MISC, &reg)) {
-		dev_err(&func->dev, "Failed read misc reg...\n");
-		return -EINVAL;
-	}
-
-	reg &= ~BIT(8);
-	if (wilc_sdio_write_reg(wilc, WILC_MISC, reg)) {
-		dev_err(&func->dev, "Failed write misc reg...\n");
-		return -EINVAL;
-	}
-
 	if (sdio_priv->irq_gpio) {
 		u32 reg;
 		int ret, i;
diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h
index d72a0a81bbda..dd2fb3c2f06a 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.h
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.h
@@ -56,7 +56,6 @@ 
 #define WILC_HOST_RX_CTRL		(WILC_PERIPH_REG_BASE + 0x80)
 #define WILC_HOST_RX_EXTRA_SIZE		(WILC_PERIPH_REG_BASE + 0x84)
 #define WILC_HOST_TX_CTRL_1		(WILC_PERIPH_REG_BASE + 0x88)
-#define WILC_MISC			(WILC_PERIPH_REG_BASE + 0x428)
 #define WILC_INTR_REG_BASE		(WILC_PERIPH_REG_BASE + 0xa00)
 #define WILC_INTR_ENABLE		WILC_INTR_REG_BASE
 #define WILC_INTR2_ENABLE		(WILC_INTR_REG_BASE + 4)