linux/drivers/net/wireless
Quan Zhou 525c469e5d wifi: mt76: mt7921e: fix init command fail with enabled device
For some cases as below, we may encounter the unpreditable chip stats
in driver probe()
* The system reboot flow do not work properly, such as kernel oops while
  rebooting, and then the driver do not go back to default status at
  this moment.
* Similar to the flow above. If the device was enabled in BIOS or UEFI,
  the system may switch to Linux without driver fully shutdown.

To avoid the problem, force push the device back to default in probe()
* mt7921e_mcu_fw_pmctrl() : return control privilege to chip side.
* mt7921_wfsys_reset()    : cleanup chip config before resource init.

Error log
[59007.600714] mt7921e 0000:02:00.0: ASIC revision: 79220010
[59010.889773] mt7921e 0000:02:00.0: Message 00000010 (seq 1) timeout
[59010.889786] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59014.217839] mt7921e 0000:02:00.0: Message 00000010 (seq 2) timeout
[59014.217852] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59017.545880] mt7921e 0000:02:00.0: Message 00000010 (seq 3) timeout
[59017.545893] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59020.874086] mt7921e 0000:02:00.0: Message 00000010 (seq 4) timeout
[59020.874099] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59024.202019] mt7921e 0000:02:00.0: Message 00000010 (seq 5) timeout
[59024.202033] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59027.530082] mt7921e 0000:02:00.0: Message 00000010 (seq 6) timeout
[59027.530096] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59030.857888] mt7921e 0000:02:00.0: Message 00000010 (seq 7) timeout
[59030.857904] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59034.185946] mt7921e 0000:02:00.0: Message 00000010 (seq 8) timeout
[59034.185961] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59037.514249] mt7921e 0000:02:00.0: Message 00000010 (seq 9) timeout
[59037.514262] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59040.842362] mt7921e 0000:02:00.0: Message 00000010 (seq 10) timeout
[59040.842375] mt7921e 0000:02:00.0: Failed to get patch semaphore
[59040.923845] mt7921e 0000:02:00.0: hardware init failed

Cc: stable@vger.kernel.org
Fixes: 5c14a5f944 ("mt76: mt7921: introduce mt7921e support")
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Juan Martinez <juan.martinez@amd.com>
Co-developed-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Message-ID: <39fcb7cee08d4ab940d38d82f21897483212483f.1688569385.git.deren.wu@mediatek.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-07-06 19:10:41 -07:00
..
admtek
ath Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
atmel wifi: atmel: Fix an error handling path in atmel_probe() 2023-05-25 19:16:15 +03:00
broadcom wifi: brcmsmac: fix gnu_printf warnings 2023-06-16 12:24:15 +03:00
cisco wifi: airo: remove ISA_DMA_API dependency 2023-04-20 15:38:27 +03:00
intel Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
intersil wifi: p54: Add missing MODULE_FIRMWARE macro 2023-06-21 12:53:30 +03:00
legacy wifi: ray_cs: fix stringop-truncation GCC warning 2023-06-16 12:24:16 +03:00
marvell Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
mediatek wifi: mt76: mt7921e: fix init command fail with enabled device 2023-07-06 19:10:41 -07:00
microchip wifi: wilc1000: Increase ASSOC response buffer 2023-05-11 15:53:44 +03:00
purelifi
quantenna
ralink wifi: rt2x00: fix the typo in comments 2023-06-15 10:46:08 +03:00
realtek wifi: rtlwifi: cleanup USB interface 2023-06-21 21:31:10 +03:00
rsi wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown 2023-06-08 19:02:14 +03:00
silabs spi: Updates for v6.4 2023-04-27 11:02:26 -07:00
st
ti
virtual wifi: mac80211_hwsim: Don't access vif valid links directly 2023-06-14 12:20:08 +02:00
zydas
Kconfig
Makefile