mirror-linux/drivers/net/wireless
Hans de Goede 0d2a6a508b wifi: brcmfmac: Fix SDIO suspend/resume regression
[ Upstream commit e4efa515d5 ]

After commit 92cadedd9d ("brcmfmac: Avoid keeping power to SDIO card
unless WOWL is used"), the wifi adapter by default is turned off on suspend
and then re-probed on resume.

In at least 2 model x86/acpi tablets with brcmfmac43430a1 wifi adapters,
the newly added re-probe on resume fails like this:

 brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
 ieee80211 phy1: brcmf_bus_started: failed: -110
 ieee80211 phy1: brcmf_attach: dongle is not responding: err=-110
 brcmfmac: brcmf_sdio_firmware_callback: brcmf_attach failed

It seems this specific brcmfmac model does not like being reprobed without
it actually being turned off first.

And the adapter is not being turned off during suspend because of
commit f0992ace68 ("brcmfmac: prohibit ACPI power management for brcmfmac
driver").

Now that the driver is being reprobed on resume, the disabling of ACPI
pm is no longer necessary, except when WOWL is used (in which case there
is no-reprobe).

Move the dis-/en-abling of ACPI pm to brcmf_sdio_wowl_config(), this fixes
the brcmfmac43430a1 suspend/resume regression and should help save some
power when suspended.

This change means that the code now also may re-enable ACPI pm when WOWL
gets disabled. ACPI pm should only be re-enabled if it was enabled by
the ACPI core originally. Add a brcmf_sdiod_acpi_save_power_manageable()
to save the original state for this.

This has been tested on the following devices:

Asus T100TA                brcmfmac43241b4-sdio
Acer Iconia One 7 B1-750   brcmfmac43340-sdio
Chuwi Hi8                  brcmfmac43430a0-sdio
Chuwi Hi8                  brcmfmac43430a1-sdio

(the Asus T100TA is the device for which the prohibiting of ACPI pm
 was originally added)

Fixes: 92cadedd9d ("brcmfmac: Avoid keeping power to SDIO card unless WOWL is used")
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230320122252.240070-1-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-13 16:55:20 +02:00
..
admtek
ath wifi: ath11k: allow system suspend to survive ath11k 2023-03-10 09:34:22 +01:00
atmel
broadcom wifi: brcmfmac: Fix SDIO suspend/resume regression 2023-04-13 16:55:20 +02:00
cisco wifi: airo: do not assign -1 to unsigned char 2022-11-01 11:15:15 +02:00
intel wifi: iwl4965: Add missing check for create_singlethread_workqueue() 2023-03-10 09:33:03 +01:00
intersil wifi: orinoco: check return value of hermes_write_wordrec() 2023-03-10 09:32:54 +01:00
marvell wifi: mwifiex: fix loop iterator in mwifiex_update_ampdu_txwinsize() 2023-03-10 09:33:03 +01:00
mediatek wifi: mt76: dma: free rx_head in mt76_dma_rx_cleanup 2023-03-10 09:33:51 +01:00
microchip wifi: wilc1000: add missing unregister_netdev() in wilc_netdev_ifc_init() 2023-03-10 09:32:50 +01:00
purelifi wifi: plfxlc: fix potential memory leak in __lf_x_usb_enable_rx() 2022-12-31 13:32:18 +01:00
quantenna treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
ralink wifi: rt2x00: use explicitly signed or unsigned types 2022-10-21 09:59:39 +03:00
realtek wifi: rtl8xxxu: Use a longer retry limit of 48 2023-03-10 09:34:22 +01:00
rsi wifi: rsi: Fix memory leak in rsi_coex_attach() 2023-03-10 09:32:48 +01:00
silabs
st treewide: use get_random_{u8,u16}() when possible, part 1 2022-10-11 17:42:58 -06:00
ti treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
zydas
Kconfig
Makefile
mac80211_hwsim.c wifi: mac80211_hwsim: fix debugfs attribute ps with rc table support 2022-10-21 12:37:28 +02:00
mac80211_hwsim.h
ray_cs.c
ray_cs.h
rayctl.h
rndis_wlan.c wifi: rndis_wlan: Prevent buffer overflow in rndis_query_oid 2023-02-01 08:34:18 +01:00
virt_wifi.c
wl3501.h
wl3501_cs.c wifi: wl3501_cs: don't call kfree_skb() under spin_lock_irqsave() 2023-03-10 09:32:51 +01:00