Commit Graph
3008 Commits
Author SHA1 Message Date
Lorenzo BianconiandFelix Fietkau 168713595f mt76: mt7915: rely on mt76_connac_mcu_sta_basic_tlv
Rely on mt76_connac_mcu_sta_basic_tlv routine in mt7915 and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Lorenzo BianconiandFelix Fietkau d9e9989eca mt76: mt7915: rely on mt76_connac_mcu_wtbl_generic_tlv
Rely on mt76_connac_mcu_wtbl_generic_tlv routine in mt7915 and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Lorenzo BianconiandFelix Fietkau e3ae182806 mt76: mt7915: rely on mt76_connac_mcu_sta_ba
Rely on mt76_connac_mcu_sta_ba routine in mt7915 and remove duplicated
code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Lorenzo BianconiandFelix Fietkau 4728939c1d mt76: mt7915: rely on mt76_connac_mcu_wtbl_ba_tlv
Rely on mt76_connac_mcu_wtbl_ba_tlv routine in mt7915 and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Lorenzo BianconiandFelix Fietkau bda40f4e1d mt76: mt7915: rely on mt76_connac_mcu_sta_ba_tlv
Rely on mt76_connac_mcu_sta_ba_tlv routine in mt7915 and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Lorenzo BianconiandFelix Fietkau 50956cf179 mt76: connac: move mt76_connac_mcu_bss_basic_tlv in connac module
Move mt7615_mcu_bss_basic_tlv/mt7915_mcu_bss_basic_tlv in connac
module since it is shared between mt7615 and mt7915 drivers.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Lorenzo BianconiandFelix Fietkau 829d87a93a mt76: connac: move mt76_connac_mcu_bss_ext_tlv in connac module
Move mt7915_mcu_bss_ext_tlv/mt7615_mcu_bss_ext_tlv in connac module
since it is shared between mt7615 and mt7915 drivers.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Lorenzo BianconiandFelix Fietkau 9198eca1b1 mt76: connac: move mt76_connac_mcu_bss_omac_tlv in connac module
Move mt7915_mcu_bss_omac_tlv/mt7615_mcu_bss_omac_tlv in connac module
since it is shared between mt7615 and mt7915 drivers.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Lorenzo BianconiandFelix Fietkau 31c19c4679 mt76: mt7915: remove duplicated defs in mcu.h
Remove duplicated definitions in mt7915/mcu.h

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Deren WuandFelix Fietkau af218fbe25 linux-firmware: update firmware for MT7921 WiFi device
Update binary firmware for MT7921 WiFi devices

File: firmware/WIFI_MT7961_patch_mcu_1_2_hdr.bin
Version: 20211222190839a
File: firmware/WIFI_RAM_CODE_MT7961_1.bin
Version: 20211222190917

Signed-off-by: Deren Wu <[email protected]>
2021-12-24 08:47:22 +01:00
Lorenzo BianconiandFelix Fietkau b5138e7b89 mt76: mt7921: fix a possible race enabling/disabling runtime-pm
Fix a possible race enabling/disabling runtime-pm between
mt7921_pm_set() and mt7921_poll_rx() since mt7921_pm_wake_work()
always schedules rx-napi callback and it will trigger
mt7921_pm_power_save_work routine putting chip to in low-power state
during mt7921_pm_set processing.

Suggested-by: Deren Wu <[email protected]>
Tested-by: Deren Wu <[email protected]>
Fixes: 1d8efc741df8 ("mt76: mt7921: introduce Runtime PM support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/0f3e075a2033dc05f09dab4059e5be8cbdccc239.1640094847.git.lorenzo@kernel.org
2021-12-23 11:19:47 +01:00
Bo JiaoandFelix Fietkau 7b5e69961c mt76: mt7915: fix warning: variable 'flags' set but not used
fix warning: variable 'flags' set but not used

Fixes: 0aa6b534b5e1 ("mt76: mt7915: update rx rate reporting for mt7916")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-23 11:15:29 +01:00
Bo JiaoandFelix Fietkau a77da27796 mt76: mt7915: fix warning: variable 'base' is used uninitialized
fix warning: variable 'base' is used uninitialized

Fixes: 22c2fb9495d3 ("mt76: mt7915: rework dma.c to adapt mt7916 changes")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-23 11:15:29 +01:00
Felix Fietkau 854c8d076a mt76: mt7915: move pci specific code back to pci.c
This avoids the need to check for the device type in mmio.c and makes the code
cleaner

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 23:00:52 +01:00
YN ChenandFelix Fietkau 944545855e mt76: mt7921s: update mt7921s_wfsys_reset sequence
MT7921S firmware expects driver to clear out the firmware download state
before FW is downloaded again in WiFi reset procedure.

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: YN Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 20:35:40 +01:00
Sean WangandFelix Fietkau 4669882aa5 mt76: mt7921s: clear MT76_STATE_MCU_RUNNING immediately after reset
clear the flag MT76_STATE_MCU_RUNNING immediately after reset to indicate
the MCU has already stopped working at the point. That is a preliminary
patch for the following patch to perform the register access in the
remaining reset handler using SDIO mailbox way instead of MCU command
because the RAM firmware is cleared out.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 20:35:40 +01:00
Sean WangandFelix Fietkau 22fcff5ff2 mt76: sdio: lock sdio when it is needed
Acquire the SDIO as needed as possible because either MT7663S or MT7921S
is a multiple-function device that always includes Bluetooth that would
share with the same SDIO bus. So not to avoid breaking Bluetooth pairing,
audio, and HID such kind of time critical application on that, we only
lock sdio bus when it is necessary in WiFi driver.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 20:35:40 +01:00
Lorenzo BianconiandFelix Fietkau bc254718b4 mt76: mt7915: use proper aid value in mt7915_mcu_sta_basic_tlv
Similar to mt7915_mcu_wtbl_generic_tlv, rely on vif->bss_conf.aid for
aid in sta mode and not on sta->aid.

Fixes: e57b7901469fc ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 19:57:55 +01:00
Lorenzo BianconiandFelix Fietkau 215fdcc7ca mt76: mt7915: use proper aid value in mt7915_mcu_wtbl_generic_tlv in sta mode
mac80211 provides aid in vif->bss_conf.aid for sta mode and not in
sta->aid. Fix mt7915_mcu_wtbl_generic_tlv routine using proper value for
aid in sta mode.

Fixes: e57b7901469fc ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 19:57:55 +01:00
Lorenzo BianconiandFelix Fietkau 6c48748398 mt76: make mt76_sar_capa static
Fix the following sparse warning:
drivers/net/wireless/mediatek/mt76/mac80211.c:183:32:
	warning: symbol 'mt76_sar_capa' was not declared. Should it be static?

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 19:56:45 +01:00
Bo JiaoandFelix Fietkau 2c89977b32 mt76: mt7915: fix kernel build warning
remove the unused variable 'legacy' and 'v1'.

Fixes: d2cf90e432b3 ("mt76: mt7915: update rx rate reporting for mt7916")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 19:54:57 +01:00
Bo JiaoandFelix Fietkau 9d2a01b6cb mt76: set wlan_idx_hi on mt7916
Since mt7916 supports up to 544 wcid entries, wlan_idx_hi needs to be set
in order to support wcid index >= 256

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 18:57:41 +01:00
Bo JiaoandFelix Fietkau 794b6f18d0 mt76: mt7915: fix code defect
fix code defect, variable 'val' is used without initialization
in mt7915_wfsys_reset().

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 17:14:48 +01:00
Lorenzo BianconiandFelix Fietkau 4441db30c1 mt76: connac: move mt76_connac_mcu_add_key in connac module
Move key configuration code shared between mt7921 and mt7915 in
mt76-connac module and remove duplicated code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 11:22:25 +01:00
Lorenzo BianconiandFelix Fietkau a8d0b7d0cc mt76: mt7915: rely on mt76_connac_get_phy utilities
Rely on mt76_connac_get_phy_mode and mt76_connac_get_he_phy_cap utility
routines in mt7915 driver and remove duplicated code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 11:22:25 +01:00
Lorenzo BianconiandFelix Fietkau 60dcd9f09f mt76: connac: move mt76_connac_chan_bw in common code
Move mt76_connac_chan_bw in mt76-connac code and remove
duplicated code from mt7921 and mt7915 driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 11:22:25 +01:00
Lorenzo BianconiandFelix Fietkau 9cc58e254d mt76: connac: move mt76_connac_mcu_get_cipher in common code
Move mt76_connac_mcu_get_cipher in mt76-connac code and remove
duplicated code from mt7921 and mt7915 driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 11:22:25 +01:00
Lorenzo BianconiandFelix Fietkau b44485d5c8 mt76: mt7915: rely on mt76_connac_mcu_add_tlv routine
Rely on common code available in mt76-connac module and remove
mt7915_mcu_add_tlv/mt7915_mcu_add_nested_tlv in mt7915 driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 11:22:25 +01:00
Lorenzo BianconiandFelix Fietkau bac5eda1f5 mt76: mt7915: rely on mt76_connac_mcu_alloc_wtbl_req
Rely on mt76_connac_mcu_alloc_wtbl_req routine and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 11:22:25 +01:00
Lorenzo BianconiandFelix Fietkau b3f9222666 mt76: mt7915: rely on mt76_connac_mcu_alloc_sta_req
Rely on mt76_connac_mcu_alloc_sta_req routine and remove
duplicated code.
Add MT76_CONNAC_LIB module dependency in mt7915 module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 11:22:25 +01:00
Lorenzo BianconiandFelix Fietkau 115ea27a5c mt76: connac: fix sta_rec_wtbl tag len
Similar to mt7915 driver, fix tag len error for sta_rec_wtbl, which
causes fw parsing error for the tags placed behind it.

Fixes: d0e274af2f2e4 ("mt76: mt76_connac: create mcu library")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 11:22:25 +01:00
Bo JiaoandFelix Fietkau e758feeaf1 mt76: mt7915: add device id for mt7916
Add pci_device_id to enable mt7916. Note that MT_HW_CHIPID is no
longer used for further chips, so drop it accordingly.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau fb47092220 mt76: mt7915: add mt7916 calibrated data support
Adjust proper eeprom size and add default calibrated data support
for mt7916.

Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau eb51c4deef mt76: mt7915: update mt7915_chan_mib_offs for mt7916
Update v2 offset. This is an intermediate patch to add mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau cbbb3f65fc mt76: mt7915: update rx rate reporting for mt7916
mt7916 reports rx rate from rxd group3 directly.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau 400129c69f mt76: mt7915: add txfree event v3
Update txfree v3 format.
This is an intermediate patch to add mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Reviewed-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau 0305402460 mt76: mt7915: enlarge wcid size to 544
The mt7916 can support up to 544 wcid entries.
This is an intermediate patch to add mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau 27b3253318 mt76: mt7915: rework eeprom.c to adapt mt7916 changes
This is an intermediate patch to add mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau 074d7c5381 mt76: mt7915: add firmware support for mt7916
Update firmware initialization for mt7916.
This is an intermediate patch to add mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau 6032c35f13 mt76: mt7915: rework dma.c to adapt mt7916 changes
The RXQ of mt7916 are separated to MT_RXQ_MAIN_WA and MT_RXQ_MCU_WA,
so, add initialization and preftech setting for the queue MT_RXQ_MAIN_WA.

This is an intermediate patch to add mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau de49cf43ef mt76: add MT_RXQ_MAIN_WA for mt7916
mt7916 add MT_RXQ_MAIN_WA to receive tx free event separately
This is an intermediate patch to add mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau 15f9f88b36 mt76: mt7915: refine register definition
Add mt7915_reg_desc to differentiate chip generations.
This is an intermediate patch to introduce mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Bo JiaoandFelix Fietkau 5cad38ba24 mt76: mt7915: add mt7915_mmio_probe() as a common probing function
Add mt7915_mmio_probe() which will be used for the upcoming devices.
This is an intermediate patch to add mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
Felix Fietkau 3edb87cdf1 mt7915: formatting change to sync with upstream
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:56:31 +01:00
Arnd BergmannandFelix Fietkau 9db4822643 mt76: mt7921: fix build regression
After mt7921s got added, there are two possible build problems:

a) mt7921s does not get built at all if mt7921e is not also enabled

b) there is a link error when mt7921e is a loadable module, but mt7921s
configured as built-in:

ERROR: modpost: "mt7921_mac_sta_add" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_mac_sta_assoc" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_mac_sta_remove" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_mac_write_txwi" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_mcu_drv_pmctrl" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_mcu_fill_message" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_mcu_parse_response" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_ops" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_queue_rx_skb" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!
ERROR: modpost: "mt7921_update_channel" [drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko] undefined!

Fix both by making sure that Kbuild enters the subdirectory when
either one is enabled.

Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Felix Fietkau <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2021-12-19 20:49:55 +01:00
Deren WuandFelix Fietkau 26fb105e53 mt76: mt7921s: fix cmd timeout in throughput test
During heavy loading throughtput test, the RX buffer (128)
would be exhausted and some RX pkts dropped randomly. Increase
buffer size from 128 to 512 (a safer length) to avoid tput degrade
or cmd-timeout problem.

Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-16 19:45:17 +01:00
Sean WangandFelix Fietkau 8d6c68a7d0 mt76: mt7921: fix possible resume failure [update]
Fix the possible resume failure due to mt76_connac_mcu_set_hif_suspend
timeout.

That is because clearing the flag pm->suspended too early opened up a race
window, where mt7921_poll_tx/rx scheduled a ps_work to put the device in
doze mode, that is unexpected for the device is being resumed from the
suspend state and would make the remaining MCU comamnds in resume handler
failed to execute.

Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
Co-developed-by: YN Chen <[email protected]>
Signed-off-by: YN Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-16 19:25:16 +01:00
Sean WangandFelix Fietkau 928c4550e4 mt76: mt7921s: make pm->suspended usage consistent [update]
Update pm->suspended usage to be consistent with mt7921e driver.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-16 19:17:36 +01:00
Sean WangandFelix Fietkau 19cc7d8319 mt76: mt7921: clear pm->suspended in mt7921_mac_reset_work
clear pm->suspended in mt7921_mac_reset_work to allow pm runtime
can be enabled after wifi reset in any circumstance.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-16 19:16:39 +01:00
Lorenzo BianconiandFelix Fietkau 266c7a9f29 mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv
Rely on le16_add_cpu() in mt76_connac_mcu_add_nested_tlv routine.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-15 21:24:12 +01:00