linux/drivers/net/wireless
Ping-Ke Shih 4a267bc5ea wifi: rtw88: use RTW_FLAG_POWERON flag to prevent to power on/off twice
Use power state to decide whether we can enter or leave IPS accurately,
and then prevent to power on/off twice.

The commit 6bf3a08340 ("wifi: rtw88: add flag check before enter or leave IPS")
would like to prevent this as well, but it still can't entirely handle all
cases. The exception is that WiFi gets connected and does suspend/resume,
it will power on twice and cause it failed to power on after resuming,
like:

  rtw_8723de 0000:03:00.0: failed to poll offset=0x6 mask=0x2 value=0x2
  rtw_8723de 0000:03:00.0: mac power on failed
  rtw_8723de 0000:03:00.0: failed to power on mac
  rtw_8723de 0000:03:00.0: leave idle state failed
  rtw_8723de 0000:03:00.0: failed to leave ips state
  rtw_8723de 0000:03:00.0: failed to leave idle state
  rtw_8723de 0000:03:00.0: failed to send h2c command

To fix this, introduce new flag RTW_FLAG_POWERON to reflect power state,
and call rtw_mac_pre_system_cfg() to configure registers properly between
power-off/-on.

Reported-by: Paul Gover <pmw.gover@yahoo.co.uk>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217016
Fixes: 6bf3a08340 ("wifi: rtw88: add flag check before enter or leave IPS")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230216053633.20366-1-pkshih@realtek.com
2023-02-17 11:33:13 +02:00
..
admtek wifi: mac80211: add wake_tx_queue callback to drivers 2022-10-10 11:00:03 +02:00
ath wifi: cfg80211: include puncturing bitmap in channel switch events 2023-02-14 12:14:39 +01:00
atmel wifi: atmel: Fix atmel_private_handler array size 2022-11-01 12:30:22 +02:00
broadcom wifi: brcmfmac: p2p: Introduce generic flexible array frame member 2023-02-16 09:33:25 +01: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-02-13 17:17:27 +02:00
intersil net: add missing includes of linux/net.h 2023-01-27 11:19:45 +00:00
marvell wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces 2023-02-14 12:34:51 +01:00
mediatek wifi: mt76: support ww power config in dts node 2023-02-03 14:51:37 +01:00
microchip Merge wireless into wireless-next 2023-01-17 13:36:25 +02:00
purelifi wifi: plfxlc: fix potential memory leak in __lf_x_usb_enable_rx() 2022-11-28 15:56:17 +02:00
quantenna wifi: cfg80211: include puncturing bitmap in channel switch events 2023-02-14 12:14:39 +01:00
ralink wifi: rt2x00: Remove useless else if 2023-01-16 18:23:49 +02:00
realtek wifi: rtw88: use RTW_FLAG_POWERON flag to prevent to power on/off twice 2023-02-17 11:33:13 +02:00
rsi wifi: rsi: Avoid defines prefixed with CONFIG 2023-02-13 19:24:10 +02: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: wl1251: Fix a typo ("boradcast") 2023-02-13 17:14:41 +02:00
zydas wifi: zd1211rw: remove redundant decls 2023-02-13 19:25:47 +02:00
Kconfig
mac80211_hwsim.c wifi: mac80211_hwsim: Rename pid to portid to avoid confusion 2023-02-14 12:09:18 +01: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_cs.c wifi: wl3501_cs: don't call kfree_skb() under spin_lock_irqsave() 2022-12-22 18:14:33 +02:00
wl3501.h