From abc2f56eba2789d232891372a7e52a080f48601d Mon Sep 17 00:00:00 2001 From: patrick Date: Thu, 23 Nov 2023 19:54:30 +0000 Subject: [PATCH] A mountroot hook unsets ci->ci_opp_table in case clocks or regulators aren't available, so we have to continue to check its existence on each kstat read. ok dlg@ --- sys/arch/arm64/arm64/cpu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c index 50446f67855..3e40db9ef38 100644 --- a/sys/arch/arm64/arm64/cpu.c +++ b/sys/arch/arm64/arm64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.100 2023/11/23 01:00:44 dlg Exp $ */ +/* $OpenBSD: cpu.c,v 1.101 2023/11/23 19:54:30 patrick Exp $ */ /* * Copyright (c) 2016 Dale Rahn @@ -1926,7 +1926,7 @@ cpu_opp_kstat_read(struct kstat *ks) struct cpu_opp_kstats *coppk = ks->ks_data; struct opp_table *ot = ci->ci_opp_table; - struct cpu_info *oci = ot->ot_master; + struct cpu_info *oci; struct timespec now, diff; /* rate limit */ @@ -1935,6 +1935,10 @@ cpu_opp_kstat_read(struct kstat *ks) if (diff.tv_sec < 1) return (0); + if (ot == NULL) + return (0); + + oci = ot->ot_master; if (oci == NULL) oci = ci; -- 2.20.1