From nobody Fri Jun 03 16:43:14 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 7E9271BD3CCB; Fri, 3 Jun 2022 16:43:15 +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 4LF7wy6KQgz3s1N; Fri, 3 Jun 2022 16:43:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654274594; 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=c2PRJrubDvulqMtdrcjmYozMppxtVDaPjP2UIvTgos4=; b=TF56wj4iq7OB2eWH2CimRyf+Wrwx9xFgBIONwLdtFqWmFeaH0bcdrgnjsB32oZBkujVg7L 07sN1lpx3/+302GnBdUG9YTRDwaM2SMQIP2Pm8alLuInnQqAICGt8ZWefXCD7sYNi4My98 bvKGZE4sA0ui4qXQu3xYRUcCYzwmhPgAQUgv7kxohDFTshDGxrMiwcRn8iNJpiqkvRieTU eRwec7qVyFNTSfPTSDn5VlqPkThvf6klXTDArBxu6L/fCYFxQkZ1dbd+gC9vaKdO/6TwoX H6tkjvg+ntpUu4HJ2c7U/K/+J+F1eGIFJpybK4QYpBqLgd3tfly4OqVU7xMIMA== 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 5A9294DB6; Fri, 3 Jun 2022 16:43:14 +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 253GhEL7021848; Fri, 3 Jun 2022 16:43:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 253GhEJc021847; Fri, 3 Jun 2022 16:43:14 GMT (envelope-from git) Date: Fri, 3 Jun 2022 16:43:14 GMT Message-Id: <202206031643.253GhEJc021847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 806f82499a35 - stable/13 - rtw88: deal with debug messages 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 806f82499a35d020bc258b3a025cd78e6f93ea8a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654274594; 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=c2PRJrubDvulqMtdrcjmYozMppxtVDaPjP2UIvTgos4=; b=vvdH88xvS4aDBJZPq+4hjX85q/I4ryiOMBIFUxlvj4hbiwftRjPQKf8hfo1y0P1+MLwx7m fXQ+j3C2k7vA0wA873EktXDmVqOwYqdfqyOdcIIHmkuaImIV897nOr7H3Ao9OQ3aQHgmZB EhzAqF5cTMHxrO16eMrn0mEtR9D/AedSz4xUONE1EETDfs6orR0k9dEfReEvbs4OEfNOVk ASsVVsbHRK8Rq5WXGI9mrBd8KgyVXLDLZesF5vzss3IDUME9ZhbJ4NmkJCu5Yi/nZpdqDr x+Qgx1KREajsoAyo3Yhkx2kmaHakphHxe4p3MeQLCV3OwumWqnq/8dl9xr6QAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654274594; a=rsa-sha256; cv=none; b=JWAIxki87cmf2bzgYbyPMAbkWHBBK/JW9MZ850en0veaRvoqk7PrBrOPEdV8OfBDRailIi khMYFb4AUlK6skrjPzc2nyH85Ugilb4QF++n0M70xTnWzej9IG9KhtnE+7ebYvKvNOVRMd fv31s3vVKWBmBbsW2PmfiZCI/rZdsYA8WbM4X+HtJXx5ovT6T15fzkPCsSeE6jhHnVWtdD GrS83eN+OYvAv12ZHzWvrtqmbitHcrixl8Fzcn3Zp2xXMyFMl/DvHSj2mr2QSR103Fkg/4 io6nlRfs7ihO+gof3HF42efao3V/NZ84yhCg8lMfQmWwSZC9hxEvJ++lm4DkgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=806f82499a35d020bc258b3a025cd78e6f93ea8a commit 806f82499a35d020bc258b3a025cd78e6f93ea8a Author: Bjoern A. Zeeb AuthorDate: 2022-04-27 15:20:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-03 15:51:30 +0000 rtw88: deal with debug messages The 'failed to write TX skb to HCI' error message is twice in the code. Print the function name and along with the message and also the reported error so it can possibly be helpful. The 'failed to get tx report from firmware' was purposefully changed away from debugging in the upstream Linux driver in 584dce175f0461d5d9d63952a1e7955678c91086 . Revert that decision and extend the logging by the actual queue length so we get an idea how sever the problem is (see PR for a report). PR: 248235 Sponsored by: The FreeBSD Foundation (cherry picked from commit e140d551b78670fbf99c83a59438cb13de50420f) --- sys/contrib/dev/rtw88/tx.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sys/contrib/dev/rtw88/tx.c b/sys/contrib/dev/rtw88/tx.c index efcc1b0371a8..c6c43331b140 100644 --- a/sys/contrib/dev/rtw88/tx.c +++ b/sys/contrib/dev/rtw88/tx.c @@ -159,6 +159,7 @@ void rtw_tx_report_purge_timer(struct timer_list *t) struct rtw_tx_report *tx_report = &rtwdev->tx_report; unsigned long flags; +#if defined(__linux__) if (skb_queue_len(&tx_report->queue) == 0) return; @@ -167,6 +168,25 @@ void rtw_tx_report_purge_timer(struct timer_list *t) spin_lock_irqsave(&tx_report->q_lock, flags); skb_queue_purge(&tx_report->queue); spin_unlock_irqrestore(&tx_report->q_lock, flags); +#elif defined(__FreeBSD__) + uint32_t qlen; + + spin_lock_irqsave(&tx_report->q_lock, flags); + qlen = skb_queue_len(&tx_report->queue); + if (qlen > 0) + skb_queue_purge(&tx_report->queue); + spin_unlock_irqrestore(&tx_report->q_lock, flags); + + /* + * XXX while there could be a new enqueue in the queue + * simply not yet processed given the timer is updated without + * locks after enqueue in rtw_tx_report_enqueue(), the numbers + * seen can be in the 100s. We revert to rtw_dbg from + * Linux git 584dce175f0461d5d9d63952a1e7955678c91086 . + */ + rtw_dbg(rtwdev, RTW_DBG_TX, "failed to get tx report from firmware: " + "txreport qlen %u\n", qlen); +#endif } void rtw_tx_report_enqueue(struct rtw_dev *rtwdev, struct sk_buff *skb, u8 sn) @@ -515,7 +535,11 @@ void rtw_tx(struct rtw_dev *rtwdev, rtw_tx_pkt_info_update(rtwdev, &pkt_info, control->sta, skb); ret = rtw_hci_tx_write(rtwdev, &pkt_info, skb); if (ret) { +#if defined(__linux__) rtw_err(rtwdev, "failed to write TX skb to HCI\n"); +#elif defined(__FreeBSD__) + rtw_err(rtwdev, "%s: failed to write TX skb to HCI: %d\n", __func__, ret); +#endif goto out; } @@ -572,7 +596,11 @@ static int rtw_txq_push_skb(struct rtw_dev *rtwdev, rtw_tx_pkt_info_update(rtwdev, &pkt_info, txq->sta, skb); ret = rtw_hci_tx_write(rtwdev, &pkt_info, skb); if (ret) { +#if defined(__linux__) rtw_err(rtwdev, "failed to write TX skb to HCI\n"); +#elif defined(__FreeBSD__) + rtw_err(rtwdev, "%s: failed to write TX skb to HCI: %d\n", __func__, ret); +#endif return ret; } rtwtxq->last_push = jiffies;