From nobody Wed Apr 27 15:26:02 2022 X-Original-To: dev-commits-src-main@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 045AA1AB51A6; Wed, 27 Apr 2022 15:26:03 +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 4KpMyy6KPlz3pjj; Wed, 27 Apr 2022 15:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651073162; 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=JiQtOpFGpM8H3DVubhK5H3pwqIql9qGzLbpFcn7Eo2w=; b=SySSFvFTw3rOhDojBypXPxLGVo9sJXMIiJBFLqfMFuaioH67mSgFM7F5+X5x/3+Ro6EaCW bfSgonx5+hXTdXhfryw/CyCVWMtL1VCOPIJF/mRBkEmyxVcdCtXFuqB4Xka40fA3bMbbN5 eSQ/KFJ0L9nc1hDXvvkqg5DjIzekINuDibY5c4553DYUhof5Id+EqPw1R+PMJsikOW11vc xMlpRdmHQ8c2LNzls1OPl9XPgyFiPRzvPlHXZxKgy96g4stozuyOZN3xUJ3Ex0LeBMA4K/ wZxFJVgYfVDU5wRZGLm+bQkP4QGt5Wvlvo+ESwACg4KT+j4b8l3+P0FGA2tk4A== 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 B8E5E2654F; Wed, 27 Apr 2022 15:26:02 +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 23RFQ2fV021773; Wed, 27 Apr 2022 15:26:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23RFQ29P021772; Wed, 27 Apr 2022 15:26:02 GMT (envelope-from git) Date: Wed, 27 Apr 2022 15:26:02 GMT Message-Id: <202204271526.23RFQ29P021772@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: e140d551b786 - main - rtw88: deal with debug messages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: e140d551b78670fbf99c83a59438cb13de50420f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651073162; 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=JiQtOpFGpM8H3DVubhK5H3pwqIql9qGzLbpFcn7Eo2w=; b=XTReFpDkFjg0e5ga6f4+5FIsNkFGNw3u1qkU7DmVxXwgCVf8xJTMlW22I4SGGf2Nm5j40t w1bZOrEgYWsdIYHG2T6irVF7ZKUccJO2CQwP1vpLCY9JXqHo8KRKjTNHAbLXhPhKtS6Vj9 UEcVsY5ImUK/A0ZG9sTxZOe7gU/uW6t07fcrAiZjUCfsn1JDIFjhY9X9q5nhVqK/tT/q7I kS3YSkof21sJN5/bMBJNNHkV+F2grNA9pe0fF0BY1MZCGD5lQIj1Vrhd7yS9mQRajjo7N+ 19+y0eaawJ+WmUjuZ+CDVeu7E8XevES09d9muwRJ+Ino6f5qy6mEcV2WB6l1Ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651073162; a=rsa-sha256; cv=none; b=OAa+0Z4eB9gjasQOm3Kf4bBY+AdbhPxRE7m7Ix8rSvNEVlxTm0MBxa+seg3S7ksc5UNIlp b4VLWsc0Q1XJanoU+/8zhXpHOZfaUEebiZRI0jmZqGn9nC4ox7Fl9gGW9fScwYIdf56Y8z wBjd6HnndBVZF0z+BOJShUAvXMzUfkmOI6HFs0KztMF2lr7vz24y00eRznerJx8V+MloXH N5iixUrJR0+7GOoHRvkitdaTgkRPLl6jggJS/JqmNbz8QjPcyQQHp6h+rB+N4gSEmKhVY4 DQ928hwhg8V5iFDF3OIMXpZVcLMdM6Ff27bRgStoQW3JNp1KSGyE2yp9JqiVdw== 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=e140d551b78670fbf99c83a59438cb13de50420f commit e140d551b78670fbf99c83a59438cb13de50420f Author: Bjoern A. Zeeb AuthorDate: 2022-04-27 15:20:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-04-27 15:20:34 +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 MFC after: 3 days X-MFC: only to get the reminder for later --- 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;