Skip to contentSkip to conversation

libertas: call into generic suspend code before turning off power

PATCH In review Daniel Mack 3 participants 4 messages Oct 8, 2018 – Oct 10, 2018 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libertas: call into generic suspend code before turning off power

When powering down a SDIO connected card during suspend, make sure to call into the generic lbs_suspend() function before pulling the plug. This will make sure the card is successfully deregistered from the system to avoid communication to the card starving out.

Fixes 7444a8092906 ("libertas: fix suspend and resume for SDIO connected cards")

---
If possible, this should go in for 4.19.

 drivers/net/wireless/marvell/libertas/if_sdio.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/marvell/libertas/if_sdio.c +4 -0
index 43743c26c071..39bf85d0ade0 100644
@@ -1317,6 +1317,10 @@ static int if_sdio_suspend(struct device *dev)
 	if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
 		dev_info(dev, "Suspend without wake params -- powering down card\n");
 		if (priv->fw_ready) {
+			ret = lbs_suspend(priv);
+			if (ret)
+				return ret;
+
 			priv->power_up_on_resume = true;
 			if_sdio_power_off(card);
 		}
Signature · 1 line
2.17.1

A message that is not in the archive (sent off-list or not yet received): 20181008200357.10819-1-daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 7 lines · Daniel Mack

When powering down a SDIO connected card during suspend, make sure to call into the generic lbs_suspend() function before pulling the plug. This will make sure the card is successfully deregistered from the system to avoid communication to the card starving out.

Fixes 7444a8092906 ("libertas: fix suspend and resume for SDIO connected cards")

BTW, if you need this to reach 4.19 I have already queued some other mmc fixes so I can take this as well, if it helps. I need and ack of course.

Kind regards
Uffe

Quoted 24 lines

---
If possible, this should go in for 4.19.

 drivers/net/wireless/marvell/libertas/if_sdio.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/marvell/libertas/if_sdio.c +4 -1
index 43743c26c071..39bf85d0ade0 100644
@@ -1317,6 +1317,10 @@ static int if_sdio_suspend(struct device *dev)
        if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
                dev_info(dev, "Suspend without wake params -- powering down card\n");
                if (priv->fw_ready) {
+                       ret = lbs_suspend(priv);
+                       if (ret)
+                               return ret;
+
                        priv->power_up_on_resume = true;
                        if_sdio_power_off(card);
                }
--

2.17.1

A message that is not in the archive (sent off-list or not yet received): CAPDyKFoo-gnjUg9Khc3EPm=cvHgyR_VNW8xgjP1Tea7wjRfvSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Acked-by
#4 lore raw
Quoted 6 lines · Ulf Hansson
Quoted 5 lines · Daniel Mack

When powering down a SDIO connected card during suspend, make sure to call into the generic lbs_suspend() function before pulling the plug. This will make sure the card is successfully deregistered from the system to avoid communication to the card starving out.

Quoted 8 lines
Quoted 2 lines
Fixes 7444a8092906 ("libertas: fix suspend and resume for SDIO connected cards")

BTW, if you need this to reach 4.19 I have already queued some other mmc fixes so I can take this as well, if it helps. I need and ack of course.

I'm not planning to send anything to 4.19 anymore and this is so simple that hopefully it cause any conflicts with -next patches, so feel free to do that:

Signature · 1 line
Kalle Valo

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 17 lines · Kalle Valo
Quoted 6 lines · Ulf Hansson
Quoted 5 lines · Daniel Mack

When powering down a SDIO connected card during suspend, make sure to call into the generic lbs_suspend() function before pulling the plug. This will make sure the card is successfully deregistered from the system to avoid communication to the card starving out.

Quoted 8 lines
Quoted 2 lines
Fixes 7444a8092906 ("libertas: fix suspend and resume for SDIO connected cards")

BTW, if you need this to reach 4.19 I have already queued some other mmc fixes so I can take this as well, if it helps. I need and ack of course.

Quoted 5 lines

I'm not planning to send anything to 4.19 anymore and this is so simple that hopefully it cause any conflicts with -next patches, so feel free to do that:

Applied for fixes, thanks!

Kind regards
Uffe