From nobody Mon Feb 19 08:07:39 2024 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 4TdZs83Ccjz5B2jx; Mon, 19 Feb 2024 08:07:40 +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 4TdZs81C1vz4K8J; Mon, 19 Feb 2024 08:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330060; 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=OV4MXWZpoaJ672opbu3AWuI+0w8O2iSCtR2F8rTEeDQ=; b=AOqeWFmr+B6gwVfwHq6Tvwdmbe2UFbOs/ENbCdUkAvYrIMzcMliM0rG+agvHD2DDIRWm9H K83c91LUia/Mcafe7B5HghpC/mye4SKPmS1+Qa8Q46ncfgYX7xsPna9SgmuApzQ4jAuN5J VXTVAeVyHWW2dDObGYoFqy2vSMvLJtnr/qolZQuyrWDr0RjaQRyyiW1lqJ3xKsh7nt/xuB EpSQ1tV0LsIOKB339DOhLrZEzXReGwLbpm7iVu8ku1xJ8wafv7RyI/WB4BIHaDLufBPkYx tbKyvYcMUFdjtrrpp17j9BxxIbfx+EKZ5+mcHIYSgjgvH0O5oaSKFmR9J1MCHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330060; 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=OV4MXWZpoaJ672opbu3AWuI+0w8O2iSCtR2F8rTEeDQ=; b=RQ5+hvUltbP4xQFVAs4gyGp0unaNwgUO9jZWfomDHsXtkM/3osIHTzsiS5fETo96Y/0B88 PkyBzObiCk8Y9jrSU+GDvM4HB6ZPD6XSNPcbUOlmqWspaQl8QU/tNDsWIPA+lDl0Z3r/uB 2vmAS4AQpGd1imZ8pn0py3Q8JZZ+Cr74JHnZnKsRetBNjwjXZtbUmmu5xvO6anhk5tS5Sk Iupd51f7V2biasq2sJWS+um46W11oJFs5/LUgDuvCfUs36SrScq0QPtNQPjjtuJ5EFCvvt EkwINgk8zND3xi3E4HDfkiEsVnznURvrSIzneksnFn6CRNpaQZOG9/2ZcJL+gQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330060; a=rsa-sha256; cv=none; b=UGQdblCHBRlauGfbKM2OOqTNpM7Fd2SIUIvWrvT31nWxzEvszIOjZ9NUtGYc9C07VwmSXz EaKEUbKMkgV3XvFot7moEJEloL/yBede2kTrYt/+byfu4kofDrz8Gm9QJKZ4uPGIsJikhs 1aEsoMG/LBWG/oihK8M9snIISMggsUZB0pQsKQFhyKytHgEEjnLLD54vh684brZxpYQBZq FL4tXtCQ3fhzA/UUVC4wesrjaE5goyLk+5lB8C2blCbCCBIixzeD1ErumpOdgVD54ci2y+ Hx8LiAA1Aw2TbrJFJ1AiBR/zUtCMitz6WDXaJOJcGAnAef5EmOTcVoKGrWiFBg== 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 4TdZs80HXkzRKj; Mon, 19 Feb 2024 08:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87dfG015434; Mon, 19 Feb 2024 08:07:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87dO4015431; Mon, 19 Feb 2024 08:07:39 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:39 GMT Message-Id: <202402190807.41J87dO4015431@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: 1ff23eeab2ef - stable/13 - rtw89: improve debugging and fix a sleep issue 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: 1ff23eeab2ef83075532c5d4870480062daa837a Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1ff23eeab2ef83075532c5d4870480062daa837a commit 1ff23eeab2ef83075532c5d4870480062daa837a Author: Bjoern A. Zeeb AuthorDate: 2023-09-06 16:47:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:58 +0000 rtw89: improve debugging and fix a sleep issue Improve log messages to be more helpful in error cases. Change one LinuxKPI sleep function as we cannot call the original one from a context we cannot sleep. Both cases were hit during testing. (cherry picked from commit 118d0ff54d4f7cffe6a13a1e0cdb2fe23fbfce74) --- sys/contrib/dev/rtw89/fw.c | 9 +++++++++ sys/contrib/dev/rtw89/phy.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/sys/contrib/dev/rtw89/fw.c b/sys/contrib/dev/rtw89/fw.c index 3a9b7868b069..2035e600b471 100644 --- a/sys/contrib/dev/rtw89/fw.c +++ b/sys/contrib/dev/rtw89/fw.c @@ -481,7 +481,12 @@ static void rtw89_fw_prog_cnt_dump(struct rtw89_dev *rtwdev) for (index = 0; index < 15; index++) { val32 = rtw89_read32(rtwdev, R_AX_DBG_PORT_SEL); rtw89_err(rtwdev, "[ERR]fw PC = 0x%x\n", val32); +#if defined(__linux__) fsleep(10); +#elif defined(__FreeBSD__) + /* Seems we are called from a context we cannot sleep. */ + udelay(10); +#endif } } @@ -2473,7 +2478,11 @@ static int rtw89_hw_scan_prehandle(struct rtw89_dev *rtwdev, ret = rtw89_hw_scan_update_probe_req(rtwdev, rtwvif); if (ret) { +#if defined(__linux__) rtw89_err(rtwdev, "Update probe request failed\n"); +#elif defined(__FreeBSD__) + rtw89_err(rtwdev, "Update probe request failed: ret %d\n", ret); +#endif goto out; } ret = rtw89_hw_scan_add_chan_list(rtwdev, rtwvif); diff --git a/sys/contrib/dev/rtw89/phy.c b/sys/contrib/dev/rtw89/phy.c index c4dfb192035a..60698f3b5e01 100644 --- a/sys/contrib/dev/rtw89/phy.c +++ b/sys/contrib/dev/rtw89/phy.c @@ -1340,7 +1340,11 @@ static void rtw89_phy_init_rf_nctl(struct rtw89_dev *rtwdev) ret = read_poll_timeout(rtw89_phy_nctl_poll, val, val == 0x4, 10, 1000, false, rtwdev); if (ret) +#if defined(__linux__) rtw89_err(rtwdev, "failed to poll nctl block\n"); +#elif defined(__FreeBSD__) + rtw89_err(rtwdev, "failed to poll nctl block: ret %d val %#06x\n", ret, val); +#endif nctl_table = chip->nctl_table; rtw89_phy_init_reg(rtwdev, nctl_table, rtw89_phy_config_bb_reg, NULL);