Skip to content

Commit 70442ee

Browse files
author
Kalle Valo
committed
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for v5.10. Major changes: ath11k * improvements to QCA6390 PCI support, adding essential missing features: ELF board files, packet log handling to avoid data stalls and crash fixes
2 parents 855f69f + fd5ad4d commit 70442ee

File tree

25 files changed

+783
-203
lines changed

25 files changed

+783
-203
lines changed

drivers/net/wireless/ath/ath11k/ce.c

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,26 @@ const struct ce_attr ath11k_host_ce_config_qca6390[] = {
187187

188188
};
189189

190+
static bool ath11k_ce_need_shadow_fix(int ce_id)
191+
{
192+
/* only ce4 needs shadow workaroud*/
193+
if (ce_id == 4)
194+
return true;
195+
return false;
196+
}
197+
198+
static void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab)
199+
{
200+
int i;
201+
202+
if (!ab->hw_params.supports_shadow_regs)
203+
return;
204+
205+
for (i = 0; i < ab->hw_params.ce_count; i++)
206+
if (ath11k_ce_need_shadow_fix(i))
207+
ath11k_dp_shadow_stop_timer(ab, &ab->ce.hp_timer[i]);
208+
}
209+
190210
static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe,
191211
struct sk_buff *skb, dma_addr_t paddr)
192212
{
@@ -505,6 +525,12 @@ static int ath11k_ce_init_ring(struct ath11k_base *ab,
505525

506526
ce_ring->hal_ring_id = ret;
507527

528+
if (ab->hw_params.supports_shadow_regs &&
529+
ath11k_ce_need_shadow_fix(ce_id))
530+
ath11k_dp_shadow_init_timer(ab, &ab->ce.hp_timer[ce_id],
531+
ATH11K_SHADOW_CTRL_TIMER_INTERVAL,
532+
ce_ring->hal_ring_id);
533+
508534
return 0;
509535
}
510536

@@ -677,6 +703,9 @@ int ath11k_ce_send(struct ath11k_base *ab, struct sk_buff *skb, u8 pipe_id,
677703

678704
ath11k_hal_srng_access_end(ab, srng);
679705

706+
if (ath11k_ce_need_shadow_fix(pipe_id))
707+
ath11k_dp_shadow_start_timer(ab, srng, &ab->ce.hp_timer[pipe_id]);
708+
680709
spin_unlock_bh(&srng->lock);
681710

682711
spin_unlock_bh(&ab->ce.ce_lock);
@@ -713,11 +742,56 @@ static void ath11k_ce_rx_pipe_cleanup(struct ath11k_ce_pipe *pipe)
713742
}
714743
}
715744

745+
static void ath11k_ce_shadow_config(struct ath11k_base *ab)
746+
{
747+
int i;
748+
749+
for (i = 0; i < ab->hw_params.ce_count; i++) {
750+
if (ab->hw_params.host_ce_config[i].src_nentries)
751+
ath11k_hal_srng_update_shadow_config(ab,
752+
HAL_CE_SRC, i);
753+
754+
if (ab->hw_params.host_ce_config[i].dest_nentries) {
755+
ath11k_hal_srng_update_shadow_config(ab,
756+
HAL_CE_DST, i);
757+
758+
ath11k_hal_srng_update_shadow_config(ab,
759+
HAL_CE_DST_STATUS, i);
760+
}
761+
}
762+
}
763+
764+
void ath11k_ce_get_shadow_config(struct ath11k_base *ab,
765+
u32 **shadow_cfg, u32 *shadow_cfg_len)
766+
{
767+
if (!ab->hw_params.supports_shadow_regs)
768+
return;
769+
770+
ath11k_hal_srng_get_shadow_config(ab, shadow_cfg, shadow_cfg_len);
771+
772+
/* shadow is already configured */
773+
if (*shadow_cfg_len)
774+
return;
775+
776+
/* shadow isn't configured yet, configure now.
777+
* non-CE srngs are configured firstly, then
778+
* all CE srngs.
779+
*/
780+
ath11k_hal_srng_shadow_config(ab);
781+
ath11k_ce_shadow_config(ab);
782+
783+
/* get the shadow configuration */
784+
ath11k_hal_srng_get_shadow_config(ab, shadow_cfg, shadow_cfg_len);
785+
}
786+
EXPORT_SYMBOL(ath11k_ce_get_shadow_config);
787+
716788
void ath11k_ce_cleanup_pipes(struct ath11k_base *ab)
717789
{
718790
struct ath11k_ce_pipe *pipe;
719791
int pipe_num;
720792

793+
ath11k_ce_stop_shadow_timers(ab);
794+
721795
for (pipe_num = 0; pipe_num < ab->hw_params.ce_count; pipe_num++) {
722796
pipe = &ab->ce.ce_pipe[pipe_num];
723797
ath11k_ce_rx_pipe_cleanup(pipe);
@@ -767,6 +841,9 @@ int ath11k_ce_init_pipes(struct ath11k_base *ab)
767841
int i;
768842
int ret;
769843

844+
ath11k_ce_get_shadow_config(ab, &ab->qmi.ce_cfg.shadow_reg_v2,
845+
&ab->qmi.ce_cfg.shadow_reg_v2_len);
846+
770847
for (i = 0; i < ab->hw_params.ce_count; i++) {
771848
pipe = &ab->ce.ce_pipe[i];
772849

@@ -828,6 +905,9 @@ void ath11k_ce_free_pipes(struct ath11k_base *ab)
828905
for (i = 0; i < ab->hw_params.ce_count; i++) {
829906
pipe = &ab->ce.ce_pipe[i];
830907

908+
if (ath11k_ce_need_shadow_fix(i))
909+
ath11k_dp_shadow_stop_timer(ab, &ab->ce.hp_timer[i]);
910+
831911
if (pipe->src_ring) {
832912
desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_SRC);
833913
dma_free_coherent(ab->dev,

drivers/net/wireless/ath/ath11k/ce.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ struct ath11k_ce {
168168
struct ath11k_ce_pipe ce_pipe[CE_COUNT_MAX];
169169
/* Protects rings of all ce pipes */
170170
spinlock_t ce_lock;
171+
struct ath11k_hp_update_timer hp_timer[CE_COUNT_MAX];
171172
};
172173

173174
extern const struct ce_attr ath11k_host_ce_config_ipq8074[];
@@ -187,4 +188,6 @@ void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id);
187188
int ath11k_ce_map_service_to_pipe(struct ath11k_base *ab, u16 service_id,
188189
u8 *ul_pipe, u8 *dl_pipe);
189190
int ath11k_ce_attr_attach(struct ath11k_base *ab);
191+
void ath11k_ce_get_shadow_config(struct ath11k_base *ab,
192+
u32 **shadow_cfg, u32 *shadow_cfg_len);
190193
#endif

drivers/net/wireless/ath/ath11k/core.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
5858
.htt_peer_map_v2 = true,
5959
.tcl_0_only = false,
6060
.spectral_fft_sz = 2,
61+
62+
.interface_modes = BIT(NL80211_IFTYPE_STATION) |
63+
BIT(NL80211_IFTYPE_AP) |
64+
BIT(NL80211_IFTYPE_MESH_POINT),
65+
.supports_monitor = true,
66+
.supports_shadow_regs = false,
67+
.idle_ps = false,
6168
},
6269
{
6370
.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -88,6 +95,13 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
8895
.htt_peer_map_v2 = true,
8996
.tcl_0_only = false,
9097
.spectral_fft_sz = 4,
98+
99+
.interface_modes = BIT(NL80211_IFTYPE_STATION) |
100+
BIT(NL80211_IFTYPE_AP) |
101+
BIT(NL80211_IFTYPE_MESH_POINT),
102+
.supports_monitor = true,
103+
.supports_shadow_regs = false,
104+
.idle_ps = false,
91105
},
92106
{
93107
.name = "qca6390 hw2.0",
@@ -118,6 +132,12 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
118132
.htt_peer_map_v2 = false,
119133
.tcl_0_only = true,
120134
.spectral_fft_sz = 0,
135+
136+
.interface_modes = BIT(NL80211_IFTYPE_STATION) |
137+
BIT(NL80211_IFTYPE_AP),
138+
.supports_monitor = false,
139+
.supports_shadow_regs = true,
140+
.idle_ps = true,
121141
},
122142
};
123143

@@ -398,6 +418,7 @@ static void ath11k_core_stop(struct ath11k_base *ab)
398418
{
399419
if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags))
400420
ath11k_qmi_firmware_stop(ab);
421+
401422
ath11k_hif_stop(ab);
402423
ath11k_wmi_detach(ab);
403424
ath11k_dp_pdev_reo_cleanup(ab);

drivers/net/wireless/ath/ath11k/core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
extern unsigned int ath11k_frame_mode;
3939

40+
#define ATH11K_MON_TIMER_INTERVAL 10
41+
4042
enum ath11k_supported_bw {
4143
ATH11K_BW_20 = 0,
4244
ATH11K_BW_40 = 1,
@@ -727,6 +729,7 @@ struct ath11k_base {
727729
struct ath11k_dbring_cap *db_caps;
728730
u32 num_db_cap;
729731

732+
struct timer_list mon_reap_timer;
730733
/* must be last */
731734
u8 drv_priv[0] __aligned(sizeof(void *));
732735
};

drivers/net/wireless/ath/ath11k/debugfs.c

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -837,12 +837,8 @@ int ath11k_debugfs_pdev_create(struct ath11k_base *ab)
837837
return 0;
838838

839839
ab->debugfs_soc = debugfs_create_dir(ab->hw_params.name, ab->debugfs_ath11k);
840-
841-
if (IS_ERR_OR_NULL(ab->debugfs_soc)) {
842-
if (IS_ERR(ab->debugfs_soc))
843-
return PTR_ERR(ab->debugfs_soc);
844-
return -ENOMEM;
845-
}
840+
if (IS_ERR(ab->debugfs_soc))
841+
return PTR_ERR(ab->debugfs_soc);
846842

847843
debugfs_create_file("simulate_fw_crash", 0600, ab->debugfs_soc, ab,
848844
&fops_simulate_fw_crash);
@@ -855,27 +851,21 @@ int ath11k_debugfs_pdev_create(struct ath11k_base *ab)
855851

856852
void ath11k_debugfs_pdev_destroy(struct ath11k_base *ab)
857853
{
858-
debugfs_remove_recursive(ab->debugfs_ath11k);
859-
ab->debugfs_ath11k = NULL;
854+
debugfs_remove_recursive(ab->debugfs_soc);
855+
ab->debugfs_soc = NULL;
860856
}
861857

862858
int ath11k_debugfs_soc_create(struct ath11k_base *ab)
863859
{
864860
ab->debugfs_ath11k = debugfs_create_dir("ath11k", NULL);
865861

866-
if (IS_ERR_OR_NULL(ab->debugfs_ath11k)) {
867-
if (IS_ERR(ab->debugfs_ath11k))
868-
return PTR_ERR(ab->debugfs_ath11k);
869-
return -ENOMEM;
870-
}
871-
872-
return 0;
862+
return PTR_ERR_OR_ZERO(ab->debugfs_ath11k);
873863
}
874864

875865
void ath11k_debugfs_soc_destroy(struct ath11k_base *ab)
876866
{
877-
debugfs_remove_recursive(ab->debugfs_soc);
878-
ab->debugfs_soc = NULL;
867+
debugfs_remove_recursive(ab->debugfs_ath11k);
868+
ab->debugfs_ath11k = NULL;
879869
}
880870

881871
void ath11k_debugfs_fw_stats_init(struct ath11k *ar)
@@ -1069,13 +1059,8 @@ int ath11k_debugfs_register(struct ath11k *ar)
10691059
snprintf(pdev_name, sizeof(pdev_name), "%s%d", "mac", ar->pdev_idx);
10701060

10711061
ar->debug.debugfs_pdev = debugfs_create_dir(pdev_name, ab->debugfs_soc);
1072-
1073-
if (IS_ERR_OR_NULL(ar->debug.debugfs_pdev)) {
1074-
if (IS_ERR(ar->debug.debugfs_pdev))
1075-
return PTR_ERR(ar->debug.debugfs_pdev);
1076-
1077-
return -ENOMEM;
1078-
}
1062+
if (IS_ERR(ar->debug.debugfs_pdev))
1063+
return PTR_ERR(ar->debug.debugfs_pdev);
10791064

10801065
/* Create a symlink under ieee80211/phy* */
10811066
snprintf(buf, 100, "../../ath11k/%pd2", ar->debug.debugfs_pdev);

0 commit comments

Comments
 (0)