ath10k: reset firmware if tx-flush hangs.
RFC 1/1 ath10k: reset firmware if tx-flush hangs.
From: Ben Greear <[email protected]>
Seems to be no other way to recover this error.
Print out some before and after counters for both the driver and for the firmware. If we time-out two flushes in a row, and are not currently restarting, then restart the NIC.
Plz do not apply this...I think the firmware is not always to blame..need to figure out why...but this has some decent debugging code to help track it down...
Signed-off-by Ben Greear <[email protected]>
--- drivers/net/wireless/ath/ath10k/core.h | 8 ++++ drivers/net/wireless/ath/ath10k/htc.c | 2 + drivers/net/wireless/ath/ath10k/htt.c | 4 ++ drivers/net/wireless/ath/ath10k/htt_rx.c | 2 + drivers/net/wireless/ath/ath10k/htt_tx.c | 2 + drivers/net/wireless/ath/ath10k/mac.c | 76 ++++++++++++++++++++++++++++++-- 6 files changed, 91 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/core.h +8 -0
@@ -345,6 +345,7 @@ struct ath10k {struct ieee80211_hw *hw;struct device *dev;u8 mac_addr[ETH_ALEN ]; +u8 tx_flush_failed;/* failure case counter */ u32 chip_id;u32 target_version;
@@ -378,6 +379,13 @@ struct ath10k {struct ath10k_htc htc;struct ath10k_htt htt; +/* Stats to help debug tx hang issues */ +u64 htc_send_tot; +u64 htc_tx; +u64 htc_tx_compl; +u64 htc_mgt_tx; +u64 htc_mgt_compl; +struct ath10k_hw_params {u32 id;const char *name;
drivers/net/wireless/ath/ath10k/htc.c +2 -0
@@ -191,6 +191,8 @@ int ath10k_htc_send(struct ath10k_htc *htc,if (ret) goto err_unmap; + htc->ar->htc_send_tot++; +return 0 ; err_unmap:
drivers/net/wireless/ath/ath10k/htt.c +4 -0
@@ -56,6 +56,10 @@ int ath10k_htt_attach(struct ath10k *ar) htt->ar = ar; htt->max_throughput_mbps =800 ; +/* Clear some htc related counters */ + ar->htc_send_tot = ar->htc_tx = ar->htc_tx_compl = ar->htc_mgt_tx =0 ; + ar->htc_mgt_compl =0 ; +/* * Connect to HTC service. * This has to be done before calling ath10k_htt_rx_attach,
drivers/net/wireless/ath/ath10k/htt_rx.c +2 -0
@@ -1421,6 +1421,7 @@ static void ath10k_htt_rx_frm_tx_compl(struct ath10k *ar, msdu_id = resp->data_tx_completion.msdus[i]; tx_done.msdu_id =__le16_to_cpu (msdu_id);ath10k_txrx_tx_unref (htt, &tx_done); + ar->htc_tx_compl++; } }
@@ -1484,6 +1485,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)spin_lock_bh (&htt->tx_lock);ath10k_txrx_tx_unref (htt, &tx_done); + ar->htc_mgt_compl++;spin_unlock_bh (&htt->tx_lock);break ; }
drivers/net/wireless/ath/ath10k/htt_tx.c +2 -0
@@ -364,6 +364,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)if (res) goto err_unmap_msdu; + htt->ar->htc_mgt_tx++;return 0 ; err_unmap_msdu:
@@ -521,6 +522,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)if (res) goto err_unmap_msdu; + htt->ar->htc_tx++;return 0 ; err_unmap_msdu:
drivers/net/wireless/ath/ath10k/mac.c +73 -3
94 lines not on this page · raw message
Signature · 7 lines
1.7.11.7 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k