OSDN Git Service

brcmfmac: fix suspend/resume when power is cut off
authorAdrian Ratiu <adrian.ratiu@collabora.com>
Wed, 25 Sep 2019 13:44:58 +0000 (16:44 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 1 Oct 2019 09:14:21 +0000 (12:14 +0300)
commite0ae4bac22effbd644add326f658a3aeeb8d45ee
tree0862e1f08aa6f4e69c9a35536fc89c3c2e72843d
parent1524cbf3621576c639405e7aabeac415f9617c8d
brcmfmac: fix suspend/resume when power is cut off

brcmfmac assumed the wifi device always remains powered on and thus
hardcoded the MMC_PM_KEEP_POWER flag expecting the wifi device to
remain on even during suspend/resume cycles.

This is not always the case, some appliances cut power to everything
connected via SDIO for efficiency reasons and this leads to wifi not
being usable after coming out of suspend because the device was not
correctly reinitialized.

So we check for the keep_power capability and if it's not present then
we remove the device and probe it again during resume to mirror what's
happening in hardware and ensure correct reinitialization in the case
when MMC_PM_KEEP_POWER is not supported.

Suggested-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c