From 5ab94f48a2b62fa89de39bbbce264116d895a2ce Mon Sep 17 00:00:00 2001 From: Michal Meloun Date: Wed, 29 Apr 2020 14:14:15 +0000 Subject: [PATCH] Don't try to set frequendcy for enumerated but newer started CPUs. Openfirmare enumerates and installs the driver for all processors, regardless of whether they will be started later (because of power constrains for example). MFC after: 3 weeks --- sys/kern/kern_cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c index 6982a320b25..d8b02f18bd3 100644 --- a/sys/kern/kern_cpu.c +++ b/sys/kern/kern_cpu.c @@ -325,6 +325,12 @@ cf_set_method(device_t dev, const struct cf_level *level, int priority) /* Bind to the target CPU before switching. */ pc = cpu_get_pcpu(set->dev); + + /* Skip settings if CPU is not started. */ + if (pc == NULL) { + error = 0; + goto out; + } thread_lock(curthread); pri = curthread->td_priority; sched_prio(curthread, PRI_MIN);