• Adrian Ratiu's avatar
    brcmfmac: fix suspend/resume when power is cut off · e0ae4bac
    Adrian Ratiu authored
    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: default avatarGustavo Padovan <gustavo.padovan@collabora.com>
    Signed-off-by: default avatarAdrian Ratiu <adrian.ratiu@collabora.com>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    e0ae4bac
bcmsdh.c 30 KB