From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796295222; b=gt7Ipf2HPqA5qubQlLPpNJxQMk6ZppToPCHKENBoLOSMXqjsUmAo7B6l/yBzSzdZ7mG3 ZqtlyIo4vW+Bh62s/JqGQoYfDCVxG6COLIMEwKjpPRS2ZvANk5fvbXt5fxDPa8HpVZP0p 5IE+VGfq55109URP+95GyxIojjrj1qd8T3eWAtgX0FupYZRqfNqeOm835Nmt/G+LWZgpQ Z9NPPb5pzgZONjP4u0uHdV+sPFRBYacJXmQdrDxZviWyAe/MsBVPBm9jG/KplvWpzSBHt O+FcDuUCk/zxN3Q85fZPe/FWTabl1ytCVqBt9BH7eb0FPJdA388YBWlNvFlXSNBPsPw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796295222; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=e5Puiokyf9kESS5YbFlCFsEkM7YjBjNT0Cm/4Ki7Wic=; b=hV43ztXaqonzDA9ezJX+0N1fMrh/UMVlVyVHNBBf3ZXTi16bSwtfrzOzbpBJlWg0c9iJ yUyIUooo9TTEdnfjq7OGdyuEuI/vO8jsa7HlgKluce/Sv8ytLuQ6K9wGv6H7v2oKcp/GS Pa2Fr90e65vcOpSO3ceRDJN2iYRmSc39H0uNo/QW1uaFQ2BLN0WQpIAtYJW+tIV/YfsK6 QcJjGE+HQee4LxHOBdxmDtr/mQERod9XxP56IJ2UmOC/s3xSnH4pQY+epqYoUwehhfg3W bZwnHhlUtoJ9558QM5pQc85+KBhjD6uqfov7sRrgcxxomcrr4tmVFR2wN27a2sbvl+g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=E7sxWDdO; arc=none smtp.remote-ip=74.125.82.175 Received: from mail-dy1-f175.google.com (mail-dy1-f175.google.com [74.125.82.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BBBE606A681 for ; Thu, 3 Dec 2026 10:53:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1BBBE606A681 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=E7sxWDdO Received: by mail-dy1-f175.google.com with SMTP id 5a478bee46e88-33fb4680717so2500085eec.1 for ; Thu, 03 Dec 2026 02:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796295221; x=1796900021; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=e5Puiokyf9kESS5YbFlCFsEkM7YjBjNT0Cm/4Ki7Wic=; b=E7sxWDdOih5YZ+pDTR+25T0UxxBshiX4YNpPCk+Ns7/7NEpczNq9qYbdqlixyW7hDJ 2xZor2bLaKh/jrQyOi8f55/NR4kkpqEXK7rNpW0tlMF36Nf993EfIcgwrWNl++zZIq4Z HhSpxDKLODf2lflzXeVTMfNHdvm7Qwg/9q+WDf0oAPEIkg58vJ9Ms2cXQEARE8YHIzZT xf+ftCkcDXl+5S56IyRTPPiAG8YeVZ9Y/wxkZz0N51ws0fNYgFXOjmQtdJnu1rZo6acj 5wmwt5m64Qu15a9CYM4nj+PiGLWC6IGCP1hJpf1HZAZTyeE7hCIpRqjs+Jce6FFFhcRN tdQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796295221; x=1796900021; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=e5Puiokyf9kESS5YbFlCFsEkM7YjBjNT0Cm/4Ki7Wic=; b=lHTnhW221u27gXFRHv5kLUgcYU/4ZC+EHF6XPkSgqht1Aid/zFSOCces5OJ5uLQzZA 2mcZVruuEjN/WzS+hipGOVoQL5Ga7ULU2lAajWJucsJ20eikU741H/4IvmKBexoK9PH6 +FaTbAx6WwzNVlq6nyglmhEzIYsbEpxC6pJLbg3gjIwNftP4DRt/51uYtQUOjFtDpLPT iS9zSAe2wN4i5faOFYqw/I7JFSVGnhwdONFKEF7clodhUu6tqvD0fd2wAkEfP5QrOO36 qcYfwCrQ9dqqmIJoWnsx7sILLilGMFvSBPodFV6VdEazwwL8A7nJ/cKPnCLKPjp5x/ro AVpQ== X-Forwarded-Encrypted: i=1; AL+hErFycSkHeIFqb4nthxixRxitu+RkagsbBDwRD6xQVwIMPoMJVeonwqpjyFcyw1JvT6/X/VVZ8hWDP5tP2iQ=@vger.kernel.org X-Gm-Message-State: APuU4Z/DGc/Sa8yZmKXJOGLOcllgcxdqlfY3zz9AQ1PP0ZCfhx66g72/ bPt7cyEhYl2swc+9TXpJr6AduhUEpUuXB9pOMzxCJZ1w1+ALcubj1if9GGKpAtzcRzw= X-Gm-Gg: AZFdTZcQa3dVJCYO4h9QmrN/NKzTl5hlIfucMwDcAXpoz6M/o1AV0cGgCDJLpQimSrU xN6Ues66c8Ewi0jCIp0rxnCReSw0NIMD5zQ7GZoayy40bIvO/3QoNveF4d2EKvWNCKb1HdgTDz9 59NroUSP8vnGBm0dWQ/VB+jV1wImhyoxXlCJtKS7luWvOJFlobTJwJ5G383H3yzMWLCkZTcqCHc Rns1r1upDf0Fut+QFNtqSQisWD98A9lUOYzTdlxH2iqbL0+NUj13syOlFXBnni8sbDsu0kb+5hF q2NsqkI0QucEdL1VUNRbJxj/es4a3jh+jlUrWbOr8yUGmXmA5TBlDLd3UDhuwXSDt/SH5dr3hJI nU7qjhzRLO+eSPPu7WoDaMlophAZXt8anhgYj8ZKYvvf5CfSfygwRhCkiBPUvABkAKwM4NxW9Ad n9qmFlwE8B6Rkea++hHCCwmZujFROUOJoI3Nsxyiz7l2ods1tpMo0JkuvdBl1VaC7Ly2tkCheFN VtE5BLqjXNv69arWFkGB9KOU4X+wl3ra+KGy+l/A4yOo5PBW83+2lVGmihMSNIWIZXuf+UIevUp Mo7fi0nEjmGbG5xH5CX+YtyZry7A X-Received: by 2002:a05:7301:18aa:b0:386:a0cc:b97d with SMTP id 5a478bee46e88-386a0ccbd2fmr37793874eec.4.1796295220839; Thu, 03 Dec 2026 02:53:40 -0800 (PST) Received: from localhost ([122.172.83.31]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386992b404bsm110345382eec.1.2026.12.03.02.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 02:53:40 -0800 (PST) Date: Thu, 3 Dec 2026 16:23:37 +0530 From: Viresh Kumar To: Jiangtian Feng Cc: rafael@kernel.org, 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 Subject: Re: [PATCH 2/2] cpufreq: Keep global boost enabled after partial enable Message-ID: References: <20261201023001.1131130-1-jiangtianfeng@linux.alibaba.com> <20261201023001.1131130-3-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201023001.1131130-3-jiangtianfeng@linux.alibaba.com> On 01-12-26, 10:30, Jiangtian Feng wrote: > +++ 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 policy_success = false; I would rather name this differently. bool restore = !state; > int ret = 0; > > guard(mutex)(&cpufreq_boost_mutex); > @@ -2911,6 +2912,8 @@ static int cpufreq_boost_trigger_state(int state) > ret = policy_set_boost(policy, state); > if (unlikely(ret)) > break; > + > + policy_success = true; restore = false; > } > > cpus_read_unlock(); > @@ -2918,9 +2921,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 (!state || !policy_success) { 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)); -- viresh