Commit Graph
2577 Commits
Author SHA1 Message Date
Felix Fietkau 0fc2136a61 mt76_connac_mcu: move mt76_connac_mcu_update_arp_filter outside of CONFIG_PM
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-05 13:03:28 +02:00
Lorenzo BianconiandFelix Fietkau e5b19336c5 mt76: mt7615: do not set MT76_STATE_PM at bootstrap
Remove MT76_STATE_PM in mt7615_init_device() and introduce
__mt7663s_mcu_drv_pmctrl for fw loading in mt7663s.
This patch fixes a crash at bootstrap for device (e.g. mt7622) that do
not support runtime-pm

Fixes: 129fac01ffe85 ("mt76: connac: introduce wake counter for fw_pmctrl synchronization")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-29 13:18:09 +02:00
Lorenzo BianconiandFelix Fietkau 23fe1bdcf1 mt76: connac: do not schedule mac_work if the device is not running
Do not run ieee80211_queue_delayed_work for mac work if the worqueue is
not initialized yet

Fixes: b1bd7bb8121d ("mt76: connac: unschedule mac_work before going to sleep")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-23 16:41:16 +02:00
Lorenzo BianconiandFelix Fietkau 53d915a23b mt76: connac: do not schedule wake_work if the runtime-pm is disabled
Fix the following crash due to a call to mt7921_pm_wake_work if the
device has pm disabled or does not support runtime-pm

[    8.412590] mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build
[    8.413660] WARNING: CPU: 0 PID: 20 at __queue_delayed_work+0x84/0xb0
[    8.481831] CPU: 0 PID: 20 Comm: kworker/u4:1 Not tainted 5.10.31 #0
[    8.488175] Hardware name: MediaTek MT7622 RFB1 board (DT)
[    8.493663] Workqueue: mt76 mt7921_pm_wake_work [mt7921e]
[    8.499055] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
[    8.505052] pc : __queue_delayed_work+0x84/0xb0
[    8.509574] lr : queue_delayed_work_on+0x54/0x78
[    8.514180] sp : ffffffc010bcbd20
[    8.517485] x29: ffffffc010bcbd20 x28: 0000000000000000
[    8.522790] x27: ffffff800015a148 x26: ffffffc0108acae0
[    8.528094] x25: 0000000000000000 x24: ffffff80056b4208
[    8.533399] x23: ffffff80056b26e0 x22: ffffff80056b26e0
[    8.538703] x21: ffffff80056b45f8 x20: ffffff80056b5dc8
[    8.544006] x19: 0000000000000000 x18: 000000000000000e
[    8.549310] x17: 0000000000000001 x16: 0000000000000019
[    8.554614] x15: 0000000000000033 x14: ffffffffffffffff
[    8.559919] x13: ffffffffffffffff x12: 0000000000000000
[    8.565223] x11: 0000000000000040 x10: 0000000000000820
[    8.570528] x9 : 0000b3c738feafd6 x8 : ffffff801feb7c80
[    8.575832] x7 : ffffff80056b4808 x6 : 0000000000000000
[    8.581136] x5 : ffffff80056b2888 x4 : 0000000fffffffe0
[    8.586441] x3 : 000000000000003e x2 : ffffff80056b2868
[    8.591745] x1 : 0000000000000000 x0 : 0000000000000002
[    8.597049] Call trace:
[    8.599488]  __queue_delayed_work+0x84/0xb0
[    8.603662]  queue_delayed_work_on+0x54/0x78
[    8.607947]  ieee80211_queue_delayed_work+0x30/0x50 [mac80211]
[    8.613774]  mt7921_pm_wake_work+0xa0/0xe0 [mt7921e]
[    8.618730]  process_one_work+0x1fc/0x398
[    8.622730]  worker_thread+0x150/0x4e0
[    8.626472]  kthread+0x120/0x128
[    8.629693]  ret_from_fork+0x10/0x18

Fixes: 129fac01ffe85 ("mt76: connac: introduce wake counter for fw_pmctrl synchronization")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-23 16:41:16 +02:00
Lorenzo BianconiandFelix Fietkau 92fb81e085 mt76: mt7921: fix possible AOOB issue in mt7921_mcu_tx_rate_report
Fix possible array out of bound access in mt7921_mcu_tx_rate_report.
Remove unnecessary varibable in mt7921_mcu_tx_rate_report

Fixes: 1c099ab44727c ("mt76: mt7921: add MCU support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-23 16:41:16 +02:00
Lorenzo BianconiandFelix Fietkau ed41ed73a4 mt76: mt7921: reinit wpdma during drv_own if necessary
Check dummy reg to reinitialized WPDMA during driver_own operation

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 17:33:55 +02:00
Lorenzo BianconiandFelix Fietkau 757af5c67d mt76: move mt76_token_init in mt76_alloc_device
In order to remove duplicated code, move mt76_token_init in
mt76_alloc_device routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 17:33:55 +02:00
Dan CarpenterandFelix Fietkau aaf0d254f9 mt76: mt7921: fix a precision vs width bug in printk
Precision %.*s was intended instead of width %*s.  The original code
is potentially an information leak.

Fixes: c7cc5ec57303 ("mt76: mt7921: rework mt7921_mcu_debug_msg_event routine")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 17:33:55 +02:00
Dan CarpenterandFelix Fietkau ded14da5ea mt76: mt7915: fix a precision vs width bug in printk
Precision %.*s was intended instead of width %*s.  The original code
will still print unintended data from beyond the end of skb->data.

Fixes: 665b2c780d63 ("mt76: mt7915: limit firmware log message printk to buffer length")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 17:33:55 +02:00
Dan CarpenterandFelix Fietkau 3c5bf837fd mt76: mt7615: fix a precision vs width bug in printk
Precision "%.*s" was intended instead of width "%*s".  The original code
will print garbage from beyond the end of the skb->data.

Fixes: d76d6c3ba2b0 ("mt76: mt7615: limit firmware log message printk to buffer length")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 17:33:55 +02:00
Lorenzo BianconiandFelix Fietkau 63d80b9ab2 mt76: mt7921: introduce mt7921_mcu_sta_add routine
mt7921_mcu_sta_add will be used to add and remove wtbl entries.
Create broadcast wtbl entry after AP association

Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:31:57 +02:00
Sean WangandFelix Fietkau 98a235004d mt76: mt7921: mt7921_stop should put device in fw_own state
mt7921_stop should put device in fw_own state to reduce
power consumption.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau 349bbb9d6f mt76: connac: unschedule mac_work before going to sleep
In order to wake the device less frequently and so reduce power
consumpation, unschedule mac_work before going to sleep

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau 2ae25c7e54 mt76: mt7663: add awake and doze time accounting
Similar to mt7921, introduce awake and doze time accounting
for runtime pm.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau d325b7eff1 mt76: mt7921: improve doze opportunity
Increase mt7921 mac work timeout in oder to have move sleep
opportunities

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau 2126b21763 mt76: mt7921: get rid of mcu_reset function pointer
since mcu_reset it used only by mt7921, move the reset callback to
mt7921_mcu_parse_response routine and get rid of the function pointer.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Shayne ChenandFelix Fietkau fb04d9df5e mt76: mt7915: do not read rf value from efuse in flash mode
Do not read rf value from efuse when driver is configured to
use flash mode.

Tested-by: Bruce Chuang <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau 8d5c456be1 mt76: move token utilities in mt76 common module
Move token management in mt76 common module since it is shared between
mt7615, mt7915 and mt7921 drivers

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau ade1f5aad4 mt76: move token_lock, token and token_count in mt76_dev
Move token_lock, token and token_count data structures in mt76_dev.
This is a preliminary patch to move token management in mt76 common
module since it is shared by mt7615, mt7915 and mt7921 drivers.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Sean WangandFelix Fietkau 3c19f569cc mt76: mt7921: fix possible invalid register access
Disable the interrupt and synchronze for the pending irq handlers to ensure
the irq tasklet is not being scheduled after the suspend to avoid the
possible invalid register access acts when the host pcie controller is
suspended.

[17932.910534] mt7921e 0000:01:00.0: pci_pm_suspend+0x0/0x22c returned 0 after 21375 usecs
[17932.910590] pcieport 0000:00:00.0: calling pci_pm_suspend+0x0/0x22c @ 18565, parent: pci0000:00
[17932.910602] pcieport 0000:00:00.0: pci_pm_suspend+0x0/0x22c returned 0 after 8 usecs
[17932.910671] mtk-pcie 11230000.pcie: calling platform_pm_suspend+0x0/0x60 @ 22783, parent: soc
[17932.910674] mtk-pcie 11230000.pcie: platform_pm_suspend+0x0/0x60 returned 0 after 0 usecs

...

17933.615352] x1 : 00000000000d4200 x0 : ffffff8269ca2300
[17933.620666] Call trace:
[17933.623127]  mt76_mmio_rr+0x28/0xf0 [mt76]
[17933.627234]  mt7921_rr+0x38/0x44 [mt7921e]
[17933.631339]  mt7921_irq_tasklet+0x54/0x1d8 [mt7921e]
[17933.636309]  tasklet_action_common+0x12c/0x16c
[17933.640754]  tasklet_action+0x24/0x2c
[17933.644418]  __do_softirq+0x16c/0x344
[17933.648082]  irq_exit+0xa8/0xac
[17933.651224]  scheduler_ipi+0xd4/0x148
[17933.654890]  handle_IPI+0x164/0x2d4
[17933.658379]  gic_handle_irq+0x140/0x178
[17933.662216]  el1_irq+0xb8/0x180
[17933.665361]  cpuidle_enter_state+0xf8/0x204
[17933.669544]  cpuidle_enter+0x38/0x4c
[17933.673122]  do_idle+0x1a4/0x2a8
[17933.676352]  cpu_startup_entry+0x24/0x28
[17933.680276]  rest_init+0xd4/0xe0
[17933.683508]  arch_call_rest_init+0x10/0x18
[17933.687606]  start_kernel+0x340/0x3b4
[17933.691279] Code: aa0003f5 d503201f f953eaa8 8b344108 (b9400113)
[17933.697373] ---[ end trace a24b8e26ffbda3c5 ]---
[17933.767846] Kernel panic - not syncing: Fatal exception in interrupt

Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Sean WangandFelix Fietkau 0dbb16ef39 mt76: mt7921: enable deep sleep when the device suspends
Enable the deep sleep mode in suspend handler to reduce the power
consumption further.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Sean WangandFelix Fietkau 614efe9e91 mt76: connac: introduce mt76_connac_mcu_set_deep_sleep utility
Introduce mt76_connac_mcu_set_deep_sleep to enable deep sleep mode
and will be activated immediately when the host returns the ownership
to the device.

Co-developed-by: Leon Yen <[email protected]>
Signed-off-by: Leon Yen <[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-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau 662a89f2b9 mt76: mt7921: introduce mt7921_wpdma_reinit_cond utility routine
Add mt7921_wpdma_reinit_cond to check dummy reg if driver needs to
reinitialized WPDMA after driver_own operation

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-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau 2ac7c7e9c5 mt76: mt7921: introduce mt7921_dma_{enable,disable} utilities
Introduce mt7921_dma_enable and mt7921_dma_disable utilities routine in
order for code reusing between mt7921_dma_reset and mt7921_dma_init.
This is a preliminary patch to reset dma during device driver_own
request.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau c9dd6b1fa1 mt76: mt7921: introduce mt7921_wpdma_reset utility routine
Introduce mt7921_wpdma_reset routine to reset wpdma during chip reset
or driver_own request.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau 7e25214687 mt76: mt7921: move mt7921_dma_reset in dma.c
Move mt7921_dma_reset routine in dma.c and make mt7921_dma_prefetch
static. Moreover add force parameter to mt7921_dma_reset signature.
This is a preliminary patch to reset dma mt7921_mcu_drv_pmctrl.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Colin Ian KingandFelix Fietkau fd2ff64116 mt76: mt7615: Fix a dereference of pointer sta before it is null checked
Currently the assignment of idx dereferences pointer sta before
sta is null checked, leading to a potential null pointer dereference.
Fix this by assigning idx when it is required after the null check on
pointer sta.

Addresses-Coverity: ("Dereference before null check")
Fixes: a4a5a430b076 ("mt76: mt7615: fix TSF configuration")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Lorenzo BianconiandFelix Fietkau 45e0eefffe mt76: mt7921: enable sw interrupts
Enable sw interrupts in order to wake the device from deep sleep
receiving packets

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 0c2d3e7485 mt76: mt7921: add awake and doze time accounting
Introduce awake and doze time accounting for runtime pm.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau ca74a4cd07 mt76: remove MT76_STATE_PM in tx path
since tx/rx path is now relying pm ref counting, get rid of MT76_STATE_PM
check in the tx path

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau acfa78df57 mt76: connac: use waitqueue for runtime-pm
Simplify the code using a wait_queue_head_t instead of a completion to
wait the chip is fully awake in mt76_connac_pm_wake routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 0562380659 mt76: connac: do not run mt76_txq_schedule_all directly
In order to not break runtime-pm, do run mt76_txq_schedule_all in
mt7615_set_channel/mt7921_set_channel but rely on mt76_worker_schedule

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 4334f3e2fc mt76: mt7615: rely on pm refcounting in mt7615_led_set_config
Rely on mt76_connac_pm_ref/mt76_connac_pm_unref utility routines in
mt7615_led_set_config

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 112998f32d mt76: connac: alaways wake the device before scanning
move scanning check from mt76_connac_power_save_sched routine
to mt7921_pm_power_save_work/mt7615_pm_power_save_work ones

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 475112a3cd mt76: mt7921: get rid of useless MT76_STATE_PM in mt7921_mac_work
Remove useless MT76_STATE_PM check in mt7921_mac_work since
mt7921_mutex_acquire will wake up the device if necessary

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau e5d28e3cef mt76: connac: remove MT76_STATE_PM in mac_tx_free
Get rid of MT76_STATE_PM chec in mt7615_mac_tx_free and
mt7921_mac_tx_free since we already rely on mt76_connac_pm_unref in the
NAPI callback.
Remove mt76_connac_power_save_sched calls in mt7615_mac_tx_free and
mt7921_mac_tx_free

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 12115052a0 mt76: connac: check wake refcount in mcu_fw_pmctrl
In order to avoid synchronization races between tx and rx path, rely on
mt76_connac_skip_fw_pmctrl putting the chip in sleep mode for mt7921 and
mt7663 devices

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 325f7b451c mt76: connac: unschedule ps_work in mt76_connac_pm_wake
In order to avoid synchronization issues between wake and ps works,
cancel ps_work in mt76_connac_pm_wake routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 1bc5e67a60 mt76: mt7663: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx/rx napi
Introduce mt7615_poll_rx rx napi callback for mt7663.
Do not access device registers in tx/rx napi if the device is not awake.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 4f1339c9fb mt76: mt7921: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx/rx napi
Introduce mt7921_poll_rx rx napi callback for mt7921.
Do not access device registers in tx/rx napi if the device is not awake.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 51b3d1a9a2 mt76: dma: add the capability to define a custom rx napi poll routine
Add the capability to define a custom rx napi callback for each driver.
This is a preliminary patch to properly support runtime-pm on rx side

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 36f664edc7 mt76: mt7663: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx path
Introduce mt7615_tx_worker routine as mt76 tx worker callback for
mt7663.
Rely on mt76_connac_pm_ref/mt76_connac_pm_unref to check PM state and
increment/decrement wake counter

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 28c87e09a5 mt76: mt7921: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx path
Introduce mt7921_tx_worker routine as mt76 tx worker callback for
mt7921.
Rely on mt76_connac_pm_ref/mt76_connac_pm_unref to check PM state and
increment/decrement wake counter

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 74d0fdaa7a mt76: connac: introduce wake counter for fw_pmctrl synchronization
Introduce wake counter and related spinlock in order to synchronize
tx/rx path and fw_pmctrl request.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 2923e3e2b8 mt76: mt7663: fix a race between mt7615_mcu_drv_pmctrl and mt7615_mcu_fw_pmctrl
Introduce a mutex in order to avoid a race between mt7615_mcu_lp_drv_pmctrl and
mt7615_mcu_fw_pmctrl routines since they are run two independent works

Fixes: 1f549009b5b2 ("mt76: mt7615: do not request {driver,fw}_own if already granted")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau 1c0b6cb4f9 mt76: mt7921: fix a race between mt7921_mcu_drv_pmctrl and mt7921_mcu_fw_pmctrl
Introduce a mutex in order to avoid a race between mt7921_mcu_drv_pmctrl and
mt7921_mcu_fw_pmctrl routines since they are run two independent works

Fixes: 1d8efc741df8 ("mt76: mt7921: introduce Runtime PM support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 13:49:02 +02:00
Lorenzo BianconiandFelix Fietkau de26c73ce3 mt76: mt7921: remove leftover function declaration
Get rid of leftover mt7921_mcu_add_bss_info routine declaration

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 12:29:38 +02:00
Lorenzo BianconiandFelix Fietkau 0a139d7f59 mt76: connac: move mcu_update_arp_filter in mt76_connac module
Move mt76_connac_mcu_update_arp_filter in mt76_connac module since the
code is shared between mt7615 and mt7921

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 12:29:38 +02:00
Lorenzo BianconiandFelix Fietkau 90e4bfea29 mt76: mt7921: do not use 0 as NULL pointer
Fix the following sparse warning:
drivers/net/wireless/mediatek/mt76/mt7921/mac.c:1425:70:
  warning: Using plain integer as NULL pointer

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 12:29:38 +02:00
Junlin YangandFelix Fietkau ef96fafad8 mt76: Convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Junlin Yang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-04-17 11:27:04 +02:00