Skip to content

Commit

Permalink
wifi: ath10k: Set tx credit to one for WCN3990 snoc based devices
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1994179

[ Upstream commit d81bbb6 ]

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]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Kamal Mostafa <[email protected]>
  • Loading branch information
youghandhar authored and smb49 committed Nov 24, 2022
1 parent e593ed8 commit fd7a7c1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
16 changes: 16 additions & 0 deletions drivers/net/wireless/ath/ath10k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = true,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA988X_HW_2_0_VERSION,
Expand Down Expand Up @@ -133,6 +134,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = true,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA9887_HW_1_0_VERSION,
Expand Down Expand Up @@ -172,6 +174,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA6174_HW_3_2_VERSION,
Expand Down Expand Up @@ -206,6 +209,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.supports_peer_stats_info = true,
.dynamic_sar_support = true,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA6174_HW_2_1_VERSION,
Expand Down Expand Up @@ -244,6 +248,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA6174_HW_2_1_VERSION,
Expand Down Expand Up @@ -282,6 +287,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA6174_HW_3_0_VERSION,
Expand Down Expand Up @@ -320,6 +326,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA6174_HW_3_2_VERSION,
Expand Down Expand Up @@ -362,6 +369,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.supports_peer_stats_info = true,
.dynamic_sar_support = true,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA99X0_HW_2_0_DEV_VERSION,
Expand Down Expand Up @@ -406,6 +414,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA9984_HW_1_0_DEV_VERSION,
Expand Down Expand Up @@ -457,6 +466,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA9888_HW_2_0_DEV_VERSION,
Expand Down Expand Up @@ -505,6 +515,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA9377_HW_1_0_DEV_VERSION,
Expand Down Expand Up @@ -543,6 +554,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
Expand Down Expand Up @@ -583,6 +595,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
Expand Down Expand Up @@ -614,6 +627,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.credit_size_workaround = true,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = QCA4019_HW_1_0_DEV_VERSION,
Expand Down Expand Up @@ -659,6 +673,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
.hw_restart_disconnect = false,
.use_fw_tx_credits = true,
},
{
.id = WCN3990_HW_1_0_DEV_VERSION,
Expand Down Expand Up @@ -690,6 +705,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.dynamic_sar_support = true,
.hw_restart_disconnect = true,
.use_fw_tx_credits = false,
},
};

Expand Down
11 changes: 8 additions & 3 deletions drivers/net/wireless/ath/ath10k/htc.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,18 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)
return -ECOMM;
}

htc->total_transmit_credits = __le16_to_cpu(msg->ready.credit_count);
if (ar->hw_params.use_fw_tx_credits)
htc->total_transmit_credits = __le16_to_cpu(msg->ready.credit_count);
else
htc->total_transmit_credits = 1;

htc->target_credit_size = __le16_to_cpu(msg->ready.credit_size);

ath10k_dbg(ar, ATH10K_DBG_HTC,
"Target ready! transmit resources: %d size:%d\n",
"Target ready! transmit resources: %d size:%d actual credits:%d\n",
htc->total_transmit_credits,
htc->target_credit_size);
htc->target_credit_size,
msg->ready.credit_count);

if ((htc->total_transmit_credits == 0) ||
(htc->target_credit_size == 0)) {
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath10k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ struct ath10k_hw_params {
bool dynamic_sar_support;

bool hw_restart_disconnect;

bool use_fw_tx_credits;
};

struct htt_resp;
Expand Down

0 comments on commit fd7a7c1

Please sign in to comment.