From 64304dc353bffb7ce6b3bc2ae8088e442b78d2b5 Mon Sep 17 00:00:00 2001 From: yuripv Date: Sun, 29 Nov 2020 01:43:04 +0000 Subject: [PATCH] hwpstate_intel: don't unconditionally print the error message Actually check the wrmsr_safe() return value when setting autonomous HWP for package. PR: 245582 Differential Revision: https://reviews.freebsd.org/D24744 --- sys/x86/cpufreq/hwpstate_intel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/x86/cpufreq/hwpstate_intel.c b/sys/x86/cpufreq/hwpstate_intel.c index 86c0b0fb2f29..f6e63fdeb854 100644 --- a/sys/x86/cpufreq/hwpstate_intel.c +++ b/sys/x86/cpufreq/hwpstate_intel.c @@ -461,8 +461,10 @@ set_autonomous_hwp(struct hwp_softc *sc) * not exist." (Intel SDM ยง14.4.4) */ ret = wrmsr_safe(MSR_IA32_HWP_REQUEST_PKG, sc->req); - device_printf(dev, - "Failed to set autonomous HWP for package\n"); + if (ret) { + device_printf(dev, + "Failed to set autonomous HWP for package\n"); + } } out: