Age | Commit message (Collapse) | Author |
|
- change the WTBL LMAC access function to set the mapping window only once
- use ac * 2 as offset, since each AC has separate words for rx and tx
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Fix length field corruption in usb dma header introduced adding sdio
support
Fixes: 75b10f0cbd0b ("mt76: mt76u: add mt76_skb_adjust_pad utility routine")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Fix a possible NULL pointer dereference in mt76_testmode_dump() since
nla_nest_start returns NULL in case of error
Fixes: f0efa8621550e ("mt76: add API for testmode support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Initialize wcid to global_wcid if msta is NULL in mt7615_pm_wake_work
routine since wcid will be dereferenced running mt76_tx()
Fixes: 2b8cdfb28d340 ("mt76: mt7615: wake device before pushing frames in mt7615_tx")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Fix a memory leak in mt7615_tm_set_tx_power routine if
mt7615_eeprom_get_target_power_index fails.
Moreover do not account req_header twice in mcu skb allocation.
Fixes: 4f0bce1c88882 ("mt76: mt7615: implement testmode support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Use buffer allocated with kmalloc instead of with stack to fix kernel
crash due to Unable to handle kernel paging request at virtual address
ffffffc0095cbce8.
[ 156.977349] Unable to handle kernel paging request at virtual address ffffffc0095cbce8
[ 156.985270] Mem abort info:
[ 156.988059] ESR = 0x96000045
[ 156.991104] Exception class = DABT (current EL), IL = 32 bits
[ 156.997013] SET = 0, FnV = 0
[ 157.000057] EA = 0, S1PTW = 0
[ 157.003190] Data abort info:
[ 157.006061] ISV = 0, ISS = 0x00000045
[ 157.009887] CM = 0, WnR = 1
[ 157.012850] swapper pgtable: 4k pages, 39-bit VAs, pgdp = 0000000042adcba2
[ 157.019715] [ffffffc0095cbce8] pgd=0000000000000000, pud=0000000000000000
[ 157.026499] Internal error: Oops: 96000045 [#1] PREEMPT SMP
[ 157.032065] Modules linked in: mt7663s mt7663_usb_sdio_common mt7615_common
...
[ 157.073007] Process CompositorTileW (pid: 1625, stack limit = 0x000000003f2389fc)
[ 157.080484] CPU: 0 PID: 1625 Comm: CompositorTileW Not tainted 4.19.137 #36
[ 157.092219] pstate: 80000085 (Nzcv daIf -PAN -UAO)
[ 157.097012] pc : __memcpy+0xc0/0x180
[ 157.100585] lr : swiotlb_tbl_unmap_single+0x84/0x14c
[ 157.105540] sp : ffffff8008003cb0
[ 157.108845] x29: ffffff8008003cb0 x28: ffffff9c1a211f60
[ 157.114149] x27: ffffff9c19ecc018 x26: 0000000000001000
[ 157.119452] x25: ffffff9c1a378000 x24: 0000000000000001
[ 157.124755] x23: ffffff9c1a378000 x22: 00000000000001ff
[ 157.130058] x21: 0000000000000000 x20: 00000000fbefe800
[ 157.135360] x19: 0000000000000070 x18: 0000000000000000
[ 157.140663] x17: 0000000000000000 x16: 0000000000000000
[ 157.145965] x15: 0000000000000000 x14: 0000000000000000
[ 157.151267] x13: 0000000000000000 x12: 000000000000000d
[ 157.156569] x11: 000000000000000c x10: 0000000a7befe800
[ 157.161873] x9 : fffffff680000000 x8 : 0000000000000000
[ 157.167175] x7 : 0000000100000003 x6 : ffffffc0095cbce8
[ 157.172479] x5 : 0000000000000000 x4 : 0000000000000000
[ 157.177781] x3 : 0000000000000002 x2 : fffffffffffffff0
[ 157.183085] x1 : ffffffca7befe810 x0 : ffffffc0095cbce8
[ 157.188389] Call trace:
[ 157.190832] __memcpy+0xc0/0x180
[ 157.194053] swiotlb_unmap_sg_attrs+0xa8/0xb0
[ 157.198406] __swiotlb_unmap_sg_attrs+0x8c/0xa4
[ 157.202931] msdc_unprepare_data+0x6c/0x84
[ 157.207019] msdc_request_done+0x58/0x98
[ 157.210934] msdc_data_xfer_done+0x1a8/0x1d0
[ 157.215195] msdc_irq+0x12c/0x17c
[ 157.218505] __handle_irq_event_percpu+0xd8/0x298
[ 157.223202] handle_irq_event+0x60/0xdc
[ 157.227031] handle_fasteoi_irq+0xa4/0x1d4
[ 157.231120] __handle_domain_irq+0x84/0xc4
[ 157.235210] gic_handle_irq+0x124/0x1a4
[ 157.239038] el0_irq_naked+0x4c/0x54
[ 157.242608] Code: 14000028 f1020042 5400024a a8c12027 (a88120c7)
[ 157.248693] ---[ end trace 28b8090135b0a2e1 ]---
[ 157.265589] Kernel panic - not syncing: Fatal exception in interrupt
[ 157.271944] SMP: stopping secondary CPUs
[ 157.275865] Kernel Offset: 0x1c10e00000 from 0xffffff8008000000
[ 157.281779] CPU features: 0x0,2188200c
[ 157.285519] Memory Limit: none
Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s 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>
|
|
MT7663s have to rely on MMC_PM_KEEP_POWER in pm_flags for to avoid SDIO
power is being shut off.
To fix sdio access failure like "mt7663s mmc1:0001:1: sdio write failed:
-22" for the first sdio command to access the bus in the resume handler.
Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s 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>
|
|
Fix the following sparse warnings in mt7663s driver:
drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c:78:62: warning:
Using plain integer as NULL pointer
drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c:110:62: warning:
Using plain integer as NULL pointer
drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c:229:64: warning:
Using plain integer as NULL pointer
drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c:263:64: warning:
Using plain integer as NULL pointer
Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Reduce scope of mutex_acquire/mutex_release in mt7615_reset_test_set
routine in order to fix the following static checker warning:
drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c:179
mt7615_reset_test_set()
warn: inconsistent returns 'dev->mt76.mutex'.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: ea4906c4be49 ("mt76: mt7615: wake device before accessing regmap in debugfs")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This disables the software A-MSDU aggregation in mac80211 and enables hardware
offloading
Suggested-by: Yiwei Chung <yiwei.chung@mediatek.com>
Suggested-by: YF Luo <yf.luo@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Co-developed-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Indicate the filled parameter to the firmware
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Use the txwi data as primary source information to avoid touching skb data
Use bitfield instead of state variable + spinlock
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
It is not used anywhere for this driver
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
mt7615 and newer drivers do not need this, since they use sequence number offload
Moving this code also reduces the number of callsites to make it easier to review
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Preparation for supporting more offload features
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Set it to 15 to match reference driver
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Queueing a per-sta work item from the tx free path can become very expensive
under load. This work is only supposed to pull rate control stats every
second and deal with rate control changes.
Additionally, the rate control update code was wrong, because it was
confusing bit masks and bit numbers in test_bit.
Fix this by introducing a dedicated device work item for rate control
updates, and by polling station stats from the phy mac work.
Stations requiring polling or rate control updates are added to lists
protected by dev->sta_poll_lock.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Fixes a race condition where multiple tx cleanup or sta poll tasks could run
in parallel.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Fixes a race condition where multiple tx cleanup tasks could run in parallel
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Only clear unmasked interrupts. If an interrupt is temporarily masked,
its pending events need to be processed later, even if another interrupt
happened in the mean time.
Disable interrupts in one call before scheduling
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
If an interrupt is temporarily masked, its pending events need to be processed
later, even if another interrupt happened in the mean time.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Only clear unmasked interrupts. If an interrupt is temporarily masked,
its pending events need to be processed later, even if another interrupt
happened in the mean time.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Avoids spurious interrupts in case the hardware was running already
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
A small part of the first skb buffer is passed to the firmware for parsing
via DMA, while the full buffer is passed as part of the TXP.
Avoid calling DMA unmap on the first part (with a different length than map)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Check wcid RCU pointer before using it
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Enable U-APSD support for AP interface.
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Remove unused state variable in mt76_sdio structure
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
In order to maximize parallelism, split status work in tx status work
and rx net work
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
As it has been done for tx and rx processing, move tx/rx status
processing into mt76s_txrx_wq workqueue
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Move rx processing to mt76s_txrx_wq in order to minimize the interval when
the sdio bus is locked during rx
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce mt76s_txrx_wq workqueue and move tx processing from kthread to
a dedicated work. This is preliminary patch to improve mt7663s throughput
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Free the mcu skb in case of error in mt76s_tx_queue_skb_raw routine
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Reschedule runtime-pm after receiving a tx interrupt.
Update runtime-pm last activity before injecting packets
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Do not tx packets in mt76_txq_send_burst() or mt76_txq_schedule_list()
if the device is in runtime-pm
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
wq queue is always updated holding mt76 spinlock. Grab mt76 lock in
mt7615_queue_key_update() before putting a new element at the end of the
queue.
Fixes: eb99cc95c3b65 ("mt76: mt7615: introduce mt7663u support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Initialize set_drv_ctrl and set_fw_ctrl function pointers in
mt7663s_mcu_init. This is a preliminary patch to enable runtime-pm for
mt7663s chipset.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce set_drv_ctrl and set_fw_ctrl function pointers in
mt7615_mcu_ops data structure. This is a preliminary patch to enable
runtime-pm for non-pci chipsets
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
MT_EE_WIFI_CONF field can be used to detect if the chipset is MT7615D.
Thus, add support to automatically register ext_phy if DBDC is detected.
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
After fixing mac80211 to allow larger A-MSDUs in some cases, there have been
reports of performance regressions and packet loss with some clients.
It appears that the issue occurs when the hardware is transmitting A-MSDUs
bigger than 8k. Limit the local VHT MPDU size capability to 7991, matching
the value used for MT7915 as well.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200923052442.24141-1-nbd@nbd.name
|
|
Two minor conflicts:
1) net/ipv4/route.c, adding a new local variable while
moving another local variable and removing it's
initial assignment.
2) drivers/net/dsa/microchip/ksz9477.c, overlapping changes.
One pretty prints the port mode differently, whilst another
changes the driver to try and obtain the port mode from
the port node rather than the switch node.
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200919024838.14172-1-miaoqinglang@huawei.com
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says:
====================
wireless-drivers-next patches for v5.10
First set of patches for v5.10. Most noteworthy here is ath11k getting
initial support for QCA6390 and IPQ6018 devices. But most of the
patches are cleanup: W=1 warning fixes, fallthrough keywords, DMA API
changes and tasklet API changes.
Major changes:
ath10k
* support SDIO firmware codedumps
* support station specific TID configurations
ath11k
* add support for IPQ6018
* add support for QCA6390 PCI devices
ath9k
* add support for NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 to improve PTK0
rekeying
wcn36xx
* add support for TX ack
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.
[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200901173603.GA2701@embeddedor
|
|
Fixes the following W=1 kernel build warning(s):
drivers/net/wireless/mediatek/mt7601u/phy.c:1216: warning: Function parameter or member 'dac' not described in 'mt7601u_set_tx_dac'
drivers/net/wireless/mediatek/mt7601u/phy.c:1216: warning: Excess function parameter 'path' description in 'mt7601u_set_tx_dac'
Cc: Jakub Kicinski <kubakici@wp.pl>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200819072402.3085022-16-lee.jones@linaro.org
|
|
Using dev_kfree_skb for tx skbs breaks AQL. This worked until now only
by accident, because a mac80211 issue breaks AQL on drivers with firmware
rate control that report the rate via ieee80211_tx_status_ext as struct
rate_info.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200812144943.91974-1-nbd@nbd.name
|
|
stations
The implementation of embedding WTBL update inside the STA_REC update is buggy
on the MT7615 v2 firmware. This leads to connection issues after a station has
connected and disconnected again.
Switch to the v1 MCU API ops, since they have received much more testing and
should be more stable.
On MT7622 and later, the v2 API is more actively used, so we should keep using
it as well.
Fixes: 6849e29ed92e ("mt76: mt7615: add starec operating flow for firmware v2")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200812102332.11812-1-nbd@nbd.name
|
|
We want to reuse the functions and structs for other counters such as BSS
color change. Rename them to more generic names.
Signed-off-by: John Crispin <john@phrozen.org>
Link: https://lore.kernel.org/r/20200811080107.3615705-2-john@phrozen.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
|
mt76 driver had major conflicts within mt7615 directory. To make it easier for
every merge wireless-drivers to wireless-drivers-next and solve those
conflicts.
|
|
In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
consumed on all execution paths. Release skb before returning if
test_bit() fails.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200718052630.11032-1-navid.emamdoost@gmail.com
|
|
In the implementation of __mt76x02u_mcu_send_msg() the skb is consumed
all execution paths except one. Release skb before returning if
test_bit() fails.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|