Skip to contentSkip to conversation

libertas sdio: fix suspend when interface is down

PATCH In review Daniel Drake 2 participants 2 messages Sep 3, 2012 – Sep 4, 2012 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libertas sdio: fix suspend when interface is down

When the interface is down, the hardware is powered off. However, the suspend handler currently tries to send host sleep commands (when wakeup params are set) in this configuration, causing a system hang when going into suspend (the commands will never complete).

Avoid this by detecting this situation and simply returning from the suspend handler without doing anything special.

---
 drivers/net/wireless/libertas/if_sdio.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/wireless/libertas/if_sdio.c +5 -0
index e970897..4cb2343 100644
@@ -1326,6 +1326,11 @@ static int if_sdio_suspend(struct device *dev)
 
 	mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
 
+	/* If we're powered off anyway, just let the mmc layer remove the
+	 * card. */
+	if (!lbs_iface_active(card->priv))
+		return -ENOSYS;
+
 	dev_info(dev, "%s: suspend: PM flags = 0x%x\n",
 		 sdio_func_id(func), flags);
 
Signature · 1 line
1.7.11.4
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Daniel Drake

When the interface is down, the hardware is powered off. However, the suspend handler currently tries to send host sleep commands (when wakeup params are set) in this configuration, causing a system hang when going into suspend (the commands will never complete).

Avoid this by detecting this situation and simply returning from the suspend handler without doing anything special.

Quoted 20 lines
---
 drivers/net/wireless/libertas/if_sdio.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/wireless/libertas/if_sdio.c +5 -0
index e970897..4cb2343 100644
@@ -1326,6 +1326,11 @@ static int if_sdio_suspend(struct device *dev)
 
 	mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
 
+	/* If we're powered off anyway, just let the mmc layer remove the
+	 * card. */
+	if (!lbs_iface_active(card->priv))
+		return -ENOSYS;
+
 	dev_info(dev, "%s: suspend: PM flags = 0x%x\n",
 		 sdio_func_id(func), flags);