Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2026 00:46:48 +0000
From:      Bjoern A. Zeeb <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 6387c1135921 - main - ath10k: fix a schedule() call
Message-ID:  <698a7ff8.3152a.5222f675@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=6387c1135921fbc86ab0f3c1508a3719ca9cac54

commit 6387c1135921fbc86ab0f3c1508a3719ca9cac54
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-12-08 00:00:05 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-02-09 21:49:45 +0000

    ath10k: fix a schedule() call
    
    Using kern_yield does not seem ideal either for polling here;  use a
    schedule_timeout() call from LinuxKPI instead and use about 100
    iterations per second.
    
    Improve an error message to include the error code so we have a better
    idea of what happens.
    
    MFC after:      3 days
---
 sys/contrib/dev/athk/ath10k/bmi.c | 5 +++++
 sys/contrib/dev/athk/ath10k/pci.c | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/sys/contrib/dev/athk/ath10k/bmi.c b/sys/contrib/dev/athk/ath10k/bmi.c
index 6dd92d29f631..30dded5b6bbb 100644
--- a/sys/contrib/dev/athk/ath10k/bmi.c
+++ b/sys/contrib/dev/athk/ath10k/bmi.c
@@ -66,7 +66,12 @@ int ath10k_bmi_get_target_info(struct ath10k *ar,
 
 	ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen);
 	if (ret) {
+#if defined(__linux__)
 		ath10k_warn(ar, "unable to get target info from device\n");
+#elif defined(__FreeBSD__)
+		ath10k_warn(ar, "unable to get target info from device: %d\n",
+			    ret);
+#endif
 		return ret;
 	}
 
diff --git a/sys/contrib/dev/athk/ath10k/pci.c b/sys/contrib/dev/athk/ath10k/pci.c
index e613eaf24797..e9b8573a698b 100644
--- a/sys/contrib/dev/athk/ath10k/pci.c
+++ b/sys/contrib/dev/athk/ath10k/pci.c
@@ -2340,8 +2340,11 @@ static int ath10k_pci_bmi_wait(struct ath10k *ar,
 #if defined(__linux__)
 		schedule();
 #elif defined(__FreeBSD__)
-		/* Using LinuxKPI we'll hang for-ever as there's no wake_up */
-		kern_yield(PRI_USER);
+		/*
+		 * Using LinuxKPI's schedule() will hang for-ever as there is
+		 * no wake_up.  Poll about 100 times per second until timeout.
+		 */
+		schedule_timeout(BMI_COMMUNICATION_TIMEOUT_HZ/300);
 #endif
 	}
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?698a7ff8.3152a.5222f675>