- 15 Sep, 2022 33 commits
-
-
Ming Yen Hsieh authored
Country Location Control (CLC) is an additional control for country rules in firmware. We introduce this new feature to make sure mt7921 series working properly in all region. The addtional policies would be put into firmware based on differnt regions. mt76 driver should be in charge of submitting per region policy. Reviewed-by: Sean Wang <sean.wang@mediatek.com> Tested-by: YN Chen <YN.Chen@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Deren Wu authored
In insmod/rmmod stress test, the following crash dump shows up immediately. The problem is caused by missing mt76_dev in mt7921_pci_remove(). We should make sure the drvdata is ready before probe() finished. [168.862789] ================================================================== [168.862797] BUG: KASAN: user-memory-access in try_to_grab_pending+0x59/0x480 [168.862805] Write of size 8 at addr 0000000000006df0 by task rmmod/5361 [168.862812] CPU: 7 PID: 5361 Comm: rmmod Tainted: G OE 5.19.0-rc6 #1 [168.862816] Hardware name: Intel(R) Client Systems NUC8i7BEH/NUC8BEB, 05/04/2020 [168.862820] Call Trace: [168.862822] <TASK> [168.862825] dump_stack_lvl+0x49/0x63 [168.862832] print_report.cold+0x493/0x6b7 [168.862845] kasan_report+0xa7/0x120 [168.862857] kasan_check_range+0x163/0x200 [168.862861] __kasan_check_write+0x14/0x20 [168.862866] try_to_grab_pending+0x59/0x480 [168.862870] __cancel_work_timer+0xbb/0x340 [168.862898] cancel_work_sync+0x10/0x20 [168.862902] mt7921_pci_remove+0x61/0x1c0 [mt7921e] [168.862909] pci_device_remove+0xa3/0x1d0 [168.862914] device_remove+0xc4/0x170 [168.862920] device_release_driver_internal+0x163/0x300 [168.862925] driver_detach+0xc7/0x1a0 [168.862930] bus_remove_driver+0xeb/0x2d0 [168.862935] driver_unregister+0x71/0xb0 [168.862939] pci_unregister_driver+0x30/0x230 [168.862944] mt7921_pci_driver_exit+0x10/0x1b [mt7921e] [168.862949] __x64_sys_delete_module+0x2f9/0x4b0 [168.862968] do_syscall_64+0x38/0x90 [168.862973] entry_SYSCALL_64_after_hwframe+0x63/0xcd Test steps: 1. insmode 2. do not ifup 3. rmmod quickly (within 1 second) Fixes: 1c71e03a ("mt76: mt7921: move mt7921_init_hw in a dedicated work") Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
We should reset mstat->airtime_ac along with clear up the entries in the hardware WLAN table for the Rx and Rx accumulative airtime. Otherwsie, the value msta->airtime_ac - [tx, rx]_last may be a negative and that is not the actual airtime the device took in the last run. Reported-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Howard Hsu authored
Do not need to check running state before configuring implicit Tx beamform. It is okay to configure implicit Tx beamform in run time. Noted that the existing connected stations will be applied for new configuration only if they reconnected to the interface. Fixes: 6d6dc980 ("mt76: mt7915: add implicit Tx beamforming support") Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Initialize msta pointer to NULL in mt7921_mac_fill_rx() in order to not dereference a uninitialized pointer. Fixes: 0880d408 ("mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Howard Hsu authored
Fix the error that mcs will be reduced to a range of 0 to 7 in ht mode. Fixes: 70fd1333 ("mt76: mt7915: rework .set_bitrate_mask() to support more options") Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
False positive reset would be possibly triggered by those commands we applied in suspend with HZ MCU timeout, especially it happened when we enabled kernel log in pm core to diagnose how much time we spend in each driver during suspend procedure. So we enlarge the value and align the MCU timeout as other commands we did to reduce the false positive reset. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Ruffalo Lavoisier authored
Correct spelling on 'transmitted' in comment Signed-off-by: Ruffalo Lavoisier <RuffaloLavoisier@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Ryder Lee authored
Given that there's no data coming from network stack for binding flows, hence driver counts and reports station's statistics directly through NL80211_STA_INFO_* based on active PPDU based TxS for offloading data. Apart from that, WA firmware and its offloading engine (SDO) have hardcoded "2" as PID, so we introduce MT_PACKET_ID_WED to differentiate WED reporting. Note that PPDU format TxS is mutually exclusive with MT_TXD5_TX_STATUS_HOST. Co-developed-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com> Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Ryder Lee authored
This is a preliminary patch for WED's TxS support. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
Fix the regression of the firmware version report since 'b9ec2710 ('mt76: connac: move mt76_connac2_load_ram in connac module')'. Fixes: b9ec2710 ("mt76: connac: move mt76_connac2_load_ram in connac module") Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race with the context holding dev->muxtex and the driver might access the device in low power state. Fixes: 24299fc8 ("mt76: mt7921: enable rx header traslation offload") Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race with the context holding dev->muxtex and the driver might access the device in low power state. Fixes: 9d958b60 ("mt76: mt7921: fix command timeout in AP stop period") Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Gergo Koteles authored
Simplify mt76x02u_multiple_mcu_reads routine since burst is always false. Signed-off-by: Gergo Koteles <soyer@irl.hu> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Introduce rx_check callback support for mt7663s driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Fix possible unaligned pointer in mt76_connac_mcu_add_nested_tlv routine. Reported-by: kernel test robot <lkp@intel.com> Fixes: 25702d9c ("mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Fix possible unaligned pointer in mt7915_mac_add_twt_setup routine. Reported-by: kernel test robot <lkp@intel.com> Fixes: 3782b69d ("mt76: mt7915: introduce mt7915_mac_add_twt_setup routine") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Similar to mt7921 driver, introduce mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload in order to avoid sending mcu commands while the device is in low-power state. Fixes: d4b98c63 ("mt76: mt7615: add support for rx decapsulation offload") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
YN Chen authored
Fix transmitting packets hangs with continuing to pull the pending packet from mac80211 queues when receiving Tx status notification from the device. Fixes: aac5104b ("mt76: sdio: do not run mt76_txq_schedule directly") Acked-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: YN Chen <yn.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Introduce rx_check callback support for mt7921s driver. Tested-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Dan Carpenter authored
This if statement is never true. It was supposed to have been deleted as part of commit 454b768f ("mt76: mt7921: Let PCI core handle power state and use pm_sleep_ptr()") but was missed. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Dan Carpenter authored
Don't dereference "sar_root" after it has been freed. Fixes: f965333e ("mt76: mt7921: introduce ACPI SAR support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Dan Carpenter authored
Smatch complains that: drivers/net/wireless/mediatek/mt76/mt7915/mac.c:428 mt7915_mac_fill_rx() error: uninitialized symbol 'msta'. It looks like this was supposed to be initialized to NULL. Fixes: 0880d408 ("mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
It is not meaningful to poll sta stat when there is no data traffic. So polling sta stat when the device has transmitted data instead to save CPU power. That implies that it is unallowed the stat_work to work while MCU is being initialized in the really early stage to fix the possible time to time MCU initialization failure. Fixes: d39b52e3 ("mt76: introduce mt76_sdio module") Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
Because wake_work and sdio->stat_work share the same workqueue mt76->wq, if sdio->stat_work cannot acquire the mutex lock such as that was possibly held up by [mt7615, mt7921]_mutex_acquire. Additionally, if [mt7615, mt7921]_mutex_acquire was called by sdio->stat_work self, the wake would be blocked by itself. Thus, we move the stat_work into ieee80211_workqueue instead to break the deadlock. Fixes: d39b52e3 ("mt76: introduce mt76_sdio module") Co-developed-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Since both mt7921_rx_check and mt7921_queue_rx_skb routines are used by all chipsets (mmio, usb and sdio), move them in mac.c and remove duplicated code. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
remove unnecessary MT76_STATE_SUSPEND manipulation to be consistent with the mt7921[e, s] driver. Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
It is unexpected that the reset work is running simultaneously with the suspend or resume context and it is possible that reset work is still running even after mt7921 is suspended if we don't fix the race issue. Thus, the suspend procedure should be waiting until the reset is completed at the beginning and ignore the subsequent the reset requests. In case there is an error that happens during either suspend or resume handler, we will schedule a reset task to recover the error before returning the error code to ensure we can immediately fix the error there. Fixes: df3e4143 ("mt76: mt7921u: add suspend/resume support") Co-developed-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
It is unexpected that the reset work is running simultaneously with the suspend or resume context and it is possible that reset work is still running even after mt7921 is suspended if we don't fix the race issue. Thus, the suspend procedure should be waiting until the reset is completed at the beginning and ignore the subsequent the reset requests. In case there is an error that happens during either suspend or resume handler, we will schedule a reset task to recover the error before returning the error code to ensure we can immediately fix the error there. Fixes: ca74b9b9 ("mt76: mt7921s: add reset support") Co-developed-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Sean Wang authored
It is unexpected that the reset work is running simultaneously with the suspend or resume context and it is possible that reset work is still running even after mt7921 is suspended if we don't fix the race issue. Thus, the suspend procedure should be waiting until the reset is completed at the beginning and ignore the subsequent the reset requests. In case there is an error that happens during either suspend or resume handler, we will schedule a reset task to recover the error before returning the error code to ensure we can immediately fix the error there. Fixes: 0c1ce988 ("mt76: mt7921: add wifi reset support") Co-developed-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Introduce rx_check callback support for mt7663u and mt7921u drivers. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Shayne Chen authored
Compared to fixed payload packets, random payload packets have better measured EVM under the same txpower. Our tests show EVM becomes at least 2-3 dB better in test cases with high rate and long tx length, which also aligns the testing results to proprietary driver. Suggested-by: Jm Chen <jm.chen@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
Lorenzo Bianconi authored
Introduce mt76_connac_reg_map structure in mt76-connac module since it is used by all connac2 chipset. Align structure definitions. This is a preliminary patch to add mt7990 chipset support. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
- 12 Sep, 2022 7 commits
-
-
Bitterblue Smith authored
It looks like a leftover from copying rtl8xxxu_update_rate_mask, which is used with the gen1 chips. It wasn't causing any problems for my RTL8188FU test device, but it's clearly a mistake, so remove it. Fixes: f653e690 ("rtl8xxxu: Implement basic 8723b specific update_rate_mask() function") Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/d5544fe8-9798-28f1-54bd-6839a1974b10@gmail.com
-
Bitterblue Smith authored
Found by comparing with the vendor driver. Currently this affects only the RTL8192EU, which is the only gen2 chip with 2 TX paths supported by this driver. It's unclear what kind of effect the mistake had in practice, since I don't have any RTL8192EU devices to test it. Fixes: e1547c53 ("rtl8xxxu: First stab at adding IQK calibration for 8723bu parts") Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/30a59f3a-cfa9-8379-7af0-78a8f4c77cfd@gmail.com
-
Po-Hao Huang authored
The size limit of H2C commands is 2048. With regulatory that enables U-NII-6 ~ UNII-8 channels, channel list length combining with channel info length will exceed that. Split the channel list to parts and do scan multiple times to workaround that. Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220908051257.25353-10-pkshih@realtek.com
-
Po-Hao Huang authored
This enables hw_scan function for 52c. The mechanism is similar to 52a except that it adds modifications required for 6G channels and extends the command length to make driver compatible to both newer and existing firmware. Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220908051257.25353-9-pkshih@realtek.com
-
Chin-Yen Lee authored
8852c transmits packets with slow response in deep ps mode, and lead to low throughput. We need to call tx_wake for each pakcet to trigger firmware wake earlier to avoid it. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220908051257.25353-8-pkshih@realtek.com
-
Chin-Yen Lee authored
rtw8852c could support deep ps mode if the firmware version is greater than 0.17.34. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220908051257.25353-7-pkshih@realtek.com
-
Chia-Yuan Li authored
With suitable response rate, it can acknowledge peer packets are received. Otherwise, peer could re-transmit again due to missing of ACK frames. To achieve this, refer to RX rate and CMAC table to choose the smaller as initial response rate. Signed-off-by: Chia-Yuan Li <leo.li@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220908051257.25353-6-pkshih@realtek.com
-