Commit Graph
2506 Commits
Author SHA1 Message Date
Shayne ChenandFelix Fietkau a8e89c5a1d mt76: testmode: add support to send larger packet
Add support to send larger packet in testmode to meet requirements
of some test cases.
The limit of max packet size is determined based on tx rate mode setting.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-13 10:15:11 +02:00
Lorenzo BianconiandFelix Fietkau 93b5c28c97 mt76: mt7921: add rcu section in mt7921_mcu_tx_rate_report
Introduce rcu section in mt7921_mcu_tx_rate_report before dereferencing
wcid pointer otherwise loockdep will report the following issue:

[  115.245740] =============================
[  115.245754] WARNING: suspicious RCU usage
[  115.245771] 5.10.20 #0 Not tainted
[  115.245784] -----------------------------
[  115.245816] other info that might help us debug this:
[  115.245830] rcu_scheduler_active = 2, debug_locks = 1
[  115.245845] 3 locks held by kworker/u4:1/20:
[  115.245858]  #0: ffffff80065ab138 ((wq_completion)phy0){+.+.}-{0:0}, at: process_one_work+0x1f8/0x6b8
[  115.245948]  #1: ffffffc01198bdd8 ((work_completion)(&(&dev->mphy.mac_work)->work)){+.+.}-{0:0}, at: process_one_8
[  115.246027]  #2: ffffff8006543ce8 (&dev->mutex#2){+.+.}-{3:3}, at: mt7921_mac_work+0x60/0x2b0 [mt7921e]
[  115.246125]
[  115.246125] stack backtrace:
[  115.246142] CPU: 1 PID: 20 Comm: kworker/u4:1 Not tainted 5.10.20 #0
[  115.246152] Hardware name: MediaTek MT7622 RFB1 board (DT)
[  115.246168] Workqueue: phy0 mt7921_mac_work [mt7921e]
[  115.246188] Call trace:
[  115.246201]  dump_backtrace+0x0/0x1a8
[  115.246213]  show_stack+0x14/0x30
[  115.246228]  dump_stack+0xec/0x134
[  115.246240]  lockdep_rcu_suspicious+0xcc/0xdc
[  115.246255]  mt7921_get_wtbl_info+0x2a4/0x310 [mt7921e]
[  115.246269]  mt7921_mac_work+0x284/0x2b0 [mt7921e]
[  115.246281]  process_one_work+0x2a0/0x6b8
[  115.246293]  worker_thread+0x40/0x440
[  115.246305]  kthread+0x144/0x148
[  115.246317]  ret_from_fork+0x10/0x18

Fixes: 1c099ab44727c ("mt76: mt7921: add MCU support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-13 10:08:50 +02:00
Lorenzo BianconiandFelix Fietkau 186af01047 mt76: mt7921: introduce MCU_EVENT_LP_INFO event parsing
Report trace event related to MCU_EVENT_LP_INFO that is sent by the mcu
when it is ready to enter in deep sleep state

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-13 10:06:58 +02:00
Felix Fietkau bf45b30d89 add missing file
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 19:54:54 +02:00
Felix Fietkau 6b293c411d mt76: mt7615: always add rx header translation tlv when adding stations
Ensures that header translation is disabled for interfaces that do not support
it.

Fixes: bb1262e7199b ("mt76: mt7615: add support for rx decapsulation offload")
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 16:59:59 +02:00
Ryder LeeandFelix Fietkau fe8717dd57 mt76: mt7615: add missing SPDX tag in mmio.c
Resolve the following checkpatch.pl script warning:

WARNING: Missing or malformed SPDX-License-Identifier tag in line 1

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 12:55:54 +02:00
Ryder LeeandFelix Fietkau ffd4cf15fa mt76: mt7915: add mmio.c
Add mmio.c in order to use mt76_bus_ops throughout the driver.
It will be also shared with the future APSoC revision.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 12:55:54 +02:00
Ryder LeeandFelix Fietkau 7714dc914d mt76: report Rx timestamp
Frame reception timestamp (low 32-bits) that indicates the value of the
local TSF timer value at the time the first bit of the MAC header in the
received frame (PPDU unit) arriving at the MAC.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 12:49:17 +02:00
Felix Fietkau 028b7152b1 mt76: mt7921: remove 80+80 MHz support capabilities
This mode is not supported by the hardware

Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 12:46:18 +02:00
Sean WangandFelix Fietkau 813db729c0 mt76: mt7921: reduce the data latency during hw scan
Reduce the data latency during hw_scan by the split scan which would switch
back to operational channel right after scanning each channel done.

Suggested-by: Asda Wen <[email protected]>
Suggested-by: Soul Huang <[email protected]>
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-04-07 10:55:33 +02:00
Sean WangandFelix Fietkau dcdbd7c89c mt76: mt7921: fix MT_PCIE_MAC_INT_ENABLE access
Use mt76_wr to directly access MT_PCIE_MAC_INT_ENABLE because we used the
remapped address 0x10000 as the base to operate PCIe interrupt.

Fixes: c7b646385a3f ("mt76: mt7921: add wifi reset support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-07 10:55:33 +02:00
Sean WangandFelix Fietkau 97189d2a04 mt76: mt7921: fix the insmod hangs
Fix the second insert module causing the device hangs after remove module.

Fixes: 1c099ab44727 ("mt76: mt7921: add MCU support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-07 10:55:33 +02:00
Sean WangandFelix Fietkau 54f52771a0 mt76: mt7921: fix kernel crash when the firmware fails to download
Fix kernel crash when the firmware is missing or fails to download.

[    9.444758] kernel BUG at drivers/pci/msi.c:375!
[    9.449363] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[    9.501033] pstate: a0400009 (NzCv daif +PAN -UAO)
[    9.505814] pc : free_msi_irqs+0x180/0x184
[    9.509897] lr : free_msi_irqs+0x40/0x184
[    9.513893] sp : ffffffc015193870
[    9.517194] x29: ffffffc015193870 x28: 00000000f0e94fa2
[    9.522492] x27: 0000000000000acd x26: 000000000000009a
[    9.527790] x25: ffffffc0152cee58 x24: ffffffdbb383e0d8
[    9.533087] x23: ffffffdbb38628d0 x22: 0000000000040200
[    9.538384] x21: ffffff8cf7de7318 x20: ffffff8cd65a2480
[    9.543681] x19: ffffff8cf7de7000 x18: 0000000000000000
[    9.548979] x17: ffffff8cf9ca03b4 x16: ffffffdc13ad9a34
[    9.554277] x15: 0000000000000000 x14: 0000000000080800
[    9.559575] x13: ffffff8cd65a2980 x12: 0000000000000000
[    9.564873] x11: ffffff8cfa45d820 x10: ffffff8cfa45d6d0
[    9.570171] x9 : 0000000000000040 x8 : ffffff8ccef1b780
[    9.575469] x7 : aaaaaaaaaaaaaaaa x6 : 0000000000000000
[    9.580766] x5 : ffffffdc13824900 x4 : ffffff8ccefe0000
[    9.586063] x3 : 0000000000000000 x2 : 0000000000000000
[    9.591362] x1 : 0000000000000125 x0 : ffffff8ccefe0000
[    9.596660] Call trace:
[    9.599095]  free_msi_irqs+0x180/0x184
[    9.602831]  pci_disable_msi+0x100/0x130
[    9.606740]  pci_free_irq_vectors+0x24/0x30
[    9.610915]  mt7921_pci_probe+0xbc/0x250 [mt7921e]
[    9.615693]  pci_device_probe+0xd4/0x14c
[    9.619604]  really_probe+0x134/0x2ec
[    9.623252]  driver_probe_device+0x64/0xfc
[    9.627335]  device_driver_attach+0x4c/0x6c
[    9.631506]  __driver_attach+0xac/0xc0
[    9.635243]  bus_for_each_dev+0x8c/0xd4
[    9.639066]  driver_attach+0x2c/0x38
[    9.642628]  bus_add_driver+0xfc/0x1d0
[    9.646365]  driver_register+0x64/0xf8
[    9.650101]  __pci_register_driver+0x6c/0x7c
[    9.654360]  init_module+0x28/0xfdc [mt7921e]
[    9.658704]  do_one_initcall+0x13c/0x2d0
[    9.662615]  do_init_module+0x58/0x1e8
[    9.666351]  load_module+0xd80/0xeb4
[    9.669912]  __arm64_sys_finit_module+0xa8/0xe0
[    9.674430]  el0_svc_common+0xa4/0x16c
[    9.678168]  el0_svc_compat_handler+0x2c/0x40
[    9.682511]  el0_svc_compat+0x8/0x10
[    9.686076] Code: a94257f6 f9400bf7 a8c47bfd d65f03c0 (d4210000)
[    9.692155] ---[ end trace 7621f966afbf0a29 ]---
[    9.697385] Kernel panic - not syncing: Fatal exception
[    9.702599] SMP: stopping secondary CPUs
[    9.706549] Kernel Offset: 0x1c03600000 from 0xffffffc010000000
[    9.712456] PHYS_OFFSET: 0xfffffff440000000
[    9.716625] CPU features: 0x080026,2a80aa18
[    9.720795] Memory Limit: none

Fixes: 5c14a5f944b (""mt76: mt7921: introduce mt7921e support)
Reported-by: Claire Chang <[email protected]>
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-04-07 10:55:33 +02:00
Sean WangandFelix Fietkau f32a4e15f5 mt76: mt7921: fix the dwell time control
dwell time for the scan is not configurable according to the current
firmware submitted into linux-firmware.git, so leave the dwell time 0 to
indicate the dwell time always determined by the firmware.

Fixes: 399090ef9605 ("mt76: mt76_connac: move hw_scan and sched_scan routine in mt76_connac_mcu module")
Suggested-by: Soul Huang <[email protected]>
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-04-07 10:55:33 +02:00
Sean WangandFelix Fietkau cf0badbc04 mt76: mt7921: fix inappropriate WoW setup with the missing ARP informaiton
Fix the Wake-on-WoWLAN failure should rely on ARP Information is being
updated in time to the firmware.

Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-07 10:55:33 +02:00
Lorenzo BianconiandFelix Fietkau 5e764ec9be mt76: mt7921: introduce MT_WFDMA_DUMMY_CR definition
Introduce MT_WFDMA_DUMMY_CR definition and remove magic numbers

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-07 10:55:33 +02:00
Felix Fietkau 04122c8974 mt76: fix rx amsdu subframe processing
When receiving an A-MSDU containing only a single subframe, status->last_amsdu
is set, but no previous head is present in the rx A-MSDU queue.
In this case, the A-MSDU subframe will be held until the next one is received,
potentially causing significant extra latency.
Rework the code to make it easier to read and less convoluted, and release the
newly created head if status->last_amsdu is set.

Signed-off-by: Felix Fietkau <[email protected]>
2021-04-07 08:54:45 +02:00
Ryder LeeandFelix Fietkau 7d35b7a15d mt76: mt7915: add wifi subsystem reset
Reset wifi subsystem when MCU is already running.
Fixes firmware download failure after soft reboot on systems where the PCIe
reset could not be performed properly.

Signed-off-by: Ryder Lee <[email protected]>
Co-developed-by: Felix Fietkau <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-06 17:53:30 +02:00
Ryder LeeandFelix Fietkau f8c6c7cbf1 mt76: mt7915: fix mt7915_mcu_add_beacon
ieee80211_beacon_get_template() returns NULL when beacon state is disabled.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Ryder LeeandFelix Fietkau e578b4b8d5 mt76: mt7615: fix .add_beacon_offload()
ieee80211_beacon_get_template() returns NULL when beacon state is disabled,
so beacon_offload cannot be disabled for some devices.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Lorenzo BianconiandFelix Fietkau 6ee4770de0 mt76: mt7921: rework mt7921_mcu_debug_msg_event routine
Rework mt7921_mcu_debug_msg_event routing removing unnecessary
assignments and relying on wiphy_info

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Lorenzo BianconiandFelix Fietkau 38f656768a mt76: mt7921: always wake the device in mt7921_remove_interface
Make sure the mcu is not in sleep mode before sending mcu messages in
mt7921_remove_interface routine.

Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Leon Yen <[email protected]>
Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Lorenzo BianconiandFelix Fietkau e66a0b9b8d mt76: mt7615: always wake the device in mt7615_remove_interface
Similar to mt7921 driver, make sure the mcu is not in sleep mode before
sending mcu messages in mt7615_remove_interface routine.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Shayne ChenandFelix Fietkau 4e22f0dc93 mt76: mt7915: fix txpower init for TSSI off chips
Fix incorrect txpower init value for TSSI off chips which causes
too small txpower.

Signed-off-by: Shayne Chen <[email protected]>
2021-04-01 21:28:05 +02:00
Lorenzo BianconiandFelix Fietkau be1ab3b9ae mt76: mt7921: fix typo in mt7921_pci_resume
Return proper error code from mt7921_mcu_drv_pmctrl in mt7921_pci_resume
routine.

Fixes: 8db9c79f230d6 ("mt76: mt7921: fix suspend/resume sequence")
Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-04-01 21:27:47 +02:00
Guobin HuangandFelix Fietkau 113ba8a81d mt76: mt7615: remove redundant dev_err call in mt7622_wmac_probe()
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Guobin Huang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-01 21:27:47 +02:00
Felix Fietkau 0ff3a336a8 mt7615,mt7915: fix a compiler warning
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-27 23:47:09 +01:00
Lorenzo BianconiandFelix Fietkau 62b13f5352 mt76: mt7921: fix key set/delete issue
Similar to the mt7915 driver, deleting a key with the previous key index
deletes the current key. Rework the code to better keep track of
multiple keys and check for the key index before deleting the current
key

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-03-27 23:39:09 +01:00
Felix Fietkau 465dda65ee mt7615,mt7915: replace fw log 0-terminating code with wiphy info length limit
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-27 20:29:16 +01:00
Felix Fietkau b860906689 mt76: mt7615: fix chip reset on MT7622 and MT7663e
After chip reset, the DMA scheduler needs to be initialized as well.
Since the code is PCI/SoC specific, move it to pci_mac.c, so that it
can depend on a function in dma.c

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:26 +01:00
Felix Fietkau 4a22f2ffae mt76: mt7915: 0-terminate firmware log messages
Avoid including garbage from previous rx data in the printk messages

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:18 +01:00
Felix Fietkau a519c49a6a mt76: mt7615: 0-terminate firmware log messages
Avoid including garbage from previous rx data in the printk messages

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:09 +01:00
Ryder LeeandFelix Fietkau 57432e701d mt76: mt7915: cleanup mcu tx queue in mt7915_dma_reset()
Cleanup mcu queues in mt7915_mac_reset_work().

Fixes: mt76: e637763b606 ("move mcu queues to mt76_dev q_mcu array")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau 115b742823 mt76: mt7915: keep mcu_add_bss_info enabled till interface removal
The same as mt7615. Keep BSS_INFO_BASIC enabled throughout interfaces
life cycle.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau bf6d9ee4ac mt76: mt7615: keep mcu_add_bss_info enabled till interface removal
BSS_INFO_BASIC is never called alone with inactive state, which always
follows beacon offload disable, so keep it enabled throughout interfaces
life cycle. Inactive state also removes sta record of all connected
stations, thurs causes connection lost which defeats the purpose of CSA.

Lastly, this is especially an unexpected behavior that keeping mt7622
failing beacon buffer recyled when scanning channels.

bss_conf change is updated with active state only, so just overwrite it.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau 3bd285424e mt76: mt7622: trigger hif interrupt for system reset
hif interrupt needs to be triggered after MT_MCU_INT_EVENT.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau 9a98b1a6f9 mt76: mt7615: cleanup mcu tx queue in mt7615_dma_reset()
With this patch, mt7615_mac_reset_work() can recover system back.

Fixes: e637763b606b ("mt76: move mcu queues to mt76_dev q_mcu array")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau ee29cd5f3a mt76: mt7615: only enable DFS test knobs for mt7615
DFS knobs should not be visible to non-DFS devices.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Lorenzo BianconiandFelix Fietkau 035e2f6f1d mt76: mt7921: get rid of mt7921_mac_wtbl_lmac_addr
Get rid of mt7921_mac_wtbl_lmac_addr routine since mt7921 wtbl size is
19 entries

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:17:07 +01:00
Felix Fietkau f66f8f41d4 mt76: mt7915: refresh repeater entry MAC address when setting BSSID
When disassociating and clearing the BSSID of a repeater entry used by a client
mode interface, the corresponding MAC address entry can get lost too, causing
the client interface to not be able to associate anymore.
Fix this by also refreshing the MAC address when setting the BSSID

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:16:06 +01:00
Felix Fietkau 09a1befde4 mt76: fix potential DMA mapping leak
With buf uninitialized in mt76_dma_tx_queue_skb_raw, its field skip_unmap
could potentially inherit a non-zero value from stack garbage.
If this happens, it will cause DMA mappings for MCU command frames to not be
unmapped after completion

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-23 22:47:59 +01:00
Felix Fietkau be2f67e8d3 mt76: mt7915: fix key set/delete issue
Deleting a key with the previous key index deletes the current key
Rework the code to better keep track of multiple keys and check for the
key index before deleting the current key

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-22 21:39:57 +01:00
Lorenzo BianconiandFelix Fietkau e4d5227768 mt76: mt7921: fix airtime reporting
Fix {tx,rx}_airtime reporting for mt7921 driver. Wrong register definitions
trigger a tx hangs before resetting airtime stats.

Fixes: 163f4d22c118d ("mt76: mt7921: add MAC support")
Tested-by: Leon Yen <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Acked-by: Felix Fietkau <[email protected]>
2021-03-22 18:43:35 +01:00
Lorenzo BianconiandFelix Fietkau e529e8afe2 mt76: mt7921: properly configure rcpi adding a sta to the fw
Properly configure rcpi based on association process rssi. rcpi is used
by rate controller embedded into the fw to initialize amsdu size.

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-03-20 18:31:03 +01:00
Lorenzo BianconiandFelix Fietkau 6886b57a15 mt76: connac: introcuce mt76_sta_cmd_info data structure
Introduce mt76_sta_cmd_info data structure to contain parameters passed
to mt76_sta_cmd_info routine. This is preliminary patch to properly
configure rcpi for mt7921 devices.

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-03-20 18:31:00 +01:00
Lorenzo BianconiandFelix Fietkau fbef8bba03 mt76: mt7921: remove duplicated macros in mcu.h
Remove mcu definitions already available in mt76_connac_mcu.h

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-18 10:48:36 +01:00
Ryder LeeandFelix Fietkau 48a905e237 mt76: mt7615: fix CSA event format
Fix format changes among the firmware versions.

Fixes: f9390c251868 ("mt76: mt7615: fix CSA notification for DBDC")
Signed-off-by: Ryder Lee <[email protected]>
2021-03-18 10:44:48 +01:00
Lorenzo BianconiandFelix Fietkau 0b6c9a043f mt76: move de-amsdu buffer per-phy
mt7615d users report the following crash running both phy concurrently:

[  147.273909] CPU 1 Unable to handle kernel paging request at virtual address 00000000, epc == 8e4f288c, ra == 8e58a968
[  147.284570] Oops[#1]:
[  147.286854] CPU: 1 PID: 3724 Comm: kworker/u9:3 Not tainted 5.4.105 #0
[  147.293403] Workqueue: napi_workq napi_workfn
[  147.297742] $ 0   : 00000000 00000001 8e595ec0 00000000
[  147.302950] $ 4   : 8e595ec0 00000000 8e5ca600 00000000
[  147.308161] $ 8   : 00000000 000004c1 80808080 fefefeff
[  147.313370] $12   : 00000000 00000000 80704f1c 00000040
[  147.323781] $20   : 00000050 00000044 00000011 01ce9502
[  147.334195] $28   : 8e004000 8e005d18 8ddf2020 8e58a968
[  147.342266] Lo    : 00000000
[  147.350397] ra    : 8e58a968 mt7615_queue_rx_skb+0x94c/0xd0c [mt7615_common]
[  147.361580] Cause : 4080000c (ExcCode 03)
[  147.368434] PrId  : 0001992f (MIPS 1004Kc)
[  147.456965] Process kworker/u9:3 (pid: 3724, threadinfo=9ece68d6, task=b16d155f, tls=00000000)
[  147.473857]         0001ce95 00004188 00000000 00000080 00004c10 00000002 8074a2b8 80043dcc
[  147.490505]         00000000 8e4f0110 8069ddf4 806ab148 8dfc0000 00001000 00000000 00000050
[  147.507150]         ...
[  147.512033] [<8e4f288c>] mt76_rx+0x124/0x320 [mt76]
[  147.526633]
[  147.528512] ---[ end trace 3d137e75bb109149 ]---

The issue has been introduce enabling hw rx de-amsdu since the hw can
interleave amsdu frames from both phy. Fix the issue moving the de-amsdu
buffer per-phy.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Acked-by: Ryder Lee <[email protected]>
2021-03-18 10:44:42 +01:00
Sean WangandFelix Fietkau ca22cc221a linux-firmware: add firmware for MT7921
Add binary firmware for MT7921 based devices

File: firmware/WIFI_MT7961_patch_mcu_1_2_hdr.bin
Version: 20210122002654a
File: firmware/WIFI_RAM_CODE_MT7961_1.bin
Version: 20210122002730

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Josh Boyer <[email protected]>
2021-03-15 12:55:13 +01:00
Colin Ian KingandFelix Fietkau cc933b3669 mt76: mt7921: remove redundant check on type
Currently in the switch statement case where type is
NL80211_IFTYPE_STATION there is a check to see if type
is not NL80211_IFTYPE_STATION.  This check is always false
and is redundant dead code that can be removed.

Addresses-Coverity: ("Logically dead code")
Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-15 00:07:35 +01:00