Age | Commit message (Collapse) | Author |
|
A warning on driver removal started occurring after commit 9dd05df8403b
("net: warn if NAPI instance wasn't shut down"). Disable tx napi before
deleting it in mt76_dma_cleanup().
WARNING: CPU: 4 PID: 18828 at net/core/dev.c:7288 __netif_napi_del_locked+0xf0/0x100
CPU: 4 UID: 0 PID: 18828 Comm: modprobe Not tainted 6.15.0-rc4 #4 PREEMPT(lazy)
Hardware name: ASUS System Product Name/PRIME X670E-PRO WIFI, BIOS 3035 09/05/2024
RIP: 0010:__netif_napi_del_locked+0xf0/0x100
Call Trace:
<TASK>
mt76_dma_cleanup+0x54/0x2f0 [mt76]
mt7921_pci_remove+0xd5/0x190 [mt7921e]
pci_device_remove+0x47/0xc0
device_release_driver_internal+0x19e/0x200
driver_detach+0x48/0x90
bus_remove_driver+0x6d/0xf0
pci_unregister_driver+0x2e/0xb0
__do_sys_delete_module.isra.0+0x197/0x2e0
do_syscall_64+0x7b/0x160
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Tested with mt7921e but the same pattern can be actually applied to other
mt76 drivers calling mt76_dma_cleanup() during removal. Tx napi is enabled
in their *_dma_init() functions and only toggled off and on again inside
their suspend/resume/reset paths. So it should be okay to disable tx
napi in such a generic way.
Found by Linux Verification Center (linuxtesting.org).
Fixes: 2ac515a5d74f ("mt76: mt76x02: use napi polling for tx cleanup")
Cc: stable@vger.kernel.org
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Tested-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250506115540.19045-1-pchelkin@ispras.ru
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
In dma init or reset scene, full buffer is needed for all rx rings. Since
this is very time consuming, split the function to perform initial
allocation without holding the spinlock. This avoids causing excessive
scheduler latency.
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Reviewed-by: Shayne Chen <shayne.chen@mediatek.com>
Reviewed-by: Deren Wu <deren.wu@mediatek.com>
Link: https://patch.msgid.link/57c68a7ce1dd9022fa5e06af2c53d6313f30ec83.1731069062.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Embedding net_device into structures prohibits the usage of flexible
arrays in the net_device structure. For more details, see the discussion
at [1].
Un-embed the net_devices from struct mt76_dev by converting them
into pointers, and allocating them dynamically. Use the leverage
alloc_netdev_dummy() to allocate the net_device object at
mt76_dma_init().
The free of the device occurs at mt76_dma_cleanup().
Link: https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/ [1]
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240619105311.3144908-1-leitao@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
When queueing packets, only the MT76_RESET flag of the primary PHY
is checked. If the primary PHY is scanning or changing channels, this can
lead to packet loss for tx on the second PHY.
Fix this by passing the phy to the .tx_queue_skb op and using it to check
the correct flag.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce wed.c in order to collect mt76 wed common codebase used by
mt7915 and mt7996 drivers.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Cross-merge networking fixes after downstream PR.
Adjacent changes:
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
23c93c3b6275 ("bnxt_en: do not map packet buffers twice")
6d1add95536b ("bnxt_en: Modify TX ring indexing logic.")
tools/testing/selftests/net/Makefile
2258b666482d ("selftests: add vlan hw filter tests")
a0bc96c0cd6e ("selftests: net: verify fq per-band packet limit")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
If WED rx is enabled, rx buffers are added to a buffer pool that can be
filled from multiple page pools. Because buffers freed from rx poll are
not guaranteed to belong to the processed queue's page pool, lockless
caching must not be used in this case.
Cc: stable@vger.kernel.org
Fixes: 2f5c3c77fc9b ("wifi: mt76: switch to page_pool allocator")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231208075004.69843-1-nbd@nbd.name
|
|
Introduce the capability to run mt7996 driver on boards with more than
4GB of memory.
Co-developed-by: Rex Lu <rex.lu@mediatek.com>
Signed-off-by: Rex Lu <rex.lu@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce the capability to reset mt7996 chipset if requested by wed
driver.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Move WED reset code shared between mt7915 and mt7996 in common module.
This is a preliminary patch to introduce WED reset support for mt7996.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Similar to MT7915, enable Wireless Ethernet Ditpatcher for MT7996
to offload traffic received from the WLAN nic and transmitted on the
LAN one
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This is a preliminary patch to introduce WED support for mt7996
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Similar to MT7915, enable Wireless Ethernet Ditpatcher for MT7996
to offload traffic received from the LAN nic and transmitted on the
WLAN one
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce mtk_wed_device pointer in mt76_queue structure in order to
configure WED chip.
Get rid of dev parameter in Q_READ and Q_WRITE macros.
Introduce wed parameter to the following routine signatures:
- mt76_init_queue
- mt76_init_tx_queue
This is a preliminary patch to introduce WED support for mt7996 since
mt7996 runs two separate WED chips.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This is a preliminary patch to introduce WED support for mt7996
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
mt76 patches for 6.7
* mt7603/mt7628 stability improvements
* fixes
* new driver for mt7925
|
|
mt76_dma_rx_cleanup would be frequenetly called up to reset the dma rings
to be freshed as new ones when switching back from the deep sleep mode to
the active mode on mt7921 and mt7922.
Shrink the scope of spin_lock_bh in mt76_dma_rx_cleanup being held up
to allow the kernel scheduler to be able to switch other tasks in time
by reducing the latency.
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Add 'dma_mapping_error()' check in 'mt76_alloc_txwi()'.
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
The error handling code was added in order to allow tx enqueue to fail after
calling .tx_prepare_skb. Since this can no longer happen, the error handling
code is unused.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Fix the following kernel depency lock holding wed_lock with BH disabled.
[ 40.579696] mt798x-wmac 18000000.wifi: attaching wed device 0 version 2
[ 40.604648] platform 15010000.wed: MTK WED WO Firmware Version: DEV_000000, Build Time: 20221208202138
[ 40.613972] platform 15010000.wed: MTK WED WO Chip ID 00 Region 3
[ 40.943617]
[ 40.945118] ========================================================
[ 40.951457] WARNING: possible irq lock inversion dependency detected
[ 40.957797] 5.15.127 #0 Not tainted
[ 40.961276] --------------------------------------------------------
[ 40.967614] insmod/2329 just changed the state of lock:
[ 40.972827] ffffff8004003b08 (&dev->wed_lock){+.+.}-{2:2}, at: mt76_get_rxwi+0x1c/0xac [mt76]
[ 40.981387] but this lock was taken by another, SOFTIRQ-safe lock in the past:
[ 40.988592] (&q->lock){+.-.}-{2:2}
[ 40.988602]
[ 40.988602]
[ 40.988602] and interrupts could create inverse lock ordering between them.
[ 40.988602]
[ 41.003445]
[ 41.003445] other info that might help us debug this:
[ 41.009957] Possible interrupt unsafe locking scenario:
[ 41.009957]
[ 41.016729] CPU0 CPU1
[ 41.021245] ---- ----
[ 41.025761] lock(&dev->wed_lock);
[ 41.029241] local_irq_disable();
[ 41.035145] lock(&q->lock);
[ 41.040620] lock(&dev->wed_lock);
[ 41.046616] <Interrupt>
[ 41.049223] lock(&q->lock);
[ 41.052356]
[ 41.052356] *** DEADLOCK ***
[ 41.052356]
[ 41.058260] 1 lock held by insmod/2329:
[ 41.062085] #0: ffffff80003b9988 (&dev->mutex){....}-{3:3}, at: __driver_attach+0x88/0x190
[ 41.070442]
[ 41.070442] the shortest dependencies between 2nd lock and 1st lock:
[ 41.078257] -> (&q->lock){+.-.}-{2:2} {
[ 41.082177] HARDIRQ-ON-W at:
[ 41.085396] lock_acquire+0xfc/0x2c0
[ 41.090787] _raw_spin_lock_bh+0x84/0xa0
[ 41.096525] mt76_dma_cleanup+0x24c/0x650 [mt76]
[ 41.102977] mt76_dma_cleanup+0x614/0x650 [mt76]
[ 41.109428] mt7915_eeprom_get_power_delta+0x1168/0x2464 [mt7915e]
[ 41.117435] mt7915_eeprom_init+0x40/0x340 [mt7915e]
[ 41.124222] cleanup_module+0x94/0xb28 [mt7915e]
[ 41.130662] platform_probe+0x64/0xbc
[ 41.136139] really_probe.part.0+0x98/0x2f4
[ 41.142134] __driver_probe_device+0x94/0x16c
[ 41.148303] driver_probe_device+0x40/0x120
[ 41.154299] __driver_attach+0x94/0x190
[ 41.159947] bus_for_each_dev+0x5c/0x94
[ 41.165594] driver_attach+0x20/0x30
[ 41.170983] bus_add_driver+0x104/0x1f4
[ 41.176631] driver_register+0x74/0x120
[ 41.182280] __platform_driver_register+0x24/0x30
[ 41.188797] 0xffffffc000cb1074
[ 41.193754] do_one_initcall+0x70/0x2cc
[ 41.199403] do_init_module+0x44/0x240
[ 41.204968] load_module+0x1f5c/0x2874
[ 41.210532] __do_sys_init_module+0x1d8/0x2ac
[ 41.216702] __arm64_sys_init_module+0x18/0x20
[ 41.222958] invoke_syscall.constprop.0+0x4c/0xe0
[ 41.229474] do_el0_svc+0x50/0xf0
[ 41.234602] el0_svc+0x4c/0xcc
[ 41.239471] el0t_64_sync_handler+0xe0/0x110
[ 41.245556] el0t_64_sync+0x15c/0x160
[ 41.251029] IN-SOFTIRQ-W at:
[ 41.254249] lock_acquire+0xfc/0x2c0
[ 41.259638] _raw_spin_lock_bh+0x84/0xa0
[ 41.265372] mt76_queue_tx_complete+0x34/0x70 [mt76]
[ 41.272170] mt76_free_pending_rxwi+0x36c/0x5d0 [mt76]
[ 41.279140] mt76_free_pending_rxwi+0x5c0/0x5d0 [mt76]
[ 41.286111] mt7915_eeprom_get_power_delta+0x620/0x2464 [mt7915e]
[ 41.294026] __napi_poll.constprop.0+0x5c/0x230
[ 41.300372] net_rx_action+0xe4/0x294
[ 41.305847] _stext+0x154/0x4cc
[ 41.310801] do_softirq+0xa4/0xbc
[ 41.315930] __local_bh_enable_ip+0x168/0x174
[ 41.322097] napi_threaded_poll+0xbc/0x140
[ 41.328007] kthread+0x13c/0x150
[ 41.333049] ret_from_fork+0x10/0x20
[ 41.338437] INITIAL USE at:
[ 41.341568] lock_acquire+0xfc/0x2c0
[ 41.346869] _raw_spin_lock_bh+0x84/0xa0
[ 41.352519] mt76_dma_cleanup+0x24c/0x650 [mt76]
[ 41.358882] mt76_dma_cleanup+0x614/0x650 [mt76]
[ 41.365245] mt7915_eeprom_get_power_delta+0x1168/0x2464 [mt7915e]
[ 41.373160] mt7915_eeprom_init+0x40/0x340 [mt7915e]
[ 41.379860] cleanup_module+0x94/0xb28 [mt7915e]
[ 41.386213] platform_probe+0x64/0xbc
[ 41.391602] really_probe.part.0+0x98/0x2f4
[ 41.397511] __driver_probe_device+0x94/0x16c
[ 41.403594] driver_probe_device+0x40/0x120
[ 41.409502] __driver_attach+0x94/0x190
[ 41.415063] bus_for_each_dev+0x5c/0x94
[ 41.420625] driver_attach+0x20/0x30
[ 41.425926] bus_add_driver+0x104/0x1f4
[ 41.431487] driver_register+0x74/0x120
[ 41.437049] __platform_driver_register+0x24/0x30
[ 41.443479] 0xffffffc000cb1074
[ 41.448346] do_one_initcall+0x70/0x2cc
[ 41.453907] do_init_module+0x44/0x240
[ 41.459383] load_module+0x1f5c/0x2874
[ 41.464860] __do_sys_init_module+0x1d8/0x2ac
[ 41.470944] __arm64_sys_init_module+0x18/0x20
[ 41.477113] invoke_syscall.constprop.0+0x4c/0xe0
[ 41.483542] do_el0_svc+0x50/0xf0
[ 41.488582] el0_svc+0x4c/0xcc
[ 41.493364] el0t_64_sync_handler+0xe0/0x110
[ 41.499361] el0t_64_sync+0x15c/0x160
[ 41.504748] }
[ 41.506489] ... key at: [<ffffffc000c65ba0>] __this_module+0x3e0/0xffffffffffffa840 [mt76]
[ 41.515371] ... acquired at:
[ 41.518413] _raw_spin_lock+0x60/0x74
[ 41.522240] mt76_get_rxwi+0x1c/0xac [mt76]
[ 41.526608] mt76_dma_cleanup+0x3e0/0x650 [mt76]
[ 41.531410] mt76_dma_cleanup+0x614/0x650 [mt76]
[ 41.536211] mt7915_dma_init+0x408/0x7b0 [mt7915e]
[ 41.541177] mt7915_register_device+0x310/0x620 [mt7915e]
[ 41.546749] mt7915_mmio_probe+0xcec/0x1d44 [mt7915e]
[ 41.551973] platform_probe+0x64/0xbc
[ 41.555802] really_probe.part.0+0x98/0x2f4
[ 41.560149] __driver_probe_device+0x94/0x16c
[ 41.564670] driver_probe_device+0x40/0x120
[ 41.569017] __driver_attach+0x94/0x190
[ 41.573019] bus_for_each_dev+0x5c/0x94
[ 41.577018] driver_attach+0x20/0x30
[ 41.580758] bus_add_driver+0x104/0x1f4
[ 41.584758] driver_register+0x74/0x120
[ 41.588759] __platform_driver_register+0x24/0x30
[ 41.593628] init_module+0x74/0x1000 [mt7915e]
[ 41.598248] do_one_initcall+0x70/0x2cc
[ 41.602248] do_init_module+0x44/0x240
[ 41.606162] load_module+0x1f5c/0x2874
[ 41.610078] __do_sys_init_module+0x1d8/0x2ac
[ 41.614600] __arm64_sys_init_module+0x18/0x20
[ 41.619209] invoke_syscall.constprop.0+0x4c/0xe0
[ 41.624076] do_el0_svc+0x50/0xf0
[ 41.627555] el0_svc+0x4c/0xcc
[ 41.630776] el0t_64_sync_handler+0xe0/0x110
[ 41.635211] el0t_64_sync+0x15c/0x160
[ 41.639037]
[ 41.640517] -> (&dev->wed_lock){+.+.}-{2:2} {
[ 41.644872] HARDIRQ-ON-W at:
[ 41.648003] lock_acquire+0xfc/0x2c0
[ 41.653219] _raw_spin_lock+0x60/0x74
[ 41.658520] mt76_free_pending_rxwi+0xc0/0x5d0 [mt76]
[ 41.665232] mt76_dma_cleanup+0x1dc/0x650 [mt76]
[ 41.671508] mt7915_eeprom_get_power_delta+0x1830/0x2464 [mt7915e]
[ 41.679336] mt7915_unregister_device+0x5b4/0x910 [mt7915e]
[ 41.686555] mt7915_eeprom_get_target_power+0xb8/0x230 [mt7915e]
[ 41.694209] mt7986_wmac_enable+0xc30/0xcd0 [mt7915e]
[ 41.700909] platform_remove+0x4c/0x64
[ 41.706298] __device_release_driver+0x194/0x240
[ 41.712554] driver_detach+0xc0/0x100
[ 41.717857] bus_remove_driver+0x54/0xac
[ 41.723418] driver_unregister+0x2c/0x54
[ 41.728980] platform_driver_unregister+0x10/0x20
[ 41.735323] mt7915_ops+0x244/0xffffffffffffed58 [mt7915e]
[ 41.742457] __arm64_sys_delete_module+0x170/0x23c
[ 41.748887] invoke_syscall.constprop.0+0x4c/0xe0
[ 41.755229] do_el0_svc+0x50/0xf0
[ 41.760183] el0_svc+0x4c/0xcc
[ 41.764878] el0t_64_sync_handler+0xe0/0x110
[ 41.770788] el0t_64_sync+0x15c/0x160
[ 41.776088] SOFTIRQ-ON-W at:
[ 41.779220] lock_acquire+0xfc/0x2c0
[ 41.784435] _raw_spin_lock+0x60/0x74
[ 41.789737] mt76_get_rxwi+0x1c/0xac [mt76]
[ 41.795580] mt7915_debugfs_rx_log+0x804/0xb74 [mt7915e]
[ 41.802540] mtk_wed_start+0x970/0xaa0
[ 41.807929] mt7915_dma_start+0x26c/0x630 [mt7915e]
[ 41.814455] mt7915_dma_start+0x5a4/0x630 [mt7915e]
[ 41.820981] mt7915_dma_init+0x45c/0x7b0 [mt7915e]
[ 41.827420] mt7915_register_device+0x310/0x620 [mt7915e]
[ 41.834467] mt7915_mmio_probe+0xcec/0x1d44 [mt7915e]
[ 41.841167] platform_probe+0x64/0xbc
[ 41.846469] really_probe.part.0+0x98/0x2f4
[ 41.852291] __driver_probe_device+0x94/0x16c
[ 41.858286] driver_probe_device+0x40/0x120
[ 41.864107] __driver_attach+0x94/0x190
[ 41.869582] bus_for_each_dev+0x5c/0x94
[ 41.875056] driver_attach+0x20/0x30
[ 41.880270] bus_add_driver+0x104/0x1f4
[ 41.885745] driver_register+0x74/0x120
[ 41.891221] __platform_driver_register+0x24/0x30
[ 41.897564] init_module+0x74/0x1000 [mt7915e]
[ 41.903657] do_one_initcall+0x70/0x2cc
[ 41.909130] do_init_module+0x44/0x240
[ 41.914520] load_module+0x1f5c/0x2874
[ 41.919909] __do_sys_init_module+0x1d8/0x2ac
[ 41.925905] __arm64_sys_init_module+0x18/0x20
[ 41.931989] invoke_syscall.constprop.0+0x4c/0xe0
[ 41.938331] do_el0_svc+0x50/0xf0
[ 41.943285] el0_svc+0x4c/0xcc
[ 41.947981] el0t_64_sync_handler+0xe0/0x110
[ 41.953892] el0t_64_sync+0x15c/0x160
[ 41.959192] INITIAL USE at:
[ 41.962238] lock_acquire+0xfc/0x2c0
[ 41.967365] _raw_spin_lock+0x60/0x74
[ 41.972580] mt76_free_pending_rxwi+0xc0/0x5d0 [mt76]
[ 41.979206] mt76_dma_cleanup+0x1dc/0x650 [mt76]
[ 41.985395] mt7915_eeprom_get_power_delta+0x1830/0x2464 [mt7915e]
[ 41.993137] mt7915_unregister_device+0x5b4/0x910 [mt7915e]
[ 42.000270] mt7915_eeprom_get_target_power+0xb8/0x230 [mt7915e]
[ 42.007837] mt7986_wmac_enable+0xc30/0xcd0 [mt7915e]
[ 42.014450] platform_remove+0x4c/0x64
[ 42.019753] __device_release_driver+0x194/0x240
[ 42.025922] driver_detach+0xc0/0x100
[ 42.031137] bus_remove_driver+0x54/0xac
[ 42.036612] driver_unregister+0x2c/0x54
[ 42.042087] platform_driver_unregister+0x10/0x20
[ 42.048344] mt7915_ops+0x244/0xffffffffffffed58 [mt7915e]
[ 42.055391] __arm64_sys_delete_module+0x170/0x23c
[ 42.061735] invoke_syscall.constprop.0+0x4c/0xe0
[ 42.067990] do_el0_svc+0x50/0xf0
[ 42.072857] el0_svc+0x4c/0xcc
[ 42.077466] el0t_64_sync_handler+0xe0/0x110
[ 42.083289] el0t_64_sync+0x15c/0x160
[ 42.088503] }
[ 42.090157] ... key at: [<ffffffc000c65c10>] __this_module+0x450/0xffffffffffffa840 [mt76]
[ 42.098951] ... acquired at:
[ 42.101907] __lock_acquire+0x718/0x1df0
[ 42.105994] lock_acquire+0xfc/0x2c0
[ 42.109734] _raw_spin_lock+0x60/0x74
[ 42.113561] mt76_get_rxwi+0x1c/0xac [mt76]
[ 42.117929] mt7915_debugfs_rx_log+0x804/0xb74 [mt7915e]
[ 42.123415] mtk_wed_start+0x970/0xaa0
[ 42.127328] mt7915_dma_start+0x26c/0x630 [mt7915e]
[ 42.132379] mt7915_dma_start+0x5a4/0x630 [mt7915e]
[ 42.137430] mt7915_dma_init+0x45c/0x7b0 [mt7915e]
[ 42.142395] mt7915_register_device+0x310/0x620 [mt7915e]
[ 42.147967] mt7915_mmio_probe+0xcec/0x1d44 [mt7915e]
[ 42.153192] platform_probe+0x64/0xbc
[ 42.157019] really_probe.part.0+0x98/0x2f4
[ 42.161367] __driver_probe_device+0x94/0x16c
[ 42.165887] driver_probe_device+0x40/0x120
[ 42.170234] __driver_attach+0x94/0x190
[ 42.174235] bus_for_each_dev+0x5c/0x94
[ 42.178235] driver_attach+0x20/0x30
[ 42.181974] bus_add_driver+0x104/0x1f4
[ 42.185974] driver_register+0x74/0x120
[ 42.189974] __platform_driver_register+0x24/0x30
[ 42.194842] init_module+0x74/0x1000 [mt7915e]
[ 42.199460] do_one_initcall+0x70/0x2cc
[ 42.203460] do_init_module+0x44/0x240
[ 42.207376] load_module+0x1f5c/0x2874
[ 42.211290] __do_sys_init_module+0x1d8/0x2ac
[ 42.215813] __arm64_sys_init_module+0x18/0x20
[ 42.220421] invoke_syscall.constprop.0+0x4c/0xe0
[ 42.225288] do_el0_svc+0x50/0xf0
[ 42.228768] el0_svc+0x4c/0xcc
[ 42.231989] el0t_64_sync_handler+0xe0/0x110
[ 42.236424] el0t_64_sync+0x15c/0x160
[ 42.240249]
[ 42.241730]
[ 42.241730] stack backtrace:
[ 42.246074] CPU: 1 PID: 2329 Comm: insmod Not tainted 5.15.127 #0
[ 42.252157] Hardware name: GainStrong Oolite-MT7981B V1 Dev Board (NAND boot) (DT)
[ 42.259712] Call trace:
[ 42.262147] dump_backtrace+0x0/0x174
[ 42.265802] show_stack+0x14/0x20
[ 42.269108] dump_stack_lvl+0x84/0xac
[ 42.272761] dump_stack+0x14/0x2c
[ 42.276066] print_irq_inversion_bug.part.0+0x1b0/0x1c4
[ 42.281285] mark_lock+0x8b8/0x8bc
[ 42.284678] __lock_acquire+0x718/0x1df0
[ 42.288592] lock_acquire+0xfc/0x2c0
[ 42.292158] _raw_spin_lock+0x60/0x74
[ 42.295811] mt76_get_rxwi+0x1c/0xac [mt76]
[ 42.300008] mt7915_debugfs_rx_log+0x804/0xb74 [mt7915e]
[ 42.305320] mtk_wed_start+0x970/0xaa0
[ 42.309059] mt7915_dma_start+0x26c/0x630 [mt7915e]
[ 42.313937] mt7915_dma_start+0x5a4/0x630 [mt7915e]
[ 42.318815] mt7915_dma_init+0x45c/0x7b0 [mt7915e]
[ 42.323606] mt7915_register_device+0x310/0x620 [mt7915e]
[ 42.329005] mt7915_mmio_probe+0xcec/0x1d44 [mt7915e]
[ 42.334056] platform_probe+0x64/0xbc
[ 42.337711] really_probe.part.0+0x98/0x2f4
[ 42.341885] __driver_probe_device+0x94/0x16c
[ 42.346232] driver_probe_device+0x40/0x120
[ 42.350407] __driver_attach+0x94/0x190
[ 42.354234] bus_for_each_dev+0x5c/0x94
[ 42.358061] driver_attach+0x20/0x30
[ 42.361627] bus_add_driver+0x104/0x1f4
[ 42.365454] driver_register+0x74/0x120
[ 42.369282] __platform_driver_register+0x24/0x30
[ 42.373977] init_module+0x74/0x1000 [mt7915e]
[ 42.378423] do_one_initcall+0x70/0x2cc
[ 42.382249] do_init_module+0x44/0x240
[ 42.385990] load_module+0x1f5c/0x2874
[ 42.389733] __do_sys_init_module+0x1d8/0x2ac
[ 42.394082] __arm64_sys_init_module+0x18/0x20
[ 42.398518] invoke_syscall.constprop.0+0x4c/0xe0
[ 42.403211] do_el0_svc+0x50/0xf0
[ 42.406517] el0_svc+0x4c/0xcc
[ 42.409565] el0t_64_sync_handler+0xe0/0x110
[ 42.413827] el0t_64_sync+0x15c/0x160
[ 42.674858] mt798x-wmac 18000000.wifi: HW/SW Version: 0x8a108a10, Build Time: 20221208201745a
[ 42.674858]
[ 42.692078] mt798x-wmac 18000000.wifi: WM Firmware Version: ____000000, Build Time: 20221208201806
[ 42.735606] mt798x-wmac 18000000.wifi: WA Firmware Version: DEV_000000, Build Time: 20221208202048
Tested-by: Daniel Golle <daniel@makrotopia.org>
Fixes: 2666bece0905 ("wifi: mt76: introduce rxwi and rx token utility routines")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/ee80be41c2a8d8749d83c6950a272a5e77aadd45.1693228333.git.lorenzo@kernel.org
|
|
Stop WFDMA transaction to avoid potential unexpected issue while doing
system recovery.
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Improves performance by using bulk allocation
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
According to the documentation, ieee80211_rx_list must not run concurrently
with ieee80211_tx_status (or its variants).
Cc: stable@vger.kernel.org
Fixes: 88046b2c9f6d ("mt76: add support for reporting tx status with skb")
Reported-by: Brian Coverstone <brian@mainsequence.net>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
The scatter and gather frame may be incorrect because WED and WO may
send frames to host driver interleaved.
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce mt7915_mmio_wed_reset_complete and
mt7915_mmio_wed_reset_complete callbacks and the related wait
queues in order to wait for wed reset completion during wlan reset.
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This is a preliminary patch to introduce proper wed reset support.
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Export mt76_dma_wed_setup routine. This is a preliminary patch to
introduce proper wed reset support.
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Free rxwi cache releasing WED rx buffers in mt7915_wed_release_rx_buf
routine
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
In order to reduce possible memory allocation failures due to memory
fragmentation caused by page_frag_cache allocator, switch to page_pool
allocator for dma and usb mt76 drivers.
Remove per rx-queue page_frag_cache
Co-developed-by: Felix Fietkau <nbd@nbd.name>
Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Fix device unregister memory leak and alway cleanup all configured
rx queues in mt76_dma_tx_cleanup routine.
Fixes: 52546e27787e ("wifi: mt76: add WED RX support to dma queue alloc")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Free rx_head skb in mt76_dma_rx_cleanup routine in order to avoid
possible memory leak at module unload.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This patch does not change any logic, just improve code readability.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Due to the two cherry picked commits from wireless to wireless-next we have
several conflicts in mt76. To avoid any bugs with conflicts merge wireless into
wireless-next.
96f134dc1964 wifi: mt76: handle possible mt76_rx_token_consume failures
fe13dad8992b wifi: mt76: dma: do not increment queue head if mt76_dma_add_buf fails
|
|
When adding WED support, mt76_dma_add_buf was accidentally changed to set
the skip_buf0 flag for tx buffers on the wrong queue descriptor entry.
Additionally, there is a rxwi leak when rx buffer allocation fails.
Fix this and make the code more readable by adding a separate function for
adding rx buffers.
Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Link: https://lore.kernel.org/r/CABXGCsMEnQd=gYKTd1knRsWuxCb=Etv5nAre%2BXJS_s5FgVteYA@mail.gmail.com/
Reported-by: Mike Lothian <mike@fireburn.co.uk>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216829
Reported-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/lkml/20230112171706.294550-1-angelogioacchino.delregno@collabora.com/
Fixes: cd372b8c99c5 ("wifi: mt76: add WED RX support to mt76_dma_{add,get}_buf")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230113105848.34642-3-nbd@nbd.name
|
|
Take into account possible error conditions of mt76_rx_token_consume
routine in mt7915_mmio_wed_init_rx_buf() and mt76_dma_add_buf()
Fixes: cd372b8c99c5 ("wifi: mt76: add WED RX support to mt76_dma_{add,get}_buf")
Fixes: 4f831d18d12d ("wifi: mt76: mt7915: enable WED RX support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 96f134dc19645be4994e89a2f68fa89309becbee)
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230113105848.34642-2-nbd@nbd.name
|
|
Do not increment queue head if mt76_dma_add_buf fails for Wireless
Ethernet Dispatcher rx queues.
Fixes: cd372b8c99c5 ("wifi: mt76: add WED RX support to mt76_dma_{add,get}_buf")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit fe13dad8992be0b26c1be390bcd111acf9892c17)
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230113105848.34642-1-nbd@nbd.name
|
|
mt76 patches for 6.2
- fixes
- per-PHY LED support
|
|
Since mt76_dma_rx_fill() acquires mt76_queue spinlock, rely on mt76_queue
page_frag_cache in mt76_dma_rx_fill() instead of wed rx_buf_ring
page_frag_cache. Get rid of mt76_dma_rx_get_frag_cache since it is no
longer used.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Take into account possible error conditions of mt76_rx_token_consume
routine in mt7915_mmio_wed_init_rx_buf() and mt76_dma_add_buf()
Fixes: cd372b8c99c5 ("wifi: mt76: add WED RX support to mt76_dma_{add,get}_buf")
Fixes: 4f831d18d12d ("wifi: mt76: mt7915: enable WED RX support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Do not increment queue head if mt76_dma_add_buf fails for Wireless
Ethernet Dispatcher rx queues.
Fixes: cd372b8c99c5 ("wifi: mt76: add WED RX support to mt76_dma_{add,get}_buf")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This patch adds reset parameter to mtk_wed_rx_ring_setup signature
in order to align rx_ring_setup callback to tx_ring_setup one introduced
in 'commit 23dca7a90017 ("net: ethernet: mtk_wed: add reset to
tx_ring_setup callback")'
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/29c6e7a5469e784406cf3e2920351d1207713d05.1670239984.git.lorenzo@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next
Kalle Valo says:
====================
wireless-next patches for v6.2
Third set of patches for v6.2. mt76 has a new driver for mt7996 Wi-Fi 7
devices and iwlwifi also got initial Wi-Fi 7 support. Otherwise
smaller features and fixes.
Major changes:
ath10k
- store WLAN firmware version in SMEM image table
mt76
- mt7996: new driver for MediaTek Wi-Fi 7 (802.11be) devices
- mt7986, mt7915: enable Wireless Ethernet Dispatch (WED) offload support
- mt7915: add ack signal support
- mt7915: enable coredump support
- mt7921: remain_on_channel support
- mt7921: channel context support
iwlwifi
- enable Wi-Fi 7 Extremely High Throughput (EHT) PHY capabilities
- 320 MHz channels support
* tag 'wireless-next-2022-12-02' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (144 commits)
wifi: ath10k: fix QCOM_SMEM dependency
wifi: mt76: mt7921e: add pci .shutdown() support
wifi: mt76: mt7915: mmio: fix naming convention
wifi: mt76: mt7996: add support to configure spatial reuse parameter set
wifi: mt76: mt7996: enable ack signal support
wifi: mt76: mt7996: enable use_cts_prot support
wifi: mt76: mt7915: rely on band_idx of mt76_phy
wifi: mt76: mt7915: enable per bandwidth power limit support
wifi: mt76: mt7915: introduce mt7915_get_power_bound()
mt76: mt7915: Fix PCI device refcount leak in mt7915_pci_init_hif2()
wifi: mt76: do not send firmware FW_FEATURE_NON_DL region
wifi: mt76: mt7921: Add missing __packed annotation of struct mt7921_clc
wifi: mt76: fix coverity overrun-call in mt76_get_txpower()
wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices
wifi: mt76: mt76x0: remove dead code in mt76x0_phy_get_target_power
wifi: mt76: mt7915: fix band_idx usage
wifi: mt76: mt7915: enable .sta_set_txpwr support
wifi: mt76: mt7915: add basedband Txpower info into debugfs
wifi: mt76: mt7915: add support to configure spatial reuse parameter set
wifi: mt76: mt7915: add missing MODULE_PARM_DESC
...
====================
Link: https://lore.kernel.org/r/20221202214254.D0D3DC433C1@smtp.kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
This is a preliminary patch to introduce WED RX support for mt7915.
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce the capability to allocate WED RX buffers in
mt76_dma_wed_setup routine.
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce the capability to refill WED RX buffers in mt76_dma_rx_fill
utility routine.
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce the capability to configure RX WED in mt76_dma_{add,get}_buf
utility routines.
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This is a preliminary patch to introduce WED RX support for mt7915.
Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce reset parameter to mtk_wed_tx_ring_setup signature.
This is a preliminary patch to add Wireless Ethernet Dispatcher reset
support.
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
Checking the relevant rxd bits for the checksum information only indicates
if the checksum verification was performed by the hardware and doesn't show
actual checksum errors. Checksum errors are indicated in the info field of
the DMA descriptor. Fix packets erroneously marked as CHECKSUM_UNNECESSARY
by checking the extra bits as well.
Those bits are only passed to the driver for MMIO devices at the moment, so
limit checksum offload to those.
Fixes: 2122dfbfd0bd ("mt76: mt7615: add rx checksum offload support")
Fixes: 94244d2ea503 ("mt76: mt7915: add rx checksum offload support")
Fixes: 0e75732764e8 ("mt76: mt7921: enable rx csum offload")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221005130824.23371-2-nbd@nbd.name
|
|
We tell driver developers to always pass NAPI_POLL_WEIGHT
as the weight to netif_napi_add(). This may be confusing
to newcomers, drop the weight argument, those who really
need to tweak the weight can use netif_napi_add_weight().
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> # for CAN
Link: https://lore.kernel.org/r/20220927132753.750069-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|