linux/drivers/net/wireless/realtek/rtw88
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
..
bf.c wifi: rtw88: Move register access from rtw_bf_assoc() outside the RCU 2023-01-16 18:27:43 +02:00
bf.h rtw88: don't check CRC of VHT-SIG-B in 802.11ac signal 2021-12-20 20:49:02 +02:00
coex.c wifi: rtw88: use RTW_FLAG_POWERON flag to prevent to power on/off twice 2023-02-17 11:33:13 +02:00
coex.h wifi: rtw88: access chip_info by const pointer 2022-08-09 08:48:59 +03:00
debug.c wifi: rtw88: Drop coex mutex 2022-12-08 16:48:41 +02:00
debug.h rtw88: change rtw_info() to proper message level 2022-02-22 17:31:13 +02:00
efuse.c wifi: rtw88: access chip_info by const pointer 2022-08-09 08:48:59 +03:00
efuse.h
fw.c wifi: rtw88: Drop h2c.lock 2022-12-08 16:48:41 +02:00
fw.h wifi: rtw88: 8821c: enable BT device recovery mechanism 2022-12-01 13:03:27 +02:00
hci.h wifi: rtw88: Drop rf_lock 2022-12-08 16:48:40 +02:00
Kconfig wifi: rtw88: Add rtw8723du chipset support 2022-12-08 16:48:42 +02:00
mac80211.c wifi: rtw88: Use non-atomic sta iterator in rtw_ra_mask_info_update() 2023-01-16 18:27:44 +02:00
mac.c wifi: rtw88: use RTW_FLAG_POWERON flag to prevent to power on/off twice 2023-02-17 11:33:13 +02:00
mac.h
main.c wifi: rtw88: Use rtw_iterate_vifs() for rtw_vif_watch_dog_iter() 2023-01-16 18:27:43 +02:00
main.h wifi: rtw88: use RTW_FLAG_POWERON flag to prevent to power on/off twice 2023-02-17 11:33:13 +02:00
Makefile wifi: rtw88: Add rtw8723du chipset support 2022-12-08 16:48:42 +02:00
pci.c wifi: rtw88: Move enum rtw_tx_queue_type mapping code to tx.{c,h} 2023-02-13 17:15:46 +02:00
pci.h rtw88: Disable PCIe ASPM while doing NAPI poll on 8821CE 2021-12-20 20:48:10 +02:00
phy.c wifi: rtw88: iterate over vif/sta list non-atomically 2022-12-08 16:48:41 +02:00
phy.h wifi: rtw88: access chip_info by const pointer 2022-08-09 08:48:59 +03:00
ps.c wifi: rtw88: use RTW_FLAG_POWERON flag to prevent to power on/off twice 2023-02-17 11:33:13 +02:00
ps.h rtw88: don't consider deep PS mode when transmitting packet 2021-12-22 19:48:50 +02:00
reg.h wifi: rtw88: Add common USB chip support 2022-12-08 16:48:41 +02:00
regd.c wifi: rtw88: add mutex when set regulatory and get Tx power table 2022-08-10 08:48:46 +03:00
regd.h rtw88: add regulatory strategy by chip type 2021-09-21 17:51:56 +03:00
rtw8723d_table.c
rtw8723d_table.h
rtw8723d.c wifi: rtw88: Add rtw8723du chipset support 2022-12-08 16:48:42 +02:00
rtw8723d.h wifi: rtw88: Add rtw8723du chipset support 2022-12-08 16:48:42 +02:00
rtw8723de.c wifi: rtw88: Fix Sparse warning for rtw8723d_hw_spec 2022-05-30 14:06:27 +03:00
rtw8723du.c wifi: rtw88: Add rtw8723du chipset support 2022-12-08 16:48:42 +02:00
rtw8821c_table.c rtw88: 8821c: Enable TX report for management frames 2022-04-12 16:52:05 +03:00
rtw8821c_table.h
rtw8821c.c wifi: rtw88: Add rtw8821cu chipset support 2022-12-08 16:48:42 +02:00
rtw8821c.h wifi: rtw88: Add rtw8821cu chipset support 2022-12-08 16:48:42 +02:00
rtw8821ce.c wifi: rtw88: Fix Sparse warning for rtw8821c_hw_spec 2022-05-30 14:06:27 +03:00
rtw8821cu.c wifi: rtw88: Add rtw8821cu chipset support 2022-12-08 16:48:42 +02:00
rtw8822b_table.c
rtw8822b_table.h
rtw8822b.c wifi: rtw88: Add rtw8822bu chipset support 2022-12-08 16:48:42 +02:00
rtw8822b.h wifi: rtw88: Fix sparse warning for rtw8822b_hw_spec 2022-05-30 14:06:26 +03:00
rtw8822be.c wifi: rtw88: Fix sparse warning for rtw8822b_hw_spec 2022-05-30 14:06:26 +03:00
rtw8822bu.c wifi: rtw88: Add rtw8822bu chipset support 2022-12-08 16:48:42 +02:00
rtw8822c_table.c rtw88: 8822c: update RF parameter tables to v62 2021-06-22 18:19:26 +03:00
rtw8822c_table.h
rtw8822c.c wifi: rtw88: Add rtw8822cu chipset support 2022-12-08 16:48:42 +02:00
rtw8822c.h wifi: rtw88: Fix Sparse warning for rtw8822c_hw_spec 2022-05-30 14:06:27 +03:00
rtw8822ce.c wifi: rtw88: Fix Sparse warning for rtw8822c_hw_spec 2022-05-30 14:06:27 +03:00
rtw8822cu.c wifi: rtw88: Add rtw8822cu chipset support 2022-12-08 16:48:42 +02:00
rx.c rtw88: fix incorrect frequency reported 2022-04-12 16:52:05 +03:00
rx.h
sar.c rtw88: change rtw_info() to proper message level 2022-02-22 17:31:13 +02:00
sar.h rtw88: support SAR via kernel common API 2021-12-21 20:22:38 +02:00
sec.c
sec.h
tx.c wifi: rtw88: Move enum rtw_tx_queue_type mapping code to tx.{c,h} 2023-02-13 17:15:46 +02:00
tx.h wifi: rtw88: Move enum rtw_tx_queue_type mapping code to tx.{c,h} 2023-02-13 17:15:46 +02:00
usb.c wifi: rtw88: usb: drop now unnecessary URB size check 2023-02-15 09:50:21 +02:00
usb.h wifi: rtw88: Add common USB chip support 2022-12-08 16:48:41 +02:00
util.c wifi: rtw88: iterate over vif/sta list non-atomically 2022-12-08 16:48:41 +02:00
util.h wifi: rtw88: iterate over vif/sta list non-atomically 2022-12-08 16:48:41 +02:00
wow.c wifi: rtw88: use RTW_FLAG_POWERON flag to prevent to power on/off twice 2023-02-17 11:33:13 +02:00
wow.h