libertas: call into generic suspend code before turning off power
authorDaniel Mack <daniel@zonque.org>
Mon, 8 Oct 2018 20:03:57 +0000 (22:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:42:56 +0000 (07:42 -0800)
[ Upstream commit 4f666675cdff0b986195413215eb062b7da6586f ]

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")
Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/marvell/libertas/if_sdio.c

index a0ae8d8..06a57c7 100644 (file)
@@ -1368,6 +1368,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);
                }