From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=113.46.200.218 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796295464; b=DamI+noynnKW4EyLg9FfVTOj7+WoivDm63dzMI1q8/vKMbBrbGyvvwsYgl/tepiwuNCL x+UbMmecg9NTaIBXQw41ajX22XKiV9zTi7b4seqg1O2nKcZsgQ1AK2chTj98/trWf2Kav Ns+dbZRrRT+K/ihWpzhlt40Ylaox8uBW7fhTIhbvfH5KtSnX8lML+GWUVUOIX+c39lKN1 lyKLw12Tp5+e1ul89FqpNT2RWw5g77gYwaGXLFCRfSqVIdSltnTuIZrw2/V334Yoxo6n8 zMKr98pbud1qJR0Xv2R4eOZQYdX2iLEKxiZE9ph3bhxOp0VEeOb5lLxjWYV2yOGs6HA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796295464; h=DMARC-Filter:dkim-signature:Received:Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:CC:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Originating-IP: X-ClientProxiedBy; bh=tvzmO7TQ7hBe6VPPPoXRGRYyR6S0ex5PZDBSRauRphs=; b=L6SihMEjyEulyhckw1E2SfmdG8LRPdkS5vb3Uq7RZPelsz3fqgjnv215iWklJwEMSLtW ZABSnnLkITNt1nJaXcqA+njnbesnoZ66PhFRnfYmUg18VYB/YDufZVNDRfSRutu+4j22N w4f9RCS4ySMpTBtjZTM2i7U24RjgYu3S877Q8g86i73fpqV/IZVDCoHM+/PAF3WpKopOY HuiaPVd6gaYSWLPN+WeA622V5aQpNBVVWp14/5xyyScfk3kCVzmmtR4Tw06LVJTCHj9LP 3S2pvoZ/kiUbVBhEAeKrccFxnXf02TMHbzfDrQdx3tZMtjfWG3umfJugdAvomOXJ31Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=XCInpdqM; arc=none smtp.remote-ip=113.46.200.218 Received: from canpmsgout03.his.huawei.com (canpmsgout03.his.huawei.com [113.46.200.218]) (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 0D072606A322; Thu, 3 Dec 2026 10:57:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0D072606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=XCInpdqM dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=tvzmO7TQ7hBe6VPPPoXRGRYyR6S0ex5PZDBSRauRphs=; b=XCInpdqMs1Hlmxgwrkmt/TJTw6bPT6Pg7qwRAULCk7KmY7LIfAL6MQ1z328ysAaEVKABb9lHn ERNeg5CA/h/1M0P9KCUIyBdUlz4FeeNCJ30BvrSFQfAEizs/bYsyTCdQOb0fY8P+WlGlXjipoQ8 xEQj9JAyLF+hoVaWi7Rn+t8= Received: from mail.maildlp.com (unknown [172.19.162.223]) by canpmsgout03.his.huawei.com (SkyGuard) with ESMTPS id 4jgBPq3G6qzpStl; Thu, 3 Dec 2026 18:56:15 +0800 (CST) Received: from kwepemr200004.china.huawei.com (unknown [7.202.195.241]) by mail.maildlp.com (Postfix) with ESMTPS id 25D9640561; Thu, 3 Dec 2026 18:57:32 +0800 (CST) Received: from [10.67.121.62] (10.67.121.62) by kwepemr200004.china.huawei.com (7.202.195.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Thu, 3 Dec 2026 18:57:30 +0800 Message-ID: <90326d8d-0f9c-4700-a925-02e907b0e6c0@huawei.com> Date: Thu, 3 Dec 2026 18:57:30 +0800 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] cpufreq: Allow global boost updates without active capable policies To: Jiangtian Feng , , CC: , , , , , , , References: <20261201023001.1131130-1-jiangtianfeng@linux.alibaba.com> <20261201023001.1131130-2-jiangtianfeng@linux.alibaba.com> From: Pengjie Zhang In-Reply-To: <20261201023001.1131130-2-jiangtianfeng@linux.alibaba.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemr200004.china.huawei.com (7.202.195.241) On 12/1/2026 10:30 AM, Jiangtian Feng wrote: > 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); > Reviewed-by: Pengjie Zhang