From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385119; b=vtNQhiC23lhMTFoMgvW84d7zLdXBM84yxUVhhBT3MUhDHKzIgATXOd438RbE/Jdu5u92 UB2beGtfkLSTkBVLXAwf9kPtMcIFUcrqDT2bafQfRmYaSnuROKgK/1N3cbI+xT4E80Td3 nVs87llzaOYc1sWy6zyxuPFYtsOUoShHsZ5qmh9dmlpJ0MFol8RktganlxLqOMN6SnfFF 6Cl96n9c3qc+pqVhR0ViGw2OOUJRxjLbIK+l4ulBRv9dcp0HNCQBB+QYbJJf/m4xPkX9N XroGqPhVl0fLX1EyKd0tP2yUu4CoYkyon5uz5Rzv81d85Mgno0j2AQxP+p509XV4sCA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385119; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Authority-Analysis:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Spam-Info: X-Proofpoint-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=IeJ1PAqz8ybJnCvYu9sKlqAv6WV+kacV+1bwiMz/sbA=; b=v20ugAT//NG1GgAIC4pE7Om4+SncAll/DjeJ9NE6IDG1bYDX4ykar6p3iUQb0xmbRRLN arTPk11kwCalDKQTikhbAB55l40p+DtzcpH3jTfqPvnB3iNL6DFunR0F7X9foTB5jPM0D KoyTunBaQZLStbsxKFmQuv0TGC0qmtbsDEBuAp4XV9QGJxtVx2UB0KbZtM5S0pM1HWGVh TD6VJjSOHYRu7g6rx4UsFJzqRyvVdFTIMedNKBcZqrR4M1B5yQJIIjfokOa2QpII5/igz ApO81otpXtvw9bhwUjBbRJ0Ly17pBhXKNtnHW5DBqlTFWpo+NCuxt5baDJVqtFe4QgA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=ckw2ldhO; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=TDDCwJgl; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 D96AE606A332 for ; Fri, 4 Dec 2026 11:51:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D96AE606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=ckw2ldhO; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=TDDCwJgl Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B4BIeY52471583 for ; Fri, 4 Dec 2026 11:51:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= IeJ1PAqz8ybJnCvYu9sKlqAv6WV+kacV+1bwiMz/sbA=; b=ckw2ldhOaOE617pA RlGFg8sx/CtVoViDTiclRbY3friRquvLlt89aPlsx2Ov7HhZmz1v1729T46bhjI9 iRePujpr0h6aq2R+eWNoDZfoMPLkCbF753VTmZDnI+K5+Qu8JN6TyFz/TpCh2Juf iRr5RzDSRIi0GoPAYyLF1zP/HHrfpvgrc+KIvSVRUgO3PufgBws5Nl5pvim+EV7e Yvce21m9e4QKGW9srmxuc+3pXvJItyZCjcYYcYsMClo2EhCctwS1ydGm5piq8cAf 4KRUof4eGO6em0MOCxRaETJK+DMI2Qy0Go5dIIb6CgtAiOnRpD41/9cbmThrgkKL TeWM5Q== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jbq7xs6fu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 04 Dec 2026 11:51:57 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2f053f9631cso13122865ad.1 for ; Fri, 04 Dec 2026 03:51:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796385116; x=1796989916; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=IeJ1PAqz8ybJnCvYu9sKlqAv6WV+kacV+1bwiMz/sbA=; b=TDDCwJglymiGwn15wMOq2IPSo/ueqIP/MHytGqGP+O8mAVBoS0cGBocE9i2KrBr/nJ OQPJqPz/eMB/zCGc8XMwFnZPbAv8MxGf2QTj+VnUtcjeZ07buphonlj7GXcJGXSoUsSB waHTUdd39U4btqI16nmBzQg7b4pDooC7xlG8mFbJ031POdfF+mXEI3GOPM/p5RjYUT3e 54e4/EuNgQWVvtsgWDjbRHnC7cNGLEQN/Sl3iJcY6SzcjKAemwQn9m6s98NKHeh0HsYz xZWCUO7OC7o6uvO0psw2uuE2HskHQJa7t9DIhFIZa52rj/HKjcInzgeBBj27ZYuktL2Z G7Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796385116; x=1796989916; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=IeJ1PAqz8ybJnCvYu9sKlqAv6WV+kacV+1bwiMz/sbA=; b=IcibkewvIOqaQdANu3TXlql0EyKkVau608n8GbkIW7pChwCTGY6/Cavozz1KAafwem vztKBXw7y9S14UkHziq3GkbT10lyFMxLAfMWGjGn3qT+PdnljTab6fYqU3LfSu3K+1Zu r9v99B5760Zyt9dG6+F1inY2UEjvibKabKLmGoV36scqm+a5jMJRr1lXb/sqDxI3+bwp spwdMgyud7wK4iwbb9Y8TYJ1+w6HuHecbh1Ye0hxn9P+gm38dJL+8jG7pEPhakzsr78F KlS5Sj9iSPA0BAdhmECt+GHAqA3U+oxkTbL/XyvjS0aR8jaXD3USCrwlWavqyxn3KSU2 SPCA== X-Forwarded-Encrypted: i=1; AL+hErH6046pcFG281WostlxVgqml3ErBswYE3d7tYzzNLKcRneIFetp7rdzI7knnuAVmmxcJGgpoWM8tseHemk=@vger.kernel.org X-Gm-Message-State: AB4q+uHT5Z1f0oeM4HSs/2Z1a4B6TQLPJhmEW3qXGj1/LDipzK87DkiU 04cVUs7/s5kvet0mTuAkrdQPamJ7hheR246st+zITkfYfMnv0DyqClFC5JPJBABze3zS0Tcmipz cA7FnuLKgSqWpf6jAyvGCKBcPHik79t90E3ynsLjR140984Kt/VW5DA6HDoHrTqt+x1c= X-Gm-Gg: AZFdTZe1DG/+By3iShl3VBOOdlNvqSYLzc5z9TTcaxhSZrGvZnSPzI/Fde8LVJfeFSV zqQrXua/68IiA6Rt615h5STpAkXm7Ns+FYdKPJFXg5zVUqCRYhzCHBQ1sg93k4T02O2hss0nBhS sFFquMJvAo9a2ytxI9X1FbdUUU53urZvQHWb8VbwZZg4mgf2csvUZE0Z5A3Wk9npsWJpHOB7pdZ jAuCLHb1QKIbETNXpXQQx6EoCiXmrCrYfOtFTWuQuNIt94aMT/bznDRH1dsj7YZ1TIf7p6L16Km VMBgPnDZdjjPJRMQGdrgi4XXCTuxATnel4Gi7tKnwWnV+Q9/YqQHp7Ax6xu43HXDvd26XGi1hey 4+t9xuRxGEz0JE/yQmkUYVTEdI7WfM0BybxZF5HBZXvvcLYi4fGjjmArinqrx1eFfmw6GEZB4An jazV+YAE4rfvkDXrW4VbX846yzbtb+vykx7aSRVzKYvw== X-Received: by 2002:a17:903:2286:b0:2ed:3e3d:f0ea with SMTP id d9443c01a7336-2f1ba131ac2mr16542835ad.20.1796385116542; Fri, 04 Dec 2026 03:51:56 -0800 (PST) X-Received: by 2002:a17:903:2286:b0:2ed:3e3d:f0ea with SMTP id d9443c01a7336-2f1ba131ac2mr16542535ad.20.1796385116009; Fri, 04 Dec 2026 03:51:56 -0800 (PST) Received: from [10.133.33.37] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b7963001sm10151265ad.62.2026.12.04.03.51.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 03:51:55 -0800 (PST) Message-ID: <02a7ccc5-cc4c-4fd9-af23-bdf8262ce625@oss.qualcomm.com> Date: Fri, 4 Dec 2026 19:51:50 +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 v7 2/2] cpufreq: Keep global boost enabled after partial enable To: Jiangtian Feng , rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, christian.loehle@arm.com, ananthu.cv@oss.qualcomm.com, pierre.gondois@arm.com, zhangpengjie2@huawei.com, zhenglifeng1@huawei.com, zhanjie9@hisilicon.com, Zhongqiu Han References: <20261204031926.278915-1-jiangtianfeng@linux.alibaba.com> <20261204031926.278915-3-jiangtianfeng@linux.alibaba.com> Content-Language: en-US From: Zhongqiu Han In-Reply-To: <20261204031926.278915-3-jiangtianfeng@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=Jv1kP84C c=1 sm=1 tr=0 ts=6b12a95d cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=VwQbUJbxAAAA:8 a=SRrdq9N9AAAA:8 a=EUspDBNiAAAA:8 a=i0EeH86SAAAA:8 a=7CQSdrXTAAAA:8 a=dBms5nstLSxwp5LJSWkA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=a-qgeE7W1pNrGK8U0ZQC:22 X-Proofpoint-ORIG-GUID: C-oIRUinxiySPIe6_ZqI4egQtkhqo5Lm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA0MDA0NyBTYWx0ZWRfX+UnBbkMcSRSa AwprfZv1aGONmNAH2WuQvOV4yzyvUW+0zgP0mRxdSKR3jOzJzAjHcqzbnGLBUlm25bekkCXCrCv uyO/ybo7/ixPZFhezXwNLzK+ucWf6ePVRTe2reykaWYO7v7MPIAuDwTaLkZswgIRA8/mxesKWlD kEsYe0l3oQvlzrfsFSBVtOPMGz860YIYRhJsJoRQTuZiRhh8v1X2+qPv+ThnrTn3pWkD224jUMg L9aImZOmJh7s/68xpkRgdcvdBYzszkCz5AdnHsEHPbH02LXgN2oWdbxsDorKDmX9zWz9fmXM3HA XTkG+0gG2VyJbQmdWicpSggcY7pqjcW6GOFOMgXQITp/9CnRyGJW9OBF8xb8ObS60wXr9vxw61P wID+I0FQYfviadOBgRGy9gMItsUzBT/edFtvwGJxVSWcEd19KaxwM22XNRfuYPADo6LsNf3aVss zUS3iSINwjmaZEH8u4Q== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA0MDA0NyBTYWx0ZWRfXxqeSsTR0NIb5 HMKj6CdZsGMC1hzMBaG1UKpmvzJFvUqgwowp9OwjbnhPKau3tcoSQUmm00k9K2ECZV7ywgnfbQG 1JzB83fFPvbAnp0sTnfkm5J1QSfcpu8= X-Proofpoint-GUID: C-oIRUinxiySPIe6_ZqI4egQtkhqo5Lm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-04_02,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612040047 On 12/4/2026 11:19 AM, Jiangtian Feng wrote: > When global boost is enabled from the disabled state, a failure after > one or more policies have been updated successfully currently restores > the global flag to 0 without rolling back those policies. This leaves > them locally enabled, with their boost-related driver/QoS updates > retained, while the global flag rejects per-policy sysfs writes. > > Keep the global flag enabled if at least one policy_set_boost() call > succeeded, while preserving the existing error return path. Global > boost = 1 grants permission to boost; it does not require every policy > to have boost enabled. The mixed per-policy state is therefore valid > and individual policies remain accessible through per-policy sysfs. > > Restore the previous global state on disable and when no policy was > enabled successfully. After a partial enable, keep global boost enabled > so users can repair individual policies through sysfs. Do not roll back > earlier policy updates. > > Qoder, an AI coding assistant, helped analyze the issue, develop the fix > and state matrix, and draft this description. > > Fixes: 218a06a79d9a ("cpufreq: Support per-policy performance boost") > Reviewed-by: Zhongqiu Han > Reviewed-by: Pengjie Zhang > Reviewed-by: Christian Loehle > Signed-off-by: Jiangtian Feng This is functionally identical to v6. My Reviewed-by tag still applies. v6 Link: https://lore.kernel.org/all/20261201023001.1131130-1-jiangtianfeng@linux.alibaba.com/ > --- > drivers/cpufreq/cpufreq.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index e97838e40a54..48b2ccaa8c0b 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -2887,6 +2887,7 @@ static int cpufreq_boost_trigger_state(int state) > struct cpufreq_policy *policy; > unsigned long flags; > bool boost_enabled; > + bool restore = true; > int ret = 0; > > guard(mutex)(&cpufreq_boost_mutex); > @@ -2911,6 +2912,9 @@ static int cpufreq_boost_trigger_state(int state) > ret = policy_set_boost(policy, state); > if (unlikely(ret)) > break; > + > + if (state) > + restore = false; > } > > cpus_read_unlock(); > @@ -2918,9 +2922,12 @@ static int cpufreq_boost_trigger_state(int state) > if (likely(!ret)) > return 0; > > - write_lock_irqsave(&cpufreq_driver_lock, flags); > - cpufreq_driver->boost_enabled = boost_enabled; > - write_unlock_irqrestore(&cpufreq_driver_lock, flags); > + /* On failure, restore old state unless partial enable needs local repair. */ > + if (restore) { > + write_lock_irqsave(&cpufreq_driver_lock, flags); > + cpufreq_driver->boost_enabled = boost_enabled; > + write_unlock_irqrestore(&cpufreq_driver_lock, flags); > + } > > pr_err("%s: Cannot %s BOOST\n", > __func__, str_enable_disable(state)); -- Thx and BRs, Zhongqiu Han