Skip to contentSkip to conversation

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

PATCH In review Dmitry Osipenko 2 participants 3 messages Dec 15, 2019 – Dec 18, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled

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.

---
 .../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c  | 10 +++++-----
 .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.h    |  1 -
 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +5 -5
index 96fd8e2bf773..b5088379b595 100644
@@ -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);
 	}
 
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +0 -1
index 0bd47c119dae..163fd664780a 100644
@@ -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;
Signature · 1 line
2.24.0
#1 lore raw
Quoted 11 lines · Dmitry Osipenko

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.

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

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

Signature · 3 lines
https://patchwork.kernel.org/patch/11293127/

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

18.12.2019 22:09, Kalle Valo пишет:

Quoted 9 lines
Quoted 7 lines · Dmitry Osipenko

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.

Quoted 9 lines
Quoted 4 lines

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

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!