From nobody Wed Aug 17 16:20:41 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M7CtK6W4Xz4ZptX; Wed, 17 Aug 2022 16:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7CtK61Rdz3ljZ; Wed, 17 Aug 2022 16:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660753241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oh7CxWhrnkNHNiMvvRozwPokWEZo6Kqv94jrlREzgYI=; b=s84rhyEg33pH7Ph3OaSs96LnC9sMfWFMMmK4xBx8NthzsErH/6tOgf5Hp7ss4hzhYUbkg7 3oLr2yT7DXRqXIFedYO4uIr6LKTha8eaKIA7AE/6Ywb0ixbmR9GRZUtiYueXhvCYq4aJf/ ZTfNfBPaB1Ar/p382Tnx7ATnfQOudb90qKHabTuC4vqe8wogS51aU9C4e3CKFk8mV9lyDv A142QDhwCklYE2Qbe5HWlHonzR3k9CXDsDslCfEdoYlX7qdP8WixVtlcVkdFxkE8mxi9FS tBi2HxY7mTx5rSDi5RxTX4xGRzVhRv+dtCQect0toVd0NqmflBGAz4hzcqtXDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M7CtK54f5zw2s; Wed, 17 Aug 2022 16:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27HGKfX4093697; Wed, 17 Aug 2022 16:20:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27HGKfKX093696; Wed, 17 Aug 2022 16:20:41 GMT (envelope-from git) Date: Wed, 17 Aug 2022 16:20:41 GMT Message-Id: <202208171620.27HGKfKX093696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e674ddec0b41 - main - iwlwifi: add FreeBSD specific debugging List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e674ddec0b4138274539587fe9336b577ff1242a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660753241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oh7CxWhrnkNHNiMvvRozwPokWEZo6Kqv94jrlREzgYI=; b=tRnRGJA0dR+boOSCSPpMu22Co5veKhr3980fd0q5DizskO97+mj3qKTLs5LKVE6IQCCtU2 KuVOdlpZFO0KvIFroxKxWJlp1AUTYlGZ1HXr/rMa1t/6U1MCEcOz+owk6PRqHr95YAOv+z LnipBLkZz0XsS2dxa3t+yoqD1L2nVov8T/WUFuczK4CEUGntHKVr7pwSeQqe2rfKq55al4 6X3IH9GCtrs+oX0z6RvIIpPdPnnandDQ83uSiyl2RoUyhYxS07mJlto8v0DsxsEdxlYiyg i3ebD7mS+MU0qUV2DIVt55mzYkg09y5QHsc6BC+N+kMi5dkr85ysfQchPNBrYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660753241; a=rsa-sha256; cv=none; b=ZMhAeeKxRG5pQuJBSnorkwV8OFzah4Ba0QmBlkVGDjb0Rs4lLi95NeFjqj140Pms72BzgA lW/i6fT4LZlg2s1vyzLfMBffXGHrdnN81lyNsRnMJ2Jt032ABa7tqSktdy9/G6nNSktt83 X9tVCtlr/u8ZwHx3Bcb9U3ZldOatXYkUMQ3w36a5FLs/jn38fzqXA+SDhhr/vUE2MN226d skhqBCHVzLHUwP/1KyjQfJrkJvZrDEaSgg5KDc1qEVVPzry5x3MIz+LfiDNPLHnbGlQAyM TTjH3WXL1LfaRQyfxyVraHWa9omySa2UtGcsoGs3Q9vExWMoVrFDsSbUBC6udg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e674ddec0b4138274539587fe9336b577ff1242a commit e674ddec0b4138274539587fe9336b577ff1242a Author: Bjoern A. Zeeb AuthorDate: 2022-08-17 16:11:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-08-17 16:11:47 +0000 iwlwifi: add FreeBSD specific debugging "Invalid TXQ id" and "Queue is stuck " 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 --- sys/contrib/dev/iwlwifi/mvm/tx.c | 5 +++++ sys/contrib/dev/iwlwifi/queue/tx.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) 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; }