From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 11C4535EDBD; Tue, 21 Jul 2026 17:45:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784655944; cv=none; b=ObZNAfIE2gBkpO4rbghBmvqbrcgzphmTu+BIRJpxlWaMC7CoqRok1XtkgCqeAeHH4/n6X8afRDAgNTbPBdJt9tdq/cUHhYVXSTL0Hx7Am+D+WEDOWY1IhEd5gmvSUc4HR8YfYWCwbj+Xr7hmAUpsDUpVaOiLJQG0Ux+lzWCNV/o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784655944; c=relaxed/simple; bh=sGpDLnn30t3x0DGV+bkh3GKXj3f0bNstJb0oP8PuQmI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o3twof6WdLMSbMrx6rud3H3OdowZmcA9C11Cu5nfTgbvguVeSnd7zdvq91NtRd9I/2vJEfG1xo9GZ0ZmYOun9Vob3CpIoK80tjicmG/MzmdR7Ird8QRr0EDchV2YVZKJWfvbROAzCuXD/yO+v5qZW0cF4XedMXwXPUYl7KCUxkw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=S8a2hTIN; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="S8a2hTIN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78EC41F000E9; Tue, 21 Jul 2026 17:45:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784655943; bh=Ad9+1sWDtHS6VlnMXTqtTbem70A4zQt0nn/xnvNan2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S8a2hTINrLoOHZxUvrxPJEHvn2tS+Lxq2/AH4TKLpYdhZGDrtMrY/sorck758u7cB u3lLPU5fNGna79zMmJXjetU8cFeAWEgRq9KPADNXoGAhwQyNu0d1klCiLVmjA8rKFQ FPu1gGom33Ib/NBYe0Fr9U9Sme+4e/wvKGjTkCuo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lifeng Zheng , Viresh Kumar , Zhongqiu Han , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.18 0201/1611] cpufreq: conservative: Simplify frequency limit handling Date: Tue, 21 Jul 2026 17:05:17 +0200 Message-ID: <20260721152519.477516327@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152514.750365251@linuxfoundation.org> References: <20260721152514.750365251@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lifeng Zheng [ Upstream commit 3494dff89779b73a6c70481c982e0e96d336454a ] cs_dbs_update() performs explicit checks against policy->min/max before updating the target frequency. These checks are redundant as __cpufreq_driver_target() already clamps the requested frequency to the valid policy limits. Remove the unnecessary boundary checks and simplify the update logic. This also fixes an issue introduced by commit 00bfe05889e9 ("cpufreq: conservative: Decrease frequency faster for deferred updates"), where stale target comparisons could cause frequency updates to be skipped entirely after deferred adjustments. Closes: https://lore.kernel.org/all/20260421123545.1745998-1-zhenglifeng1@huawei.com/ Fixes: 00bfe05889e9 ("cpufreq: conservative: Decrease frequency faster for deferred updates") Signed-off-by: Lifeng Zheng Co-developed-by: Viresh Kumar Signed-off-by: Viresh Kumar Reviewed-by: Zhongqiu Han Link: https://patch.msgid.link/292e6d937890f135e30ec0d2107eaad47cb9a976.1779423281.git.viresh.kumar@linaro.org Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpufreq/cpufreq_conservative.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 305a32b6b302e7..60bab2b71b1b93 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -103,10 +103,6 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy) if (load > dbs_data->up_threshold) { dbs_info->down_skip = 0; - /* if we are already at full speed then break out early */ - if (requested_freq == policy->max) - goto out; - requested_freq += freq_step; if (requested_freq > policy->max) requested_freq = policy->max; @@ -124,13 +120,7 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy) /* Check for frequency decrease */ if (load < cs_tuners->down_threshold) { - /* - * if we cannot reduce the frequency anymore, break out early - */ - if (requested_freq == policy->min) - goto out; - - if (requested_freq > freq_step) + if (requested_freq > policy->min + freq_step) requested_freq -= freq_step; else requested_freq = policy->min; -- 2.53.0