aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2022-08-17 16:11:47 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2022-08-17 16:11:47 +0000
commite674ddec0b4138274539587fe9336b577ff1242a (patch)
treeffe4590742ea665b25357a95d1672aac5e86a481
parent489482e276cf301ba3c47e022a50b0f4f6d2b6f2 (diff)
downloadsrc-e674ddec0b4138274539587fe9336b577ff1242a.tar.gz
src-e674ddec0b4138274539587fe9336b577ff1242a.zip
iwlwifi: add FreeBSD specific debugging
"Invalid TXQ id" and "Queue <n> is stuck <x> <y>" are two errors seen more commonly by FreeBSD users. Try to gather some extra data the "easy way" adding more error logging for these situations in the hope to find a clue or at least do more targetd debugging in the future. Note that for one of the errors the Linux Intel driver has a TODO to print register data. If that will show up in future versions of the driver this may also help. Sponsored by: The FreeBSD Foundation MFC after: 3 days
-rw-r--r--sys/contrib/dev/iwlwifi/mvm/tx.c5
-rw-r--r--sys/contrib/dev/iwlwifi/queue/tx.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/sys/contrib/dev/iwlwifi/mvm/tx.c b/sys/contrib/dev/iwlwifi/mvm/tx.c
index 8125bb76f59e..303d9b1e5a02 100644
--- a/sys/contrib/dev/iwlwifi/mvm/tx.c
+++ b/sys/contrib/dev/iwlwifi/mvm/tx.c
@@ -1139,6 +1139,11 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
WARN_ON_ONCE(info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM);
if (WARN_ONCE(txq_id == IWL_MVM_INVALID_QUEUE, "Invalid TXQ id")) {
+#if defined(__FreeBSD__)
+ IWL_ERR(mvm, "fc %#06x sta_id %u tid %u txq_id %u mvm %p "
+ "skb %p { len %u } info %p sta %p\n", fc, mvmsta->sta_id,
+ tid, txq_id, mvm, skb, skb->len, info, sta);
+#endif
iwl_trans_free_tx_cmd(mvm->trans, dev_cmd);
spin_unlock(&mvmsta->lock);
return -1;
diff --git a/sys/contrib/dev/iwlwifi/queue/tx.c b/sys/contrib/dev/iwlwifi/queue/tx.c
index 3f6bda96bfb5..eb290a4fd06a 100644
--- a/sys/contrib/dev/iwlwifi/queue/tx.c
+++ b/sys/contrib/dev/iwlwifi/queue/tx.c
@@ -988,6 +988,19 @@ void iwl_txq_log_scd_error(struct iwl_trans *trans, struct iwl_txq *txq)
if (trans->trans_cfg->use_tfh) {
IWL_ERR(trans, "Queue %d is stuck %d %d\n", txq_id,
txq->read_ptr, txq->write_ptr);
+#if defined(__FreeBSD__)
+ /*
+ * Dump some more queue and timer information to rule
+ * out a LinuxKPI issues and gather some extra data.
+ */
+ IWL_ERR(trans, " need_update %d frozen %d ampdu %d "
+ "now %ju stuck_timer.expires %ju "
+ "frozen_expiry_remainder %ju wd_timeout %ju\n",
+ txq->need_update, txq->frozen, txq->ampdu,
+ (uintmax_t)jiffies, (uintmax_t)txq->stuck_timer.expires,
+ (uintmax_t)txq->frozen_expiry_remainder,
+ (uintmax_t)txq->wd_timeout);
+#endif
/* TODO: access new SCD registers and dump them */
return;
}