aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2014-02-25 14:30:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-28 14:33:49 -0500
commit3e3831c4fdc53aabf3a56419ef6d96a841c52435 (patch)
tree490998964dd4cf3f94973ae45999a3e37403fff8 /drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
parenta5333914536debe05f36ed0d0273f1ddab744eea (diff)
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: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index 9eea7d4dd501..4a6508e7e3a1 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -1101,9 +1101,7 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
1101 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; 1101 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
1102 int ret = 0; 1102 int ret = 0;
1103 1103
1104 brcmf_dbg(SDIO, "\n"); 1104 brcmf_dbg(SDIO, "Enter\n");
1105
1106 atomic_set(&sdiodev->suspend, true);
1107 1105
1108 sdio_flags = sdio_get_host_pm_caps(sdiodev->func[1]); 1106 sdio_flags = sdio_get_host_pm_caps(sdiodev->func[1]);
1109 if (!(sdio_flags & MMC_PM_KEEP_POWER)) { 1107 if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
@@ -1111,9 +1109,12 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
1111 return -EINVAL; 1109 return -EINVAL;
1112 } 1110 }
1113 1111
1112 atomic_set(&sdiodev->suspend, true);
1113
1114 ret = sdio_set_host_pm_flags(sdiodev->func[1], MMC_PM_KEEP_POWER); 1114 ret = sdio_set_host_pm_flags(sdiodev->func[1], MMC_PM_KEEP_POWER);
1115 if (ret) { 1115 if (ret) {
1116 brcmf_err("Failed to set pm_flags\n"); 1116 brcmf_err("Failed to set pm_flags\n");
1117 atomic_set(&sdiodev->suspend, false);
1117 return ret; 1118 return ret;
1118 } 1119 }
1119 1120
@@ -1127,6 +1128,7 @@ static int brcmf_ops_sdio_resume(struct device *dev)
1127 struct brcmf_bus *bus_if = dev_get_drvdata(dev); 1128 struct brcmf_bus *bus_if = dev_get_drvdata(dev);
1128 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; 1129 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
1129 1130
1131 brcmf_dbg(SDIO, "Enter\n");
1130 brcmf_sdio_wd_timer(sdiodev->bus, BRCMF_WD_POLL_MS); 1132 brcmf_sdio_wd_timer(sdiodev->bus, BRCMF_WD_POLL_MS);
1131 atomic_set(&sdiodev->suspend, false); 1133 atomic_set(&sdiodev->suspend, false);
1132 return 0; 1134 return 0;