From d206605e52c867f8e96115aa681eedb068750633 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sun, 16 Apr 2023 08:02:45 +0000 Subject: [PATCH] The lowest performance level state for the E-cores on the M2 Pro/Max is 2 instead of 1. Handle this by taking the lowest state from the opp tables instead of hardcoding it. Fixes cpuperf on the M2 Pro/Max. ok patrick@ --- sys/arch/arm64/dev/aplcpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm64/dev/aplcpu.c b/sys/arch/arm64/dev/aplcpu.c index f11f8e6b7d7..5e661f572dd 100644 --- a/sys/arch/arm64/dev/aplcpu.c +++ b/sys/arch/arm64/dev/aplcpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplcpu.c,v 1.5 2022/12/03 13:31:32 kettenis Exp $ */ +/* $OpenBSD: aplcpu.c,v 1.6 2023/04/16 08:02:45 kettenis Exp $ */ /* * Copyright (c) 2022 Mark Kettenis * @@ -375,8 +375,8 @@ aplcpu_setperf(int level) continue; /* Translate performance level to a P-state. */ - opp_level = 1; ot = sc->sc_opp_table[j]; + opp_level = ot->ot_opp[0].opp_level; for (k = 0; k < ot->ot_nopp; k++) { if (ot->ot_opp[k].opp_hz <= level_hz && ot->ot_opp[k].opp_level >= opp_level) -- 2.20.1