From nobody Sat Feb 7 20:39:35 2026 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 345F127E7EC for ; Tue, 2 Dec 2025 12:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764679550; cv=none; b=Mcqkp0f5OG0K/edi64tzrL2oADxNwqJU9wG4YlPzcRBid/vvfjpHM+xLsbvKQPeUlwZjZ5EsgW4IJjC56Q5Qyw7B0kLY0Zsxt6FBYkO1yyrcRCyFEVUKu9h5Hu/Y2pJy81HmtxZgepn0lMI9V/J2dH3qgico93sk8Dn2W4rAajo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764679550; c=relaxed/simple; bh=QvxPTUgn6Ah2jhGlpw/IJRkeNvZ6zrytATxD987tgSE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WxM3/K0cEPb/UWXIUXTHAHcfFnoEQ6941AV9m+JlVjhTccs0Wnr41gWP0I75f14sF/t7/xRgFsNS5ihGaLUqdNIWQ+X1pgx2D37ZFDRRg2dAdNIvjG7N5OYr7Orau/IcGjAZfQw8YPi2wi03KqSwCGFx/VeRJFQatIV6ZjuEJAI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=gEqTSIoI; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gEqTSIoI" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1764679535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LhwXTuIf2AJ/RF/yCH2U5EKcYR+WCpfYISUflqDshkE=; b=gEqTSIoIFbYho/IFjKbPggb3FwwNr3MAVIRRvbZ0ezkAbgDrxTu15CzsNa0JrtoqhSnTNg yizv1kUqLF6yVkAS40/Uy4fz0rWP0ocygtT7aWYjftv2T4+8PbpOXMkgB2DXBXix6IxwoW VZIlMOYFxbMq3Lb5mGSWKsf5wJWgpzc= From: Thorsten Blum To: "Rafael J. Wysocki" , Viresh Kumar , Thomas Renninger , Borislav Petkov , Jacob Shin Cc: Thorsten Blum , stable@vger.kernel.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: amd_freq_sensitivity: Fix sensitivity clamping in amd_powersave_bias_target Date: Tue, 2 Dec 2025 13:44:28 +0100 Message-ID: <20251202124427.418165-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The local variable 'sensitivity' was never clamped to 0 or POWERSAVE_BIAS_MAX because the return value of clamp() was not used. Fix this by assigning the clamped value back to 'sensitivity'. Cc: stable@vger.kernel.org Fixes: 9c5320c8ea8b ("cpufreq: AMD "frequency sensitivity feedback" powersa= ve bias for ondemand governor") Signed-off-by: Thorsten Blum --- drivers/cpufreq/amd_freq_sensitivity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd_freq_sensitivity.c b/drivers/cpufreq/amd_f= req_sensitivity.c index 13fed4b9e02b..713ccf24c97d 100644 --- a/drivers/cpufreq/amd_freq_sensitivity.c +++ b/drivers/cpufreq/amd_freq_sensitivity.c @@ -76,7 +76,7 @@ static unsigned int amd_powersave_bias_target(struct cpuf= req_policy *policy, sensitivity =3D POWERSAVE_BIAS_MAX - (POWERSAVE_BIAS_MAX * (d_reference - d_actual) / d_reference); =20 - clamp(sensitivity, 0, POWERSAVE_BIAS_MAX); + sensitivity =3D clamp(sensitivity, 0, POWERSAVE_BIAS_MAX); =20 /* this workload is not CPU bound, so choose a lower freq */ if (sensitivity < od_tuners->powersave_bias) { --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4