The branch main has been updated by bz:

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

commit 6387c1135921fbc86ab0f3c1508a3719ca9cac54
Author:     Bjoern A. Zeeb <[email protected]>
AuthorDate: 2025-12-08 00:00:05 +0000
Commit:     Bjoern A. Zeeb <[email protected]>
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
        }
 

Reply via email to