linux-stable/drivers/net/wireless
Hans de Goede 5ef2db5889 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 17:02:37 +02:00
..
admtek wifi: mac80211: add wake_tx_queue callback to drivers 2022-10-10 11:00:03 +02:00
ath wifi: ath11k: allow system suspend to survive ath11k 2023-03-10 09:29:43 +01:00
atmel wifi: atmel: Fix atmel_private_handler array size 2022-11-01 12:30:22 +02:00
broadcom wifi: brcmfmac: Fix SDIO suspend/resume regression 2023-04-13 17:02:37 +02:00
cisco wireless-next patches for v6.2 2022-11-18 11:44:36 +00:00
intel wifi: iwl4965: Add missing check for create_singlethread_workqueue() 2023-03-10 09:28:19 +01:00
intersil wifi: orinoco: check return value of hermes_write_wordrec() 2023-03-10 09:28:08 +01:00
marvell wifi: mwifiex: fix loop iterator in mwifiex_update_ampdu_txwinsize() 2023-03-10 09:28:20 +01:00
mediatek wifi: mt76: connac: do not check WED status for non-mmio devices 2023-03-30 12:50:50 +02:00
microchip wifi: wilc1000: add missing unregister_netdev() in wilc_netdev_ifc_init() 2023-03-10 09:28:02 +01:00
purelifi wifi: plfxlc: fix potential memory leak in __lf_x_usb_enable_rx() 2022-11-28 15:56:17 +02:00
quantenna treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
ralink Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-10 17:43:53 -08:00
realtek wifi: rtl8xxxu: Use a longer retry limit of 48 2023-03-10 09:29:43 +01:00
rsi wifi: rsi: Fix memory leak in rsi_coex_attach() 2023-03-10 09:28:00 +01:00
silabs wifi: mac80211: add wake_tx_queue callback to drivers 2022-10-10 11:00:03 +02:00
st wireless-next patches for v6.2 2022-10-28 18:31:40 -07:00
ti wifi: ti: remove obsolete lines in the Makefile 2022-12-14 14:33:05 +02:00
zydas wifi: zd1201: Avoid clashing function prototypes 2022-11-16 11:31:47 +02:00
Kconfig
mac80211_hwsim.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-10 17:43:53 -08:00
mac80211_hwsim.h
Makefile
ray_cs.c
ray_cs.h
rayctl.h
rndis_wlan.c wifi: rndis_wlan: Prevent buffer overflow in rndis_query_oid 2023-01-16 13:27:54 +02: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:28:03 +01:00