From 1fa1cd57aa0253c8a3fc640a87644c205b05d8b8 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Tue, 2 Jun 2020 10:11:09 +0000 Subject: [PATCH] Initialise the firmware_log early on before the tunables are read as after that we might get into the log functions passing the bitmask and would panic as the mutex would not be initialised. Fixes Issue #31. Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") --- otus/freebsd/src/sys/dev/athp/if_athp_core.c | 2 +- otus/freebsd/src/sys/dev/athp/if_athp_pci.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/otus/freebsd/src/sys/dev/athp/if_athp_core.c b/otus/freebsd/src/sys/dev/athp/if_athp_core.c index 0c8fda55..1259c896 100644 --- a/otus/freebsd/src/sys/dev/athp/if_athp_core.c +++ b/otus/freebsd/src/sys/dev/athp/if_athp_core.c @@ -1737,7 +1737,7 @@ ath10k_core_register_work(void *arg, int npending) goto err_release_fw; } - ath10k_fwlog_register(ar); + /* See athp_pci. ath10k_fwlog_register(ar); */ status = ath10k_debug_register(ar); if (status) { diff --git a/otus/freebsd/src/sys/dev/athp/if_athp_pci.c b/otus/freebsd/src/sys/dev/athp/if_athp_pci.c index fe99cf0c..d4b841cd 100644 --- a/otus/freebsd/src/sys/dev/athp/if_athp_pci.c +++ b/otus/freebsd/src/sys/dev/athp/if_athp_pci.c @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #include "if_athp_buf.h" #include "if_athp_trace.h" #include "if_athp_ioctl.h" +#include "if_athp_fwlog.h" static device_probe_t athp_pci_probe; static device_attach_t athp_pci_attach; @@ -717,6 +718,9 @@ athp_pci_attach(device_t dev) #endif ar->sc_psc = ar_pci; + /* Attach the log to gather information early if tunable is set. */ + ath10k_fwlog_register(ar); + /* Load-time tunable/sysctl tree */ athp_attach_sysctl(ar);