ath11k: qca6390: smaller new features and fixes
cover ath11k: qca6390: smaller new features and fixes
Few new features to improve QCA6390 PCI support and some bugfixes.
Ben Greear (1):
ath11k: support loading ELF board files
Carl Huang (1):
ath11k: fix AP mode for QCA6390
Govind Singh (1):
ath11k: Use GFP_ATOMIC instead of GFP_KERNEL in idr_alloc
Kalle Valo (3):
ath11k: add interface_modes to hw_params
ath11k: pci: check TCSR_SOC_HW_VERSION
ath11k: disable monitor mode on QCA6390
Wen Gong (2):
ath11k: change to disable softirqs for ath11k_regd_update to solve
deadlock
ath11k: Use GFP_ATOMIC instead of GFP_KERNEL in
ath11k_dp_htt_get_ppdu_desc
drivers/net/wireless/ath/ath11k/core.c | 14 ++++ drivers/net/wireless/ath/ath11k/dp.c | 3 +- drivers/net/wireless/ath/ath11k/dp_rx.c | 30 ++++----- drivers/net/wireless/ath/ath11k/dp_rx.h | 6 +- drivers/net/wireless/ath/ath11k/hw.h | 3 + drivers/net/wireless/ath/ath11k/mac.c | 115 ++++++++++++++++++++------------ drivers/net/wireless/ath/ath11k/pci.c | 46 +++++++++---- drivers/net/wireless/ath/ath11k/qmi.c | 12 +++- drivers/net/wireless/ath/ath11k/reg.c | 6 +- 9 files changed, 156 insertions(+), 79 deletions(-)
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 2/8 ath11k: fix AP mode for QCA6390
From: Carl Huang <[email protected]>
For QCA6390, station vdev needs to delay startup but not for AP mode. On AP mode vdev starts up immediately after bss peer is created in chanctx assignment context.
This patch does not affect IPQ8074 family of devices.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/mac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +4 -2
@@ -2994,7 +2994,8 @@ static int ath11k_mac_station_add(struct ath11k *ar, goto free_tx_stats; } -if (ab->hw_params.vdev_start_delay) { +if (ab->hw_params.vdev_start_delay && + arvif->vdev_type !=WMI_VDEV_TYPE_AP ) { ret =ath11k_start_vdev_delay (ar->hw, vif);if (ret) {ath11k_warn (ab,"failed to delay vdev start: %d\n" , ret);
@@ -5210,7 +5211,8 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, ctx, arvif->vdev_id);/* for QCA6390 bss peer must be created before vdev_start */ -if (ab->hw_params.vdev_start_delay) { +if (ab->hw_params.vdev_start_delay && + arvif->vdev_type !=WMI_VDEV_TYPE_AP ) {memcpy (&arvif->chanctx, ctx,sizeof (*ctx));mutex_unlock (&ar->conf_mutex);return 0 ;
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 1/8 ath11k: support loading ELF board files
In reply to Kalle ValoFrom: Ben Greear <[email protected]>
The QCA6390 board I have, model 8291M-PR comes with an ELF board file. To get this to at least somewhat work, I renamed bdwlan.e04 to 'board.bin' and then added this patch to check for ELF magic string in the beginning of the file. If that is found, use type ELF. After this the driver loads.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/qmi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/qmi.c +11 -1
@@ -3,6 +3,8 @@* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. */ +#include <linux/elf.h> +#include "qmi.h" #include "core.h" #include "debug.h"
@@ -1990,6 +1992,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)struct qmi_txn txn = {};int ret;const u8 *temp; +int bdf_type; req =kzalloc (sizeof (*req),GFP_KERNEL );if (!req)
@@ -2006,6 +2009,13 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab) temp = bd.data; remaining = bd.len; +if (bd.len >=SELFMAG &&memcmp (bd.data,ELFMAG ,SELFMAG ) ==0 ) + bdf_type =ATH11K_QMI_BDF_TYPE_ELF ; +else + bdf_type =ATH11K_QMI_BDF_TYPE_BIN ; + +ath11k_dbg (ab,ATH11K_DBG_QMI ,"qmi bdf_type %d\n" , bdf_type); +while (remaining) { req->valid =1 ; req->file_id_valid =1 ;
@@ -2015,7 +2025,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab) req->seg_id_valid =1 ; req->data_valid =1 ; req->data_len =ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE ; - req->bdf_type =ATH11K_QMI_BDF_TYPE_BIN ; + req->bdf_type = bdf_type; req->bdf_type_valid =1 ; req->end_valid =1 ; req->end =0 ;
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 4/8 ath11k: pci: check TCSR_SOC_HW_VERSION
In reply to Kalle ValoThere are different versions of QCA6390. Check TCSR_SOC_HW_VERSION to make sure that the device is hw2.0, all the rest are unsupported.
This needs to be checked after ath11k_pci_claim() so move the whole switch choosing hw_ver.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/pci.c | 46 ++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath11k/pci.c +34 -12
@@ -24,6 +24,10 @@#define WINDOW_START 0x80000#define WINDOW_RANGE_MASK GENMASK(18, 0) +#define TCSR_SOC_HW_VERSION 0x0224 +#define TCSR_SOC_HW_VERSION_MAJOR_MASK GENMASK(16, 8) +#define TCSR_SOC_HW_VERSION_MINOR_MASK GENMASK(7, 0) +#define QCA6390_DEVICE_ID 0x1101static const struct pci_device_id ath11k_pci_id_table[] = {
@@ -839,21 +843,11 @@ static int ath11k_pci_probe(struct pci_dev *pdev, {struct ath11k_base *ab;struct ath11k_pci *ab_pci; -enum ath11k_hw_rev hw_rev; +u32 soc_hw_version, soc_hw_version_major, soc_hw_version_minor;int ret;dev_warn (&pdev->dev,"WARNING: ath11k PCI support is experimental!\n" ); -switch (pci_dev->device) { -case QCA6390_DEVICE_ID : - hw_rev =ATH11K_HW_QCA6390_HW20 ; -break ; -default : -dev_err (&pdev->dev,"Unknown PCI device found: 0x%x\n" , - pci_dev->device); -return -ENOTSUPP ; - } - ab =ath11k_core_alloc (&pdev->dev,sizeof (*ab_pci),ATH11K_BUS_PCI , &ath11k_pci_bus_params);if (!ab) {
@@ -862,7 +856,6 @@ static int ath11k_pci_probe(struct pci_dev *pdev, } ab->dev = &pdev->dev; - ab->hw_rev = hw_rev;pci_set_drvdata (pdev, ab); ab_pci =ath11k_pci_priv (ab); ab_pci->dev_id = pci_dev->device;
@@ -878,6 +871,35 @@ static int ath11k_pci_probe(struct pci_dev *pdev, goto err_free_core; } +switch (pci_dev->device) { +case QCA6390_DEVICE_ID : + soc_hw_version =ath11k_pci_read32 (ab,TCSR_SOC_HW_VERSION ); + soc_hw_version_major =FIELD_GET (TCSR_SOC_HW_VERSION_MAJOR_MASK , + soc_hw_version); + soc_hw_version_minor =FIELD_GET (TCSR_SOC_HW_VERSION_MINOR_MASK , + soc_hw_version); + +ath11k_dbg (ab,ATH11K_DBG_PCI ,"pci tcsr_soc_hw_version major %d minor %d\n" , + soc_hw_version_major, soc_hw_version_minor); + +switch (soc_hw_version_major) { +case 2 : + ab->hw_rev =ATH11K_HW_QCA6390_HW20 ; +break ; +default : +dev_err (&pdev->dev,"Unsupported QCA6390 SOC hardware version: %d %d\n" , + soc_hw_version_major, soc_hw_version_minor); + ret = -EOPNOTSUPP ; + goto err_pci_free_region; + } +break ; +default : +dev_err (&pdev->dev,"Unknown PCI device found: 0x%x\n" , + pci_dev->device); + ret = -EOPNOTSUPP ; + goto err_pci_free_region; + } + ret =ath11k_pci_enable_msi (ab_pci);if (ret) {ath11k_err (ab,"failed to enable msi: %d\n" , ret);
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 6/8 ath11k: change to disable softirqs for ath11k_regd_update to solve deadlock
In reply to Kalle ValoFrom: Wen Gong <[email protected]>
After base_lock which occupy by ath11k_regd_update, the softirq run for WMI_REG_CHAN_LIST_CC_EVENTID maybe arrived and it also need to accuire the spin lock, then deadlock happend, change to disable softirqis to solve it.
[ 235.576990] ================================
[ 235.576991] WARNING: inconsistent lock state
[ 235.576993] 5.9.0-rc5-wt-ath+ #196 Not tainted
[ 235.576994] --------------------------------
[ 235.576995] inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
[ 235.576997] kworker/u16:1/98 [HC0[0]:SC0[0]:HE1:SE1] takes:
[ 235.576998] ffff9655f75cad98 (&ab->base_lock){+.?.}-{2:2}, at: ath11k_regd_update+0x28/0x1d0 [ath11k]
[ 235.577009] {IN-SOFTIRQ-W} state was registered at:
[ 235.577013] __lock_acquire+0x219/0x6e0
[ 235.577015] lock_acquire+0xb6/0x270
[ 235.577018] _raw_spin_lock+0x2c/0x70
[ 235.577023] ath11k_reg_chan_list_event.isra.0+0x10d/0x1e0 [ath11k]
[ 235.577028] ath11k_wmi_tlv_op_rx+0x3c3/0x560 [ath11k]
[ 235.577033] ath11k_htc_rx_completion_handler+0x207/0x370 [ath11k]
[ 235.577039] ath11k_ce_recv_process_cb+0x15e/0x1e0 [ath11k]
[ 235.577041] ath11k_pci_ce_tasklet+0x10/0x30 [ath11k_pci]
[ 235.577043] tasklet_action_common.constprop.0+0xd4/0xf0
[ 235.577045] __do_softirq+0xc9/0x482
[ 235.577046] asm_call_on_stack+0x12/0x20
[ 235.577048] do_softirq_own_stack+0x49/0x60
[ 235.577049] irq_exit_rcu+0x9a/0xd0
[ 235.577050] common_interrupt+0xa1/0x190
[ 235.577052] asm_common_interrupt+0x1e/0x40
[ 235.577053] cpu_idle_poll.isra.0+0x2e/0x60
[ 235.577055] do_idle+0x5f/0xe0
[ 235.577056] cpu_startup_entry+0x14/0x20
[ 235.577058] start_kernel+0x443/0x464
[ 235.577060] secondary_startup_64+0xa4/0xb0
[ 235.577061] irq event stamp: 432035
[ 235.577063] hardirqs last enabled at (432035): [<ffffffff968d12b4>] _raw_spin_unlock_irqrestore+0x34/0x40
[ 235.577064] hardirqs last disabled at (432034): [<ffffffff968d10d3>] _raw_spin_lock_irqsave+0x63/0x80
[ 235.577066] softirqs last enabled at (431998): [<ffffffff967115c1>] inet6_fill_ifla6_attrs+0x3f1/0x430
[ 235.577067] softirqs last disabled at (431996): [<ffffffff9671159f>] inet6_fill_ifla6_attrs+0x3cf/0x430
[ 235.577068]
[ 235.577068] other info that might help us debug this:
[ 235.577069] Possible unsafe locking scenario:
[ 235.577069]
[ 235.577070] CPU0
[ 235.577070] ----
[ 235.577071] lock(&ab->base_lock);
[ 235.577072] <Interrupt>
[ 235.577073] lock(&ab->base_lock);
[ 235.577074]
[ 235.577074] *** DEADLOCK ***
[ 235.577074]
[ 235.577075] 3 locks held by kworker/u16:1/98:
[ 235.577076] #0: ffff9655f75b1d48 ((wq_completion)ath11k_qmi_driver_event){+.+.}-{0:0}, at: process_one_work+0x1d3/0x5d0
[ 235.577079] #1: ffffa33cc02f3e70 ((work_completion)(&ab->qmi.event_work)){+.+.}-{0:0}, at: process_one_work+0x1d3/0x5d0
[ 235.577081] #2: ffff9655f75cad50 (&ab->core_lock){+.+.}-{3:3}, at: ath11k_core_qmi_firmware_ready.part.0+0x4e/0x160 [ath11k]
[ 235.577087]
[ 235.577087] stack backtrace:
[ 235.577088] CPU: 3 PID: 98 Comm: kworker/u16:1 Not tainted 5.9.0-rc5-wt-ath+ #196
[ 235.577089] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0049.2018.0801.1601 08/01/2018
[ 235.577095] Workqueue: ath11k_qmi_driver_event ath11k_qmi_driver_event_work [ath11k]
[ 235.577096] Call Trace:
[ 235.577100] dump_stack+0x77/0xa0
[ 235.577102] mark_lock_irq.cold+0x15/0x3c
[ 235.577104] mark_lock+0x1d7/0x540
[ 235.577105] mark_usage+0xc7/0x140
[ 235.577107] __lock_acquire+0x219/0x6e0
[ 235.577108] ? sched_clock_cpu+0xc/0xb0
[ 235.577110] lock_acquire+0xb6/0x270
[ 235.577116] ? ath11k_regd_update+0x28/0x1d0 [ath11k]
[ 235.577118] ? atomic_notifier_chain_register+0x2d/0x40
[ 235.577120] _raw_spin_lock+0x2c/0x70
[ 235.577125] ? ath11k_regd_update+0x28/0x1d0 [ath11k]
[ 235.577130] ath11k_regd_update+0x28/0x1d0 [ath11k]
[ 235.577136] __ath11k_mac_register+0x3fb/0x480 [ath11k]
[ 235.577141] ath11k_mac_register+0x119/0x180 [ath11k]
[ 235.577146] ath11k_core_pdev_create+0x17/0xe0 [ath11k]
[ 235.577150] ath11k_core_qmi_firmware_ready.part.0+0x65/0x160 [ath11k]
[ 235.577155] ath11k_qmi_driver_event_work+0x1c5/0x230 [ath11k]
[ 235.577158] process_one_work+0x265/0x5d0
[ 235.577160] worker_thread+0x49/0x300
[ 235.577161] ? process_one_work+0x5d0/0x5d0
[ 235.577163] kthread+0x135/0x150
[ 235.577164] ? kthread_create_worker_on_cpu+0x60/0x60
[ 235.577166] ret_from_fork+0x22/0x30Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/reg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/reg.c +3 -3
@@ -206,7 +206,7 @@ int ath11k_regd_update(struct ath11k *ar, bool init) ab = ar->ab; pdev_id = ar->pdev_idx; -spin_lock (&ab->base_lock); +spin_lock_bh (&ab->base_lock);if (init) {/* Apply the regd received during init through
@@ -227,7 +227,7 @@ int ath11k_regd_update(struct ath11k *ar, bool init)if (!regd) { ret = -EINVAL ; -spin_unlock (&ab->base_lock); +spin_unlock_bh (&ab->base_lock); goto err; }
@@ -238,7 +238,7 @@ int ath11k_regd_update(struct ath11k *ar, bool init)if (regd_copy)ath11k_copy_regd (regd, regd_copy); -spin_unlock (&ab->base_lock); +spin_unlock_bh (&ab->base_lock);if (!regd_copy) { ret = -ENOMEM ;
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 5/8 ath11k: disable monitor mode on QCA6390
In reply to Kalle ValoQCA6390 does not support monitor mode at the moment so disable it altogether, using a hack as mac80211 does not support disabling it otherwise. Add a boolean to hw_params to know if hardware supports monitor mode.
IPQ8074 continues to support monitor mode normally.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/core.c | 3 +++ drivers/net/wireless/ath/ath11k/hw.h | 1 + drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++ 3 files changed, 12 insertions(+)
drivers/net/wireless/ath/ath11k/core.c +3 -0
@@ -62,6 +62,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MESH_POINT), + .supports_monitor = true, }, { .hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -96,6 +97,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MESH_POINT), + .supports_monitor = true, }, { .name = "qca6390 hw2.0",
@@ -129,6 +131,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP), + .supports_monitor = false, }, };
drivers/net/wireless/ath/ath11k/hw.h +1 -0
@@ -158,6 +158,7 @@ struct ath11k_hw_params {u8 spectral_fft_sz;u16 interface_modes; +bool supports_monitor; };struct ath11k_hw_ops {
drivers/net/wireless/ath/ath11k/mac.c +8 -0
@@ -6241,6 +6241,14 @@ static int __ath11k_mac_register(struct ath11k *ar) goto err_free_if_combs; } +if (!ab->hw_params.supports_monitor) +/* There's a race between calling ieee80211_register_hw() +* and here where the monitor mode is enabled for a little +* while. But that time is so short and in practise it make +* a difference in real life. +*/ + ar->hw->wiphy->interface_modes &= ~BIT (NL80211_IFTYPE_MONITOR ); +/* Apply the regd received during initialization */ ret =ath11k_regd_update (ar, true);if (ret) {
Signature · 1 line
2.7.4
PATCH 7/8 ath11k: Use GFP_ATOMIC instead of GFP_KERNEL in ath11k_dp_htt_get_ppdu_desc
In reply to Kalle ValoFrom: Wen Gong <[email protected]>
With SLUB DEBUG CONFIG below crash is seen as kmem_cache_alloc is being called in non-atomic context.
To fix this issue, use GFP_ATOMIC instead of GFP_KERNEL kzalloc.
[ 357.217088] BUG: sleeping function called from invalid context at mm/slab.h:498 [ 357.217091] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/0 [ 357.217092] INFO: lockdep is turned off. [ 357.217095] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 5.9.0-rc5-wt-ath+ #196 [ 357.217096] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0049.2018.0801.1601 08/01/2018 [ 357.217097] Call Trace: [ 357.217098] <IRQ> [ 357.217107] ? ath11k_dp_htt_get_ppdu_desc+0xa9/0x170 [ath11k] [ 357.217110] dump_stack+0x77/0xa0 [ 357.217113] ___might_sleep.cold+0xa6/0xb6 [ 357.217116] kmem_cache_alloc_trace+0x1f2/0x270 [ 357.217122] ath11k_dp_htt_get_ppdu_desc+0xa9/0x170 [ath11k] [ 357.217129] ath11k_htt_pull_ppdu_stats.isra.0+0x96/0x270 [ath11k] [ 357.217135] ath11k_dp_htt_htc_t2h_msg_handler+0xe7/0x1d0 [ath11k] [ 357.217137] ? trace_hardirqs_on+0x1c/0x100 [ 357.217143] ath11k_htc_rx_completion_handler+0x207/0x370 [ath11k] [ 357.217149] ath11k_ce_recv_process_cb+0x15e/0x1e0 [ath11k] [ 357.217151] ? handle_irq_event+0x70/0xa8 [ 357.217154] ath11k_pci_ce_tasklet+0x10/0x30 [ath11k_pci] [ 357.217157] tasklet_action_common.constprop.0+0xd4/0xf0 [ 357.217160] __do_softirq+0xc9/0x482 [ 357.217162] asm_call_on_stack+0x12/0x20 [ 357.217163] </IRQ> [ 357.217166] do_softirq_own_stack+0x49/0x60 [ 357.217167] irq_exit_rcu+0x9a/0xd0 [ 357.217169] common_interrupt+0xa1/0x190 [ 357.217171] asm_common_interrupt+0x1e/0x40 [ 357.217173] RIP: 0010:cpu_idle_poll.isra.0+0x2e/0x60 [ 357.217175] Code: 8b 35 26 27 74 69 e8 11 c8 3d ff e8 bc fa 42 ff e8 e7 9f 4a ff fb 65 48 8b 1c 25 80 90 01 00 48 8b 03 a8 08 74 0b eb 1c f3 90 <48> 8b 03 a8 08 75 13 8b 0 [ 357.217177] RSP: 0018:ffffffff97403ee0 EFLAGS: 00000202 [ 357.217178] RAX: 0000000000000001 RBX: ffffffff9742b8c0 RCX: 0000000000b890ca [ 357.217180] RDX: 0000000000b890ca RSI: 0000000000000001 RDI: ffffffff968d0c49 [ 357.217181] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 [ 357.217182] R10: ffffffff9742b8c0 R11: 0000000000000046 R12: 0000000000000000 [ 357.217183] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000066fdf520 [ 357.217186] ? cpu_idle_poll.isra.0+0x19/0x60 [ 357.217189] do_idle+0x5f/0xe0 [ 357.217191] cpu_startup_entry+0x14/0x20 [ 357.217193] start_kernel+0x443/0x464 [ 357.217196] secondary_startup_64+0xa4/0xb0
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -1
@@ -1478,7 +1478,7 @@ struct htt_ppdu_stats_info *ath11k_dp_htt_get_ppdu_desc(struct ath11k *ar, }spin_unlock_bh (&ar->data_lock); - ppdu_info =kzalloc (sizeof (*ppdu_info),GFP_KERNEL ); + ppdu_info =kzalloc (sizeof (*ppdu_info),GFP_ATOMIC );if (!ppdu_info)return NULL ;
Signature · 1 line
2.7.4
PATCH 8/8 ath11k: Use GFP_ATOMIC instead of GFP_KERNEL in idr_alloc
In reply to Kalle ValoFrom: Govind Singh <[email protected]>
With SLUB DEBUG CONFIG below crash is seen as kmem_cache_alloc is being called in non-atomic context.
To fix this issue, use GFP_ATOMIC instead of GFP_KERNEL in idr_alloc.
BUG: sleeping function called from invalid context at mm/slab.h:393
[ 59.805451] Call trace: [ 59.807971] ___might_sleep+0x110/0x118 [ 59.811915] __might_sleep+0x50/0x84 [ 59.815593] kmem_cache_alloc+0x60/0x3e0 [ 59.819630] radix_tree_node_alloc+0x4c/0xe8 [ 59.824014] radix_tree_extend+0x8c/0x164 [ 59.828135] idr_get_free_cmn+0xa4/0x27c [ 59.832167] idr_alloc_cmn+0x70/0xe8 [ 59.835856] ath11k_dp_rxbufs_replenish+0x1e8/0x310 [ath11k] [ 59.841687] ath11k_dp_rxdma_ring_buf_setup+0x50/0x60 [ath11k] [ 59.847693] ath11k_dp_rx_pdev_alloc+0x260/0x4d8 [ath11k] [ 59.853248] ath11k_dp_pdev_alloc+0x40/0xc4 [ath11k] [ 59.858357] ath11k_core_qmi_firmware_ready+0x3c4/0x490 [ath11k] [ 59.864538] ath11k_qmi_driver_event_work+0x4c8/0x1178 [ath11k] [ 59.870620] process_one_work+0x208/0x434
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/dp.c | 3 +-- drivers/net/wireless/ath/ath11k/dp_rx.c | 28 +++++++++++++--------------- drivers/net/wireless/ath/ath11k/dp_rx.h | 6 ++---- 3 files changed, 16 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath11k/dp.c +1 -2
@@ -812,8 +812,7 @@ int ath11k_dp_service_srng(struct ath11k_base *ab,struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring;ath11k_dp_rxbufs_replenish (ab, id, rx_ring,0 , -HAL_RX_BUF_RBM_SW3_BM , -GFP_ATOMIC ); +HAL_RX_BUF_RBM_SW3_BM ); } } }
drivers/net/wireless/ath/ath11k/dp_rx.c +13 -15
@@ -266,8 +266,7 @@ static u32 ath11k_dp_rxdesc_get_ppduid(struct hal_rx_desc *rx_desc)int ath11k_dp_rxbufs_replenish (struct ath11k_base *ab,int mac_id,struct dp_rxdma_ring *rx_ring,int req_entries, -enum hal_rx_buf_return_buf_manager mgr, -gfp_t gfp) +enum hal_rx_buf_return_buf_manager mgr) {struct hal_srng *srng;u32 *desc;
@@ -314,7 +313,7 @@ int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id,spin_lock_bh (&rx_ring->idr_lock); buf_id =idr_alloc (&rx_ring->bufs_idr, skb,0 , - rx_ring->bufs_max *3 , gfp); + rx_ring->bufs_max *3 ,GFP_ATOMIC );spin_unlock_bh (&rx_ring->idr_lock);if (buf_id <0 ) goto fail_dma_unmap;
@@ -434,7 +433,7 @@ static int ath11k_dp_rxdma_ring_buf_setup(struct ath11k *ar, rx_ring->bufs_max = num_entries;ath11k_dp_rxbufs_replenish (ar->ab, dp->mac_id, rx_ring, num_entries, -HAL_RX_BUF_RBM_SW3_BM ,GFP_KERNEL ); +HAL_RX_BUF_RBM_SW3_BM );return 0 ; }
@@ -2598,7 +2597,7 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id, rx_ring = &ar->dp.rx_refill_buf_ring;ath11k_dp_rxbufs_replenish (ab, i, rx_ring, num_buffs_reaped[i], -HAL_RX_BUF_RBM_SW3_BM ,GFP_ATOMIC ); +HAL_RX_BUF_RBM_SW3_BM ); } ath11k_dp_rx_process_received_packets(ab, napi, &msdu_list,
@@ -2680,7 +2679,7 @@ static void ath11k_dp_rx_update_peer_stats(struct ath11k_sta *arsta,static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf (struct ath11k_base *ab,struct dp_rxdma_ring *rx_ring, -int *buf_id,gfp_t gfp) +int *buf_id) {struct sk_buff *skb;dma_addr_t paddr;
@@ -2705,7 +2704,7 @@ static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab,spin_lock_bh (&rx_ring->idr_lock); *buf_id =idr_alloc (&rx_ring->bufs_idr, skb,0 , - rx_ring->bufs_max, gfp); + rx_ring->bufs_max,GFP_ATOMIC );spin_unlock_bh (&rx_ring->idr_lock);if (*buf_id <0 ) goto fail_dma_unmap;
@@ -2725,8 +2724,7 @@ static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab,int ath11k_dp_rx_mon_status_bufs_replenish (struct ath11k_base *ab,int mac_id,struct dp_rxdma_ring *rx_ring,int req_entries, -enum hal_rx_buf_return_buf_manager mgr, -gfp_t gfp) +enum hal_rx_buf_return_buf_manager mgr) {struct hal_srng *srng;u32 *desc;
@@ -2752,7 +2750,7 @@ int ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id,while (num_remain >0 ) { skb =ath11k_dp_rx_alloc_mon_status_buf (ab, rx_ring, - &buf_id, gfp); + &buf_id);if (!skb)break ; paddr =ATH11K_SKB_RXCB (skb)->paddr;
@@ -2863,7 +2861,7 @@ static int ath11k_dp_rx_reap_mon_status_ring(struct ath11k_base *ab, int mac_id, } move_next: skb =ath11k_dp_rx_alloc_mon_status_buf (ab, rx_ring, - &buf_id,GFP_ATOMIC ); + &buf_id);if (!skb) { ath11k_hal_rx_buf_addr_info_set(rx_mon_status_desc, 0, 0,
@@ -3676,7 +3674,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi, rx_ring = &ar->dp.rx_refill_buf_ring;ath11k_dp_rxbufs_replenish (ab, i, rx_ring, n_bufs_reaped[i], -HAL_RX_BUF_RBM_SW3_BM ,GFP_ATOMIC ); +HAL_RX_BUF_RBM_SW3_BM ); }return tot_n_bufs_reaped;
@@ -3972,7 +3970,7 @@ int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab, rx_ring = &ar->dp.rx_refill_buf_ring;ath11k_dp_rxbufs_replenish (ab, i, rx_ring, num_buffs_reaped[i], -HAL_RX_BUF_RBM_SW3_BM ,GFP_ATOMIC ); +HAL_RX_BUF_RBM_SW3_BM ); }rcu_read_lock ();
@@ -4081,7 +4079,7 @@ int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget)if (num_buf_freed)ath11k_dp_rxbufs_replenish (ab, mac_id, rx_ring, num_buf_freed, -HAL_RX_BUF_RBM_SW3_BM ,GFP_ATOMIC ); +HAL_RX_BUF_RBM_SW3_BM );return budget - quota; }
@@ -4844,7 +4842,7 @@ static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, u32 quota,ath11k_dp_rxbufs_replenish (ar->ab, dp->mac_id, &dp->rxdma_mon_buf_ring, rx_bufs_used, -HAL_RX_BUF_RBM_SW3_BM ,GFP_ATOMIC ); +HAL_RX_BUF_RBM_SW3_BM ); } }
drivers/net/wireless/ath/ath11k/dp_rx.h +2 -4
@@ -74,8 +74,7 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id,int ath11k_dp_rxbufs_replenish (struct ath11k_base *ab,int mac_id,struct dp_rxdma_ring *rx_ring,int req_entries, -enum hal_rx_buf_return_buf_manager mgr, -gfp_t gfp); +enum hal_rx_buf_return_buf_manager mgr); int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, int (*iter)(struct ath11k_base *ar, u16 tag, u16 len, const void *ptr, void *data),
@@ -87,8 +86,7 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,int ath11k_dp_rx_mon_status_bufs_replenish (struct ath11k_base *ab,int mac_id,struct dp_rxdma_ring *rx_ring,int req_entries, -enum hal_rx_buf_return_buf_manager mgr, -gfp_t gfp); +enum hal_rx_buf_return_buf_manager mgr);int ath11k_dp_rx_pdev_mon_detach (struct ath11k *ar);int ath11k_dp_rx_pdev_mon_attach (struct ath11k *ar);int ath11k_peer_rx_frag_setup (struct ath11k *ar,const u8 *peer_mac,int vdev_id);
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 3/8 ath11k: add interface_modes to hw_params
In reply to Kalle ValoAs QCA6390 does not support mesh interfaces, move the interface_modes to hw_params. Also create interface combinations dynamically so that it's easy to change the values.
Now QCA6390 does not claim to support mesh interfaces to user space, but IPQ8074 continues to do that.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/core.c | 11 ++++ drivers/net/wireless/ath/ath11k/hw.h | 2 + drivers/net/wireless/ath/ath11k/mac.c | 101 ++++++++++++++++++++------------- 3 files changed, 75 insertions(+), 39 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +11 -0
@@ -58,6 +58,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .htt_peer_map_v2 = true, .tcl_0_only = false, .spectral_fft_sz = 2, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_MESH_POINT), }, { .hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -88,6 +92,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .htt_peer_map_v2 = true, .tcl_0_only = false, .spectral_fft_sz = 4, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_MESH_POINT), }, { .name = "qca6390 hw2.0",
@@ -118,6 +126,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .htt_peer_map_v2 = false, .tcl_0_only = true, .spectral_fft_sz = 0, + + .interface_modes =BIT (NL80211_IFTYPE_STATION ) | + BIT(NL80211_IFTYPE_AP), }, };
drivers/net/wireless/ath/ath11k/hw.h +2 -0
@@ -156,6 +156,8 @@ struct ath11k_hw_params {bool htt_peer_map_v2;bool tcl_0_only;u8 spectral_fft_sz; + +u16 interface_modes; };struct ath11k_hw_ops {
drivers/net/wireless/ath/ath11k/mac.c +62 -39
155 lines not on this page · raw message
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH 1/8] ath11k: support loading ELF board files
In reply to Kalle ValoQuoted 10 lines · Kalle Valo
The QCA6390 board I have, model 8291M-PR comes with an ELF board file. To get this to at least somewhat work, I renamed bdwlan.e04 to 'board.bin' and then added this patch to check for ELF magic string in the beginning of the file. If that is found, use type ELF. After this the driver loads.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Signed-off-by Ben Greear <[email protected]>[[email protected]: use elf.h, minor cleanup]Signed-off-by Kalle Valo <[email protected]>
8 patches applied to ath-next branch of ath.git, thanks.
616c16a4b26a ath11k: support loading ELF board filesb09199248905 ath11k: fix AP mode for QCA63902626c269702e ath11k: add interface_modes to hw_params18ac1665e785 ath11k: pci: check TCSR_SOC_HW_VERSION3f6e6c3291ed ath11k: disable monitor mode on QCA6390df648808c6b9 ath11k: change to disable softirqs for ath11k_regd_update to solve deadlock 6a8be1baa911 ath11k: Use GFP_ATOMIC instead of GFP_KERNEL in ath11k_dp_htt_get_ppdu_desc 87e8497a7d46 ath11k: Use GFP_ATOMIC instead of GFP_KERNEL in idr_alloc
Signature · 3 lines
https://patchwork.kernel.org/patch/11806385/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH 1/8] ath11k: support loading ELF board files
In reply to Kalle ValoQuoted 10 lines · Kalle Valo
The QCA6390 board I have, model 8291M-PR comes with an ELF board file. To get this to at least somewhat work, I renamed bdwlan.e04 to 'board.bin' and then added this patch to check for ELF magic string in the beginning of the file. If that is found, use type ELF. After this the driver loads.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Signed-off-by Ben Greear <[email protected]>[[email protected]: use elf.h, minor cleanup]Signed-off-by Kalle Valo <[email protected]>
8 patches applied to ath-next branch of ath.git, thanks.
616c16a4b26a ath11k: support loading ELF board filesb09199248905 ath11k: fix AP mode for QCA63902626c269702e ath11k: add interface_modes to hw_params18ac1665e785 ath11k: pci: check TCSR_SOC_HW_VERSION3f6e6c3291ed ath11k: disable monitor mode on QCA6390df648808c6b9 ath11k: change to disable softirqs for ath11k_regd_update to solve deadlock 6a8be1baa911 ath11k: Use GFP_ATOMIC instead of GFP_KERNEL in ath11k_dp_htt_get_ppdu_desc 87e8497a7d46 ath11k: Use GFP_ATOMIC instead of GFP_KERNEL in idr_alloc
Signature · 9 lines
https://patchwork.kernel.org/patch/11806385/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k