Skip to contentSkip to conversation

brcmfmac: keep WiFi chip's power during system suspension

PATCH Superseded Fu, Zhonghui 2 participants 3 messages Apr 27, 2015 – May 1, 2015

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 brcmfmac: keep WiFi chip's power during system suspension

Need to keep the power supply for WiFi chip during system suspension. Otherwise, the context of WiFi chip will be lost.

---
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +6 -4
index fdf8feb..03d3671 100644
@@ -1251,15 +1251,17 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
 	brcmf_sdiod_freezer_on(sdiodev);
 	brcmf_sdio_wd_timer(sdiodev->bus, 0);
 
+	sdio_flags = MMC_PM_KEEP_POWER;
 	if (sdiodev->wowl_enabled) {
-		sdio_flags = MMC_PM_KEEP_POWER;
 		if (sdiodev->pdata->oob_irq_supported)
 			enable_irq_wake(sdiodev->pdata->oob_irq_nr);
 		else
-			sdio_flags = MMC_PM_WAKE_SDIO_IRQ;
-		if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags))
-			brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
+			sdio_flags |= MMC_PM_WAKE_SDIO_IRQ;
 	}
+
+	if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags))
+		brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
+
 	return 0;
 }
 

-- 1.7.1

#1 lore raw
Quoted 2 lines · Zhonghui

Need to keep the power supply for WiFi chip during system suspension. Otherwise, the context of WiFi chip will be lost.

I already submitted a patch doing exactly the same thing [1]

Regards,
Arend

[1] https://patchwork.kernel.org/patch/6217391/

Quoted 33 lines
---
  drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |   10 ++++++----
  1 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +6 -5
index fdf8feb..03d3671 100644
@@ -1251,15 +1251,17 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
  	brcmf_sdiod_freezer_on(sdiodev);
  	brcmf_sdio_wd_timer(sdiodev->bus, 0);
 
+	sdio_flags = MMC_PM_KEEP_POWER;
  	if (sdiodev->wowl_enabled) {
-		sdio_flags = MMC_PM_KEEP_POWER;
  		if (sdiodev->pdata->oob_irq_supported)
  			enable_irq_wake(sdiodev->pdata->oob_irq_nr);
  		else
-			sdio_flags = MMC_PM_WAKE_SDIO_IRQ;
-		if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags))
-			brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
+			sdio_flags |= MMC_PM_WAKE_SDIO_IRQ;
  	}
+
+	if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags))
+		brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
+
  	return 0;
  }
 
-- 1.7.1
#2 lore raw
Quoted 5 lines · Arend van Spriel
Quoted 2 lines · Zhonghui

Need to keep the power supply for WiFi chip during system suspension. Otherwise, the context of WiFi chip will be lost.

I already submitted a patch doing exactly the same thing [1]

OK, please ignore this patch.

What's the target kernel version of your patch?

Thanks,
Zhonghui

Quoted 40 lines

Regards,
Arend

[1] https://patchwork.kernel.org/patch/6217391/

Quoted 33 lines
---
  drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |   10 ++++++----
  1 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +6 -5
index fdf8feb..03d3671 100644
@@ -1251,15 +1251,17 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
      brcmf_sdiod_freezer_on(sdiodev);
      brcmf_sdio_wd_timer(sdiodev->bus, 0);
 
+    sdio_flags = MMC_PM_KEEP_POWER;
      if (sdiodev->wowl_enabled) {
-        sdio_flags = MMC_PM_KEEP_POWER;
          if (sdiodev->pdata->oob_irq_supported)
              enable_irq_wake(sdiodev->pdata->oob_irq_nr);
          else
-            sdio_flags = MMC_PM_WAKE_SDIO_IRQ;
-        if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags))
-            brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
+            sdio_flags |= MMC_PM_WAKE_SDIO_IRQ;
      }
+
+    if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags))
+        brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
+
      return 0;
  }
 
-- 1.7.1