Skip to content

Commit d81bbb6

Browse files
youghandharkvalo
authored andcommitted
wifi: ath10k: Set tx credit to one for WCN3990 snoc based devices
Currently host can send two WMI commands at once. There is possibility to cause SMMU issues or corruption, if host wants to initiate 2 DMA transfers, it is possible when copy complete interrupt for first DMA reaches host, CE has already updated SRRI (Source ring read index) for both DMA transfers and is in the middle of 2nd DMA. Host uses SRRI (Source ring read index) to interpret how many DMA’s have been completed and tries to unmap/free both the DMA entries. Hence now it is limiting to one.Because CE is still in the middle of 2nd DMA which can cause these issues when handling two DMA transfers. This change will not impact other targets, as it is only for WCN3990. Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1 Signed-off-by: Youghandhar Chintala <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6375722 commit d81bbb6

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

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

+16
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
9898
.tx_stats_over_pktlog = true,
9999
.dynamic_sar_support = false,
100100
.hw_restart_disconnect = false,
101+
.use_fw_tx_credits = true,
101102
},
102103
{
103104
.id = QCA988X_HW_2_0_VERSION,
@@ -136,6 +137,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
136137
.tx_stats_over_pktlog = true,
137138
.dynamic_sar_support = false,
138139
.hw_restart_disconnect = false,
140+
.use_fw_tx_credits = true,
139141
},
140142
{
141143
.id = QCA9887_HW_1_0_VERSION,
@@ -175,6 +177,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
175177
.tx_stats_over_pktlog = false,
176178
.dynamic_sar_support = false,
177179
.hw_restart_disconnect = false,
180+
.use_fw_tx_credits = true,
178181
},
179182
{
180183
.id = QCA6174_HW_3_2_VERSION,
@@ -209,6 +212,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
209212
.supports_peer_stats_info = true,
210213
.dynamic_sar_support = true,
211214
.hw_restart_disconnect = false,
215+
.use_fw_tx_credits = true,
212216
},
213217
{
214218
.id = QCA6174_HW_2_1_VERSION,
@@ -247,6 +251,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
247251
.tx_stats_over_pktlog = false,
248252
.dynamic_sar_support = false,
249253
.hw_restart_disconnect = false,
254+
.use_fw_tx_credits = true,
250255
},
251256
{
252257
.id = QCA6174_HW_2_1_VERSION,
@@ -285,6 +290,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
285290
.tx_stats_over_pktlog = false,
286291
.dynamic_sar_support = false,
287292
.hw_restart_disconnect = false,
293+
.use_fw_tx_credits = true,
288294
},
289295
{
290296
.id = QCA6174_HW_3_0_VERSION,
@@ -323,6 +329,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
323329
.tx_stats_over_pktlog = false,
324330
.dynamic_sar_support = false,
325331
.hw_restart_disconnect = false,
332+
.use_fw_tx_credits = true,
326333
},
327334
{
328335
.id = QCA6174_HW_3_2_VERSION,
@@ -365,6 +372,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
365372
.supports_peer_stats_info = true,
366373
.dynamic_sar_support = true,
367374
.hw_restart_disconnect = false,
375+
.use_fw_tx_credits = true,
368376
},
369377
{
370378
.id = QCA99X0_HW_2_0_DEV_VERSION,
@@ -409,6 +417,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
409417
.tx_stats_over_pktlog = false,
410418
.dynamic_sar_support = false,
411419
.hw_restart_disconnect = false,
420+
.use_fw_tx_credits = true,
412421
},
413422
{
414423
.id = QCA9984_HW_1_0_DEV_VERSION,
@@ -460,6 +469,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
460469
.tx_stats_over_pktlog = false,
461470
.dynamic_sar_support = false,
462471
.hw_restart_disconnect = false,
472+
.use_fw_tx_credits = true,
463473
},
464474
{
465475
.id = QCA9888_HW_2_0_DEV_VERSION,
@@ -508,6 +518,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
508518
.tx_stats_over_pktlog = false,
509519
.dynamic_sar_support = false,
510520
.hw_restart_disconnect = false,
521+
.use_fw_tx_credits = true,
511522
},
512523
{
513524
.id = QCA9377_HW_1_0_DEV_VERSION,
@@ -546,6 +557,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
546557
.tx_stats_over_pktlog = false,
547558
.dynamic_sar_support = false,
548559
.hw_restart_disconnect = false,
560+
.use_fw_tx_credits = true,
549561
},
550562
{
551563
.id = QCA9377_HW_1_1_DEV_VERSION,
@@ -586,6 +598,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
586598
.tx_stats_over_pktlog = false,
587599
.dynamic_sar_support = false,
588600
.hw_restart_disconnect = false,
601+
.use_fw_tx_credits = true,
589602
},
590603
{
591604
.id = QCA9377_HW_1_1_DEV_VERSION,
@@ -617,6 +630,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
617630
.credit_size_workaround = true,
618631
.dynamic_sar_support = false,
619632
.hw_restart_disconnect = false,
633+
.use_fw_tx_credits = true,
620634
},
621635
{
622636
.id = QCA4019_HW_1_0_DEV_VERSION,
@@ -662,6 +676,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
662676
.tx_stats_over_pktlog = false,
663677
.dynamic_sar_support = false,
664678
.hw_restart_disconnect = false,
679+
.use_fw_tx_credits = true,
665680
},
666681
{
667682
.id = WCN3990_HW_1_0_DEV_VERSION,
@@ -693,6 +708,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
693708
.tx_stats_over_pktlog = false,
694709
.dynamic_sar_support = true,
695710
.hw_restart_disconnect = true,
711+
.use_fw_tx_credits = false,
696712
},
697713
};
698714

drivers/net/wireless/ath/ath10k/htc.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -947,13 +947,18 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)
947947
return -ECOMM;
948948
}
949949

950-
htc->total_transmit_credits = __le16_to_cpu(msg->ready.credit_count);
950+
if (ar->hw_params.use_fw_tx_credits)
951+
htc->total_transmit_credits = __le16_to_cpu(msg->ready.credit_count);
952+
else
953+
htc->total_transmit_credits = 1;
954+
951955
htc->target_credit_size = __le16_to_cpu(msg->ready.credit_size);
952956

953957
ath10k_dbg(ar, ATH10K_DBG_HTC,
954-
"Target ready! transmit resources: %d size:%d\n",
958+
"Target ready! transmit resources: %d size:%d actual credits:%d\n",
955959
htc->total_transmit_credits,
956-
htc->target_credit_size);
960+
htc->target_credit_size,
961+
msg->ready.credit_count);
957962

958963
if ((htc->total_transmit_credits == 0) ||
959964
(htc->target_credit_size == 0)) {

drivers/net/wireless/ath/ath10k/hw.h

+2
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@ struct ath10k_hw_params {
635635
bool dynamic_sar_support;
636636

637637
bool hw_restart_disconnect;
638+
639+
bool use_fw_tx_credits;
638640
};
639641

640642
struct htt_resp;

0 commit comments

Comments
 (0)