From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.132 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796354383; b=BiLC4ebqidRI7T7KCuY7YYX+i2Nd6F4RhLF0cvwn/P1txciDccqcWo2ElCnoVZfyr9a5 huqvdN8aDJNeyEYzpYAKeok/gNw9486SChC1HW6MLtMPad0dT82taqtCNpTcwvED2ZrNU riPBzYX+MZBpaIwKrmQWURJyAtKZa0b2Nn9LUTA8FheWX4e/euvL/rqaqneQyxg+lM+Rp uh0e59qAAbvOIWQUpXp9nPFN5ucfTf5ZzL5Grgi3B25vfrH70fWobjNu+a6fYwpCHB7Db 3v1aL5fbso5ALupEZwOkc5NutDiCqjIWhG5t15Pqfs1l/BqLCUoN/HNUGkj0XfQIfcg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796354383; 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=oGtPanz2ZjTr16zKtuW4LGqMGsi3oeogjv52xKY8I44=; b=I/E0pyFqyKR+MiB3Lpt2zesS0KNFDqBlTqGnoDn7GlFR5XuccVbzxI3A/VMP8T0CNkMf T91a0Q544hpQOo3/H9APZgHPtNO7BBpLZvKWqMAtv+ZMBo4XJ4vFQ6tnHXn2T1s9jfcoO 2CEcR0wNfS1ESM1HXCEFdt3qcTgRcnm5Ztu7iUDYoniCI9osSJXEDPIqKOIJqHNR96e2j AS1E7I+uGqM3oROrp0rs2tDhFn90yYy4YI5Fo7/7j+VeBglENz1ZbX/0bU8rzZlnZ2Vpt YYXYp2/kawjdS99vHc77RTN9rjkqlsZlczsp98VM8L9cK03lXsJii7DUxZYMWXN3Jkw== 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=ygLfpkVv; arc=none smtp.remote-ip=115.124.30.132 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (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 C5623606A337; Fri, 4 Dec 2026 03:19:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C5623606A337 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=ygLfpkVv DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796354380; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=oGtPanz2ZjTr16zKtuW4LGqMGsi3oeogjv52xKY8I44=; b=ygLfpkVvIQZc//SQPdrGPtkBGfZP7WcHUhM/v53gFmIqK4vSjZkw3xTrFY6oRupNxGdmnrBx6uGuX5IL0XX07SRgfH0KNVKby1FlI4OzRHKcANUfayFpayMapIakNUcHqXqJPkGisTqw7z7ndtPexWHNI43Mk6lT5hUzc7k8yhE= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R171e4;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_---0XGFrZs8_1796354377; Received: from h68d07384.sqa.eu95.tbsite.net(mailfrom:jiangtianfeng@linux.alibaba.com fp:SMTPD_---0XGFrZs8_1796354377 cluster:ay36) by smtp.aliyun-inc.com; Fri, 04 Dec 2026 11:19:39 +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 v7 1/2] cpufreq: Allow global boost updates without active capable policies Date: Fri, 4 Dec 2026 11:19:25 +0800 Message-ID: <20261204031926.278915-2-jiangtianfeng@linux.alibaba.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261204031926.278915-1-jiangtianfeng@linux.alibaba.com> References: <20261204031926.278915-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. Reviewed-by: Christian Loehle Reviewed-by: Zhongqiu Han Acked-by: Viresh Kumar Reviewed-by: Pengjie Zhang 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