brcmfmac: avoid duplicated suspend/resume operation
Subsystems (3)
PATCH 1/1 brcmfmac: avoid duplicated suspend/resume operation
Quoted 1 line
From
8685c3c2746b4275fc808d9db23c364b2f54b52aMon Sep 17 00:00:00 2001
From: Zhonghui Fu <[email protected]>
Date: Mon, 12 Jan 2015 14:25:46 +0800
Subject: [PATCH] brcmfmac: avoid duplicated suspend/resume operation
WiFi chip has 2 SDIO functions, and PM core will trigger twice suspend/resume operations for one WiFi chip to do the same things. This patch avoid this case.
--- drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +17 -4
@@ -1070,7 +1070,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,*/ if ((sdio_get_host_pm_caps (sdiodev->func[1 ]) &MMC_PM_KEEP_POWER ) && ((sdio_get_host_pm_caps (sdiodev->func[1 ]) &MMC_PM_WAKE_SDIO_IRQ ) || - (sdiodev->pdata && sdiodev->pdata->oob_irq_supported))) + (sdiodev->pdata->oob_irq_supported))) bus_if->wowl_supported = true;#endif
@@ -1139,11 +1139,17 @@ void brcmf_sdio_wowl_config(struct device *dev, bool enabled)static int brcmf_ops_sdio_suspend (struct device *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;mmc_pm_flag_t sdio_flags; +struct sdio_func *func =dev_to_sdio_func (dev);brcmf_dbg (SDIO ,"Enter\n" ); +if (func->num ==2 ) +return 0 ; + + sdiodev = bus_if->bus_priv.sdio; +atomic_set (&sdiodev->suspend, true);if (sdiodev->wowl_enabled) {
@@ -1164,10 +1170,17 @@ static int brcmf_ops_sdio_suspend(struct device *dev)static int brcmf_ops_sdio_resume (struct device *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; +struct sdio_func *func =dev_to_sdio_func (dev);brcmf_dbg (SDIO ,"Enter\n" ); -if (sdiodev->pdata && sdiodev->pdata->oob_irq_supported) + +if (func->num ==2 ) +return 0 ; + + sdiodev = bus_if->bus_priv.sdio; + +if (sdiodev->pdata->oob_irq_supported)disable_irq_wake (sdiodev->pdata->oob_irq_nr);brcmf_sdio_wd_timer (sdiodev->bus,BRCMF_WD_POLL_MS );atomic_set (&sdiodev->suspend, false);
-- 1.7.1
Quoted 5 lines · Zhonghui
From
8685c3c2746b4275fc808d9db23c364b2f54b52aMon Sep 17 00:00:00 2001
From: Zhonghui Fu<[email protected]>
Date: Mon, 12 Jan 2015 14:25:46 +0800
Subject: [PATCH] brcmfmac: avoid duplicated suspend/resume operation
Quoted 7 lines
WiFi chip has 2 SDIO functions, and PM core will trigger twice suspend/resume operations for one WiFi chip to do the same things. This patch avoid this case.
Acked-by Arend van Spriel<[email protected]>Acked-by Sergei Shtylyov<[email protected]>Signed-off-by Zhonghui Fu<[email protected]>
This patch needs to be rebased.
Kalle,
Please drop this one.
Regards,
Arend
Quoted 58 lines
--- drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-)drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +17
-5@@ -1070,7 +1070,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,*/ if ((sdio_get_host_pm_caps (sdiodev->func[1 ])&MMC_PM_KEEP_POWER )&& ((sdio_get_host_pm_caps (sdiodev->func[1 ])&MMC_PM_WAKE_SDIO_IRQ ) || - (sdiodev->pdata&& sdiodev->pdata->oob_irq_supported))) + (sdiodev->pdata->oob_irq_supported))) bus_if->wowl_supported = true;#endif @@ -1139,11 +1139,17 @@ void brcmf_sdio_wowl_config(struct device *dev, bool enabled)static int brcmf_ops_sdio_suspend (struct device *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;mmc_pm_flag_t sdio_flags; +struct sdio_func *func =dev_to_sdio_func (dev);brcmf_dbg (SDIO ,"Enter\n" ); +if (func->num ==2 ) +return 0 ; + + sdiodev = bus_if->bus_priv.sdio; +atomic_set (&sdiodev->suspend, true);if (sdiodev->wowl_enabled) {@@ -1164,10 +1170,17 @@ static int brcmf_ops_sdio_suspend(struct device *dev)static int brcmf_ops_sdio_resume (struct device *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; +struct sdio_func *func =dev_to_sdio_func (dev);brcmf_dbg (SDIO ,"Enter\n" ); -if (sdiodev->pdata&& sdiodev->pdata->oob_irq_supported) + +if (func->num ==2 ) +return 0 ; + + sdiodev = bus_if->bus_priv.sdio; + +if (sdiodev->pdata->oob_irq_supported)disable_irq_wake (sdiodev->pdata->oob_irq_nr);brcmf_sdio_wd_timer (sdiodev->bus,BRCMF_WD_POLL_MS );atomic_set (&sdiodev->suspend, false); -- 1.7.1
Quoted 14 lines · Arend van Spriel
Quoted 5 lines · Zhonghui
From
8685c3c2746b4275fc808d9db23c364b2f54b52aMon Sep 17 00:00:00 2001
From: Zhonghui Fu<zhonghui.fu-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Mon, 12 Jan 2015 14:25:46 +0800
Subject: [PATCH] brcmfmac: avoid duplicated suspend/resume operationQuoted 7 lines
WiFi chip has 2 SDIO functions, and PM core will trigger twice suspend/resume operations for one WiFi chip to do the same things. This patch avoid this case.
Quoted 5 lines
This patch needs to be rebased.
Kalle,
Please drop this one.
Ok, dropped. I'll wait for the rebase.
Signature · 5 lines
Kalle Valo -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 15 lines · Kalle Valo
Quoted 13 lines · Arend van Spriel
Quoted 12 lines · Zhonghui
From
8685c3c2746b4275fc808d9db23c364b2f54b52aMon Sep 17 00:00:00 2001
From: Zhonghui Fu<[email protected]>
Date: Mon, 12 Jan 2015 14:25:46 +0800
Subject: [PATCH] brcmfmac: avoid duplicated suspend/resume operationWiFi chip has 2 SDIO functions, and PM core will trigger twice suspend/resume operations for one WiFi chip to do the same things. This patch avoid this case.
Acked-by Arend van Spriel<[email protected]>Acked-by Sergei Shtylyov<[email protected]>Signed-off-by Zhonghui Fu<[email protected]>
Quoted 6 lines
Quoted 5 lines
This patch needs to be rebased.
Kalle,
Please drop this one.
Ok, dropped. I'll wait for the rebase.
I have re-based this patch and sent it in another mail with the same subject.
Thanks,
Zhonghui
Quoted 1 line
Hello.
Quoted 4 lines · Zhonghui
From
8685c3c2746b4275fc808d9db23c364b2f54b52aMon Sep 17 00:00:00 2001
From: Zhonghui Fu <[email protected]>
Date: Mon, 12 Jan 2015 14:25:46 +0800
Subject: [PATCH] brcmfmac: avoid duplicated suspend/resume operation
The lines above are not needed.
Quoted 16 lines
WiFi chip has 2 SDIO functions, and PM core will trigger twice suspend/resume operations for one WiFi chip to do the same things. This patch avoid this case.
Acked-by Arend van Spriel<[email protected]>Acked-by Sergei Shtylyov<[email protected]>Signed-off-by Zhonghui Fu <[email protected]>--- drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-)drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +0
-0
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c static int brcmf_ops_sdio_probe(struct sdio_func *func, · line 1073
Quoted 5 lines
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +1
-1@@ -1070,7 +1070,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,*/ if ((sdio_get_host_pm_caps (sdiodev->func[1 ]) &MMC_PM_KEEP_POWER ) && ((sdio_get_host_pm_caps (sdiodev->func[1 ]) &MMC_PM_WAKE_SDIO_IRQ ) || - (sdiodev->pdata && sdiodev->pdata->oob_irq_supported))) + (sdiodev->pdata->oob_irq_supported)))
Inner parens not needed on this line.
[...]
WBR, Sergei
Quoted 23 lines · Sergei Shtylyov
Hello.
Quoted 4 lines · Zhonghui
From
8685c3c2746b4275fc808d9db23c364b2f54b52aMon Sep 17 00:00:00 2001
From: Zhonghui Fu <[email protected]>
Date: Mon, 12 Jan 2015 14:25:46 +0800
Subject: [PATCH] brcmfmac: avoid duplicated suspend/resume operationThe lines above are not needed.
Quoted 11 lines
WiFi chip has 2 SDIO functions, and PM core will trigger twice suspend/resume operations for one WiFi chip to do the same things. This patch avoid this case.
Acked-by Arend van Spriel<[email protected]>Acked-by Sergei Shtylyov<[email protected]>Signed-off-by Zhonghui Fu <[email protected]>---
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c| 21
+++++++++++++++++----1 files changed, 17 insertions(+), 4 deletions(-)
Quoted 14 lines
Quoted 8 lines
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +0
-0@@ -1070,7 +1070,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func*func, */ Quoted 4 lines
if ((
sdio_get_host_pm_caps(sdiodev->func[1])&MMC_PM_KEEP_POWER) && ((sdio_get_host_pm_caps(sdiodev->func[1])&MMC_PM_WAKE_SDIO_IRQ) ||
- (sdiodev->pdata&&sdiodev->pdata->oob_irq_supported)))
+ (sdiodev->pdata->oob_irq_supported)))Inner parens not needed on this line.
Well, actually this patch should not affect those line as it would reintroduce a recently fixed issue.
Regards,
Arend
Quoted 4 lines
[...]
WBR, Sergei