]> git.baikalelectronics.ru Git - kernel.git/commit
libertas: fix suspend and resume for SDIO connected cards
authorDaniel Mack <daniel@zonque.org>
Wed, 27 Jun 2018 18:58:45 +0000 (20:58 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 4 Jul 2018 15:12:46 +0000 (18:12 +0300)
commit31ed73a956778377179c6acc16a94228515c545d
tree1f619615c01eec65a7f46f0efa33b65792e6842f
parent2fa34f69594ee2e54fe091a1a2bae6e0281c2e56
libertas: fix suspend and resume for SDIO connected cards

Prior to commit 3142b0fe9cfd ("mmc: core: Invoke sdio func driver's PM
callbacks from the sdio bus"), the MMC core used to call into the power
management functions of SDIO clients itself and removed the card if the
return code was non-zero. IOW, the mmc handled errors gracefully and didn't
upchain them to the pm core.

Since this change, the mmc core relies on generic power management
functions which treat all errors as a reason to cancel the suspend
immediately. This causes suspend attempts to fail when the libertas
driver is loaded.

To fix this, power down the card explicitly in if_sdio_suspend() when we
know we're about to lose power and return success. Also set a flag in these
cases, and power up the card again in if_sdio_resume().

Fixes: 3142b0fe9cfd ("mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus")
Cc: <stable@vger.kernel.org>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: Chris Ball <chris@printf.net>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/libertas/dev.h
drivers/net/wireless/marvell/libertas/if_sdio.c