From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.118 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796092224; b=TQIEoFaT3vGHGCvypf2tKxDxVyRz6l8cdmTeuf0p+wf2R56jnj5HpK/2tfnc4x7ndclR jxgyS0GV0PDK0pDYqtqxkh5c9tMi0o2O6omJ9FpmeYSqpA2te56Ig2A0uW7SH9wQdejF3 wCBBcttK4ixqVcTmpIh7LEAYL6mOMjdcDYQbziJWk8/iOfiDSmg0FVN1PuSPUYzqPWaBB 4r42D08xFpg8TQoWQced+fEqNZGIRWfXNFEk/6B7mHeTYyekR5Zz9I/+aexGxRD0mqcP7 EYuiYMFZZG7jpgbMpZzOXmfys74s/RrcRxiWW2M2XjePc76vOAG3srmtFtoXEe+zLHA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796092224; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=X5HgkbOgKvVbdNXJm9pjrPZDrZKPGp1MG3y2xXZ/Xck=; b=pR2iVTvIQjZxZ++tgOFswQ/6+J8diMaWddF+LTWpPmg5flG9QASk8I9qW0AlwKd8imdE Jt8SCITIcbW+X2x6JIYo6Tw/1sZmdhULJW/01LrPRMY43Fnn4ZpOe3PFhqC7LSH7iqLSC 22mr2K9VGahZJSnEteH55QCPQJOVrSxKn75PvjGbZ1ncJxOznz25WqC2dSkbivm3psbvl iJltmHcqTAxTcqj4LTRhNnOSYX8qOacBWu88B/Pi0rIkNf1GtZIJD2L3dBE2q9A2Cb84q ht8xMsFJbMCvheePv5BM1TYQgt5K6zUNiqm8Szzn70mJfUtutzHg/XvbsuztP0pRrcQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=gt31EKLx; arc=none smtp.remote-ip=115.124.30.118 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58F9E606A32C; Tue, 1 Dec 2026 02:30:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 58F9E606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=gt31EKLx DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796092214; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=X5HgkbOgKvVbdNXJm9pjrPZDrZKPGp1MG3y2xXZ/Xck=; b=gt31EKLxjXLNx9D8x13X19BaBJjDklD14X8Cee0fUdrkc0SBZ7XFYFqUzM4PsPYfCTJ86E54/CmKjNUtJ5/MWd85svSTkUg0Z/l/jy2hdVUMzv/skAJ+0E4BXjlq26opPwsYsGyrM6I1JKx3bLmjRj4jKysfd9md6A+sv9ujGjI= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037009110;MF=jiangtianfeng@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0XFrUthM_1796092211; Received: from h68d07384.sqa.eu95.tbsite.net(mailfrom:jiangtianfeng@linux.alibaba.com fp:SMTPD_---0XFrUthM_1796092211 cluster:ay36) by smtp.aliyun-inc.com; Tue, 01 Dec 2026 10:30:14 +0800 From: Jiangtian Feng To: rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, zhongqiu.han@oss.qualcomm.com, christian.loehle@arm.com, ananthu.cv@oss.qualcomm.com, pierre.gondois@arm.com, zhangpengjie2@huawei.com, zhenglifeng1@huawei.com, zhanjie9@hisilicon.com, Jiangtian Feng Subject: [PATCH 1/2] cpufreq: Allow global boost updates without active capable policies Date: Tue, 1 Dec 2026 10:30:00 +0800 Message-ID: <20261201023001.1131130-2-jiangtianfeng@linux.alibaba.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261201023001.1131130-1-jiangtianfeng@linux.alibaba.com> References: <20261201023001.1131130-1-jiangtianfeng@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Global boost grants permission to use boost; it does not require boost to be active on every policy. Saving that permission should not depend on at least one boost-capable policy being active when the global knob is written. Since commit 77cf053b041f ("cpufreq: Return -EOPNOTSUPP if no policy supports boost"), cpufreq_boost_trigger_state() returns -EOPNOTSUPP when the active-policy loop has no boost-capable policy, and store_boost() maps that error to -EINVAL for the global sysfs write. Besides rejecting an otherwise valid preconfiguration, this prevents users from disabling boost before a capable policy becomes active when a driver starts with boost enabled by default. Initialize ret to 0 so the no-active-capable-policy case saves the requested global state and returns success. Continue to call policy_set_boost() for every active, boost-capable policy and preserve all real callback failures. This intentionally changes the no-policy result introduced by 77cf053b041f. Link: https://lore.kernel.org/all/467b9ef5-1fc3-4771-9895-363e815670c7@huawei.com/ Qoder, an AI coding assistant, helped analyze the default-enabled case, review the active-policy/error semantics and draft this change and description. Runtime hardware and hotplug behavior remain subject to final review and validation. Signed-off-by: Jiangtian Feng --- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 4332cb114070..e97838e40a54 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2887,7 +2887,7 @@ static int cpufreq_boost_trigger_state(int state) struct cpufreq_policy *policy; unsigned long flags; bool boost_enabled; - int ret = -EOPNOTSUPP; + int ret = 0; guard(mutex)(&cpufreq_boost_mutex); -- 2.47.3