linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled
@ 2019-12-15 18:42 Dmitry Osipenko
  2019-12-18 19:09 ` Kalle Valo
       [not found] ` <20191218190920.C0B97C4479F@smtp.codeaurora.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2019-12-15 18:42 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Arend van Spriel, Franky Lin,
	Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo
  Cc: linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	linux-tegra, linux-kernel

NVIDIA Tegra SoCs do not like when OOB wake is enabled and WiFi interface
is in DOWN state during suspend. This results in a CPU hang on programming
OOB wake-up state of the GPIO controller during of system's suspend.

The solution is trivial: don't enable wake for the OOB interrupt when it
should be disabled.

This fixes hang on Tegra20 (Acer A500) and Tegra30 (Nexus 7) devices which
are using BCM4329 and BCM4330 WiFi chips respectively.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 .../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c  | 10 +++++-----
 .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.h    |  1 -
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index 96fd8e2bf773..b5088379b595 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -119,7 +119,7 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
 			brcmf_err("enable_irq_wake failed %d\n", ret);
 			return ret;
 		}
-		sdiodev->irq_wake = true;
+		disable_irq_wake(pdata->oob_irq_nr);
 
 		sdio_claim_host(sdiodev->func1);
 
@@ -178,10 +178,6 @@ void brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev *sdiodev)
 		sdio_release_host(sdiodev->func1);
 
 		sdiodev->oob_irq_requested = false;
-		if (sdiodev->irq_wake) {
-			disable_irq_wake(pdata->oob_irq_nr);
-			sdiodev->irq_wake = false;
-		}
 		free_irq(pdata->oob_irq_nr, &sdiodev->func1->dev);
 		sdiodev->irq_en = false;
 		sdiodev->oob_irq_requested = false;
@@ -1167,6 +1163,10 @@ static int brcmf_ops_sdio_resume(struct device *dev)
 		if (ret)
 			brcmf_err("Failed to probe device on resume\n");
 	} else {
+		if (sdiodev->wowl_enabled &&
+		    sdiodev->settings->bus.sdio.oob_irq_supported)
+			disable_irq_wake(sdiodev->settings->bus.sdio.oob_irq_nr);
+
 		brcmf_sdiod_freezer_off(sdiodev);
 	}
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
index 0bd47c119dae..163fd664780a 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
@@ -178,7 +178,6 @@ struct brcmf_sdio_dev {
 	bool sd_irq_requested;
 	bool irq_en;			/* irq enable flags */
 	spinlock_t irq_en_lock;
-	bool irq_wake;			/* irq wake enable flags */
 	bool sg_support;
 	uint max_request_size;
 	ushort max_segment_count;
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled
  2019-12-15 18:42 [PATCH v1] brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled Dmitry Osipenko
@ 2019-12-18 19:09 ` Kalle Valo
       [not found] ` <20191218190920.C0B97C4479F@smtp.codeaurora.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2019-12-18 19:09 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Thierry Reding, Jonathan Hunter, Arend van Spriel, Franky Lin,
	Hante Meuleman, Chi-Hsien Lin, Wright Feng, linux-wireless,
	brcm80211-dev-list.pdl, brcm80211-dev-list, linux-tegra,
	linux-kernel

Dmitry Osipenko <digetx@gmail.com> wrote:

> NVIDIA Tegra SoCs do not like when OOB wake is enabled and WiFi interface
> is in DOWN state during suspend. This results in a CPU hang on programming
> OOB wake-up state of the GPIO controller during of system's suspend.
> 
> The solution is trivial: don't enable wake for the OOB interrupt when it
> should be disabled.
> 
> This fixes hang on Tegra20 (Acer A500) and Tegra30 (Nexus 7) devices which
> are using BCM4329 and BCM4330 WiFi chips respectively.
> 
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>

Patch applied to wireless-drivers-next.git, thanks.

a32de68edab7 brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled

-- 
https://patchwork.kernel.org/patch/11293127/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled
       [not found] ` <20191218190920.C0B97C4479F@smtp.codeaurora.org>
@ 2019-12-18 19:11   ` Dmitry Osipenko
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2019-12-18 19:11 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Thierry Reding, Jonathan Hunter, Arend van Spriel, Franky Lin,
	Hante Meuleman, Chi-Hsien Lin, Wright Feng, linux-wireless,
	brcm80211-dev-list.pdl, brcm80211-dev-list, linux-tegra,
	linux-kernel

18.12.2019 22:09, Kalle Valo пишет:
> Dmitry Osipenko <digetx@gmail.com> wrote:
> 
>> NVIDIA Tegra SoCs do not like when OOB wake is enabled and WiFi interface
>> is in DOWN state during suspend. This results in a CPU hang on programming
>> OOB wake-up state of the GPIO controller during of system's suspend.
>>
>> The solution is trivial: don't enable wake for the OOB interrupt when it
>> should be disabled.
>>
>> This fixes hang on Tegra20 (Acer A500) and Tegra30 (Nexus 7) devices which
>> are using BCM4329 and BCM4330 WiFi chips respectively.
>>
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> 
> Patch applied to wireless-drivers-next.git, thanks.
> 
> a32de68edab7 brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled
> 

Thank you very much!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-18 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-15 18:42 [PATCH v1] brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled Dmitry Osipenko
2019-12-18 19:09 ` Kalle Valo
     [not found] ` <20191218190920.C0B97C4479F@smtp.codeaurora.org>
2019-12-18 19:11   ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).