From nobody Mon Jan 08 15:38:53 2024 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 4T7ys92Pydz566Mj; Mon, 8 Jan 2024 15:38:53 +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 4T7ys91k7dz4PZv; Mon, 8 Jan 2024 15:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704728333; 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=9W2vtwab5mgH2xJVrFVQJo2pWk8k6nEeF1H6VM8DP5A=; b=LAoUpaqDrMz5BLxvVucAtvtSrwWkDermK2tHE3hdHSwgE6JYYRaPc15OsYGRQEG8z2rHec kSizwi6BS0W/gNgfmlYTHNlPiIrfykNufa7Gc6lu/Unz8//nqgPytRg/6IHVvrZGTNrteU dcXQiXxIGRtMoAzx+Ni5SQOcPQoqvIISHXFPpPXz/P7DeYwHoC/bemVvpzQohom4y2pzct JqDkFIPyX5wwHrZXv+2pHqLdjP6ln6Dl7TUjq6YC8VIqrUbUMYY0/lucQj4oMhvWuA75Jg wej3mGRvjOBM0xv9otoh3OE23akS+jqXjDSz1tews6n1l1E/2fH/sGAs6nmk9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704728333; 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=9W2vtwab5mgH2xJVrFVQJo2pWk8k6nEeF1H6VM8DP5A=; b=aOWTcZ7yb3r2Dhkjwzz5C5BymtErZIsYhhGjMi54kW8S9ImOg4SI5nnsvRsHIj2/yzCa2k Z6sAVTAet9HmesOYdFf9J1ecUFR7hXIkIg5SLlTC82eMp60rthQfWM5nOURZaZ0KZA20u9 FyeVbiPU/szY0VbKqU00Bg/DG3/UnIjgLIqd9JL4+ANt6M0NsBo+ywfRttKj2Nea0Sd60H mz8pJ2erI9JTDOu79/cVCk/yPQ96UNepxI/R5TLDmQMRYIAAMMwZoq/GbvhA9W906bIxqt 5evN4Tpv1PVIxm3szJIWyAqtIVqPJwX1eYLpO1aJJX1omrFLsiGhgx01dXIUpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704728333; a=rsa-sha256; cv=none; b=JgKywohnJtbXb05/YR+8hUogYOhHTy52XEXXTYYSo3w1afmKochKJfoBEYLDvee6EoxJ8n lXXuddgBPHaW8ByHbdMhfWWcRRAspy+6+PgIw7HBF3QCEU6N6TFckQRiR6aRr2DbFgR26n wVqDNzpTCDCnQmRlVOp/N+3IR0HSRufXw0xsFuvvFZjbu/9zQ7fLS/CQtxTIkJaYOJmxRp a6LFebO+E1HhEaquQOt+QbnawVIhjNznX29TBvN/UAQ+Xns9V45YfSIGpPNDs4C06Yh8HS V8INi8ZN04v2qWHCKwqlTm9nLof0Mlf3mZJ32+ByjmlW8bWvGEWgC1hGqTANrw== 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 4T7ys90gW7z1Bvq; Mon, 8 Jan 2024 15:38:53 +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 408Fcr7t018502; Mon, 8 Jan 2024 15:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408Fcric018499; Mon, 8 Jan 2024 15:38:53 GMT (envelope-from git) Date: Mon, 8 Jan 2024 15:38:53 GMT Message-Id: <202401081538.408Fcric018499@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: 118d0ff54d4f - main - rtw89: improve debugging and fix a sleep issue 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: 118d0ff54d4f7cffe6a13a1e0cdb2fe23fbfce74 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=118d0ff54d4f7cffe6a13a1e0cdb2fe23fbfce74 commit 118d0ff54d4f7cffe6a13a1e0cdb2fe23fbfce74 Author: Bjoern A. Zeeb AuthorDate: 2023-09-06 16:47:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-01-08 15:38:22 +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. MFC after: 3 days --- 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 17e4ce7cd64a..c1dade182d88 100644 --- a/sys/contrib/dev/rtw89/fw.c +++ b/sys/contrib/dev/rtw89/fw.c @@ -903,7 +903,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 } } @@ -3890,7 +3895,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, connected); diff --git a/sys/contrib/dev/rtw89/phy.c b/sys/contrib/dev/rtw89/phy.c index e2b8303d3f63..138788b2ed05 100644 --- a/sys/contrib/dev/rtw89/phy.c +++ b/sys/contrib/dev/rtw89/phy.c @@ -1439,7 +1439,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 = elm_info->rf_nctl ? elm_info->rf_nctl : chip->nctl_table; rtw89_phy_init_reg(rtwdev, nctl_table, rtw89_phy_config_bb_reg, NULL);