提交 3e3831c4 编写于 作者: A Arend van Spriel 提交者: John W. Linville

brcmfmac: reset suspend flag upon sdio suspend failure

The suspend callback first sets the suspend flag used in the driver
but after that the actual suspend is done, which may fail. Reset the
flag upon suspend failure.
Reviewed-by: NFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: NPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: NDaniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 a5333914
...@@ -1101,9 +1101,7 @@ static int brcmf_ops_sdio_suspend(struct device *dev) ...@@ -1101,9 +1101,7 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
int ret = 0; int ret = 0;
brcmf_dbg(SDIO, "\n"); brcmf_dbg(SDIO, "Enter\n");
atomic_set(&sdiodev->suspend, true);
sdio_flags = sdio_get_host_pm_caps(sdiodev->func[1]); sdio_flags = sdio_get_host_pm_caps(sdiodev->func[1]);
if (!(sdio_flags & MMC_PM_KEEP_POWER)) { if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
...@@ -1111,9 +1109,12 @@ static int brcmf_ops_sdio_suspend(struct device *dev) ...@@ -1111,9 +1109,12 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
return -EINVAL; return -EINVAL;
} }
atomic_set(&sdiodev->suspend, true);
ret = sdio_set_host_pm_flags(sdiodev->func[1], MMC_PM_KEEP_POWER); ret = sdio_set_host_pm_flags(sdiodev->func[1], MMC_PM_KEEP_POWER);
if (ret) { if (ret) {
brcmf_err("Failed to set pm_flags\n"); brcmf_err("Failed to set pm_flags\n");
atomic_set(&sdiodev->suspend, false);
return ret; return ret;
} }
...@@ -1127,6 +1128,7 @@ static int brcmf_ops_sdio_resume(struct device *dev) ...@@ -1127,6 +1128,7 @@ static int brcmf_ops_sdio_resume(struct device *dev)
struct brcmf_bus *bus_if = dev_get_drvdata(dev); struct brcmf_bus *bus_if = dev_get_drvdata(dev);
struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
brcmf_dbg(SDIO, "Enter\n");
brcmf_sdio_wd_timer(sdiodev->bus, BRCMF_WD_POLL_MS); brcmf_sdio_wd_timer(sdiodev->bus, BRCMF_WD_POLL_MS);
atomic_set(&sdiodev->suspend, false); atomic_set(&sdiodev->suspend, false);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册