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=1796272397; b=ot3Dd/1KJ4lKuOIbvYsC5qngJpJzSml61LZDaSyGNNngqYeX2rhAzcCOfhp5GQ5Kb3/Q E+RNSpQ5qknzC5evYlVvGU/IFlJi0lAHg/r2MomP86AEU5q0zMVIp2HpWem/swsnSZcXS +4R9M3mifCrHGULigiJ7K2FWSjzCdaoq8HkFrsJvTW4k72DT/vCERh8rqjf8c2oXJuWGO 6uPl9KG1+1Wva4+KhCU82xB5tJ/cMh88XH7VDAcdDv+F/QZ8MoNjG6FvIOAaluUypoP/V 95FGFOzqNypPYCi6Gz7giLukkaLAYG8v+B+E30luVFlJjpFqQxfX/3yGcXCECvWmyNA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796272397; 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-Proofpoint-GUID:X-Proofpoint-Spam-Info: X-Proofpoint-ORIG-GUID:X-Authority-Analysis: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=MkQGrBePzas5VLqg6XtAWMV6aefOqibIYG2oiHF02DQ=; b=Gb9HHSuqD9ZR/u2tOzfu4y6uxrGUp6xk5HSEksmEM+84j8KPdQcwwYn1khz8Vzxz+kuy jOgP3gUyZRuumTJUAwtgisgTOLn5g8Fllu1YydanhU7jkW/K5vjYaUaOAPmL8DX1iFTsE AowN878Eg1nqzqu2qOMfo8j2eucCUTmGh4m5u6HqHN83x7Vm6OONDFaImmeRyJrrdCK3k 3DuklsAKquJebeQZYomN0LvFN56i8qftF3wOPig3BwpnF5cJodzvM7JBPuPm0dJ0jSbWo LR4d9oJHGzD1bBRut7B+wFga0E84YfFoxUNC+Zzhlb8+6WFQZ5TWW5rX6iB8EAcPpBQ== 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=hU3G0hlW; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b="OfK/EAKS"; 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 DACF0606A32C for ; Thu, 3 Dec 2026 04:33:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DACF0606A32C 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=hU3G0hlW; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=OfK/EAKS Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3367ED707836 for ; Thu, 3 Dec 2026 04:33:15 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= MkQGrBePzas5VLqg6XtAWMV6aefOqibIYG2oiHF02DQ=; b=hU3G0hlW8kpWlHqs PyvALqg0Coq8ShcRfvCc3nv7afIGjn7+s/4h9GMf0Rwum6s79VEM9508Y9/Iva0s Gb9L9MTCDnxWZWv5hIILmvDHi+pAAnm8t0eNuRBSjToXnoeYxGgQMmp8xrlKxgZ8 1Bgi9a1XwcsxgjBxnOgGnVIpzvMSmWq1LoT2mboYbOBoQO4ZSHpSc6FuV/xQ0XZ2 5s8Zbr52/YW4fiJL04ML0niVkUN61/h9UNCCtg6X7ddQyGdn6nDn6hw7UC92CFUl bh0iYoArUgLeTc69OeNMJj6b/FBIARnKzk19Tw0Vm4vyeuoEMGOjkcLsvZX2Ivtr EQXtVg== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jaqrtab1n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 03 Dec 2026 04:33:15 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2f18f603e67so4431215ad.1 for ; Wed, 02 Dec 2026 20:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796272395; x=1796877195; 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=MkQGrBePzas5VLqg6XtAWMV6aefOqibIYG2oiHF02DQ=; b=OfK/EAKSjn4XQB32E2RzvICXVeGRejmqQKdaT3kOgYlxvw2hPhYfiesfkIQZiK/9ch kKVD3Cs59hlyiZZNhzVQxIHUSymp99CBVTR14leaeRxytYuwb+YawW5EZe7y6um6UTld zyRfamECTMBsh8PfJQKDfuaw2Eh/8WDB2uY4gVIdLAk1Z6IYOsMozn+smQluRfD2e1BV jiwf2j/KNRjKhM+CsWKu+8ay/8EIDasJ1H/6YcWbu2TvNgoBo6FDA9xn8hwV0AmPOF9e e13fuszFoo+iZ305gyydhibeXKDrgrufy/e4Y/vbL3B02BJ1z0XR8+U8fLn4Ean9wdjh OIVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796272395; x=1796877195; 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=MkQGrBePzas5VLqg6XtAWMV6aefOqibIYG2oiHF02DQ=; b=GTPWzI/ersLj7rs2URfn26WEtK+ZHohRel5cM+NpBLifj0nK510VKasjwBTnfbILW0 E53M47w0C0VPnU/yXbzV6v/p5GUl1nbbgnpz3pqxdyRHspQkvn0WHsy5z9AlaLz7pE3U kNzjUjgQAUStvpj3QmgbX6nFFSxLT/UWMjFjcyLi0u7D9g+6PWzP7nq1kULiN6eazcDq CIpnbY/S08jav9Vrzh28XlB+UMgFtmH1T60ljUupv0Eg3Idnz6bmAvvqFtMRb86Uw+TG d3tHEibof8CB4YmN9oZWv5z2d+htSbJY9yba4F6blWKg1GYjqwE3PRmEUKiwSz8xrQP9 zavQ== X-Forwarded-Encrypted: i=1; AL+hErHkZl/zxqCo2YusYuRqzUpvZaAmQDp4AM3GP1U0TaSdSE/oiiFydq+66ibezxP9xtFa0EGXLvrWuKLReicLsQ==@vger.kernel.org X-Gm-Message-State: APuU4Z+0Y6q7vRZMJuSB4/qZdKqh4Gv3jXKUyeHw8K/W0VFwPoRAK9WT zeCEzDoam9IDP0LnC1DrKa/MeyKTBsRmXYZPBdOGXj73QKnITWApfOq1n9MixUUimSpjZ//h2oc +fczr0RyE+ga0DpNkpSLxxX/gW/reHS1SBmFGF30oMjWdcvTazIavKm4rCUomBprg+QRtJcYO2G f0SQ== X-Gm-Gg: AZFdTZeRsLCQA7WaPswwrYsFSAfUy0GhmQk+vl0W/uvlm3agaubahGRTZYnHLCJFnJ4 i7Isdd8jisG+ucGHLhRyvLPiUZMirm4Gbs/8EuXLItGDflCNS9LwnwN0kTXPj8XUZR3Z6QPbqet dEVIvFNuWz0hULMog3mkBfTSALoxWZgEV4Hpjl8BcIOZNNfmm9sfMneUClmi415SSu27MH4Dosl HHE1wibI2NbC8Ot9p5zAOfjP6i1LHJ+41BMSXCI4y0rZc6giIwyog2Y3z0DXQaFMZXAnE8XHK6O Z3NvCN2pbEjYdens5vxPPaC6mj3m0iPPmjLLOft50AhYCB+K4jkwY0TNxZQgHBcm6vwQEd7CeI6 ngYvsaifFoTMoaRdlCTUKkkyx8YpgVvpe1QlnxXMHf97J77UpQxgFTiNdFwqA8HNFOsucoU6vQh M7EqZ4Hv4iEZWG3HOotc1/woreVbcmlqzlV9DrCOAqDzU= X-Received: by 2002:a17:903:2f43:b0:2f0:d976:655a with SMTP id d9443c01a7336-2f19707b788mr6666295ad.9.1796272394646; Wed, 02 Dec 2026 20:33:14 -0800 (PST) X-Received: by 2002:a17:903:2f43:b0:2f0:d976:655a with SMTP id d9443c01a7336-2f19707b788mr6666135ad.9.1796272394157; Wed, 02 Dec 2026 20:33:14 -0800 (PST) Received: from [10.133.33.245] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f04f6049dfsm203005645ad.19.2026.12.02.20.33.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 20:33:13 -0800 (PST) Message-ID: Date: Thu, 3 Dec 2026 12:33:10 +0800 X-Mailing-List: rust-for-linux@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 v3] cpufreq: rcpufreq_dt: implement software boost support To: Poil Zero , Viresh Kumar , "Rafael J. Wysocki" Cc: linux-pm@vger.kernel.org, rust-for-linux@vger.kernel.org, Zhongqiu Han References: <20261203032351.1043233-1-poilandgginchi@gmail.com> Content-Language: en-US From: Zhongqiu Han In-Reply-To: <20261203032351.1043233-1-poilandgginchi@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: 71bgAwLAMPgeY6mJ7ntZEg4q_xPQEH9G X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDAxNyBTYWx0ZWRfX7WWuKoLCaUOZ cAnsgBDuFGx+xg8tuB+f3+pqTeyMJWmvseEX9sPFNsAOIAUbgHY0jaI99dJbLZpzTGYMdeQaugJ 2LWSaULSOPkUcHjaDWYIZcYUZh85teE= X-Proofpoint-ORIG-GUID: 71bgAwLAMPgeY6mJ7ntZEg4q_xPQEH9G X-Authority-Analysis: v=2.4 cv=B54sQ+tM c=1 sm=1 tr=0 ts=6b10f10b cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=pGLkceISAAAA:8 a=EUspDBNiAAAA:8 a=EzeXCZCh7Sv6-gzM7ygA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDAxNyBTYWx0ZWRfX+bzz6Y2HnMJf mujQ4um5AlfATduPOR5G31+akycoGeZd19W43qJjVuE9qNTcD/pnqYomd8xLjOJOimkgugh1Sp+ /dv3tZNnxBeD+czAUQ2brTUAEB+D3dqfwQqnkMOJ3jnNJQC4P/ZTRz0zDVZJDkONXqniojvoG8q f8KYg+LvJ2YLC07rtbiPVz4HZiyXxsuRoBFp0hysCbbgrZgmSFGwRyvo6dTSDwoODjIy4UZ1unF UlmAlgzJcVZWdV+Ls8tRts/xWLLSxwd04ZBo/ZfgWacUFCq6g3kUqXm49QSIIySFcE2yePg0Od+ rGcCIbL+2v8ne4WgxT2sRSbH6UDajqffCJbOIBkatbR+A0FATt85MDiAYwSMclPfcgL+TFhNvut 9ka/SVd4Ouonbq6fT/xtKN/tT6c4gvTvhsDAkOspfNozmUEmM0EKcWlcccTyli3Uas6tBcnUEFh YNi+QCIqswlFPX8V0vA== 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-03_01,2026-12-02_07,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 adultscore=0 spamscore=0 bulkscore=0 clxscore=1015 malwarescore=0 phishscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030017 On 12/3/2026 11:23 AM, Poil Zero wrote: > rcpufreq_dt advertises boost support but its set_boost() callback returns > success without updating the policy limits. As a result, enabling boost > can leave boost frequencies outside the policy's usable range. > > Use cpufreq_boost_set_sw() through a Rust Policy wrapper so the callback > updates the frequency limits and QoS request. Start with driver-level > boost disabled, as cpufreq-dt does. > > Signed-off-by: Poil Zero The change looks correct to me, and I tested it on QEMU: Reviewed-by: Zhongqiu Han For reference, the no-op set_boost() and BOOST_ENABLED = true were introduced by 06149d8f2216 ("cpufreq: Add Rust-based cpufreq-dt driver"), in case a Fixes: tag is wanted. No respin needed for now. > --- > Changes in v3: > - Resend with git send-email. The patch is unchanged from v2. > > Changes in v2: > - Resend to fix line wrapping in v1. No code changes. > > drivers/cpufreq/rcpufreq_dt.rs | 8 +++++--- > rust/kernel/cpufreq.rs | 15 ++++++++++++++- > 2 files changed, 19 insertions(+), 4 deletions(-) > > diff --git a/drivers/cpufreq/rcpufreq_dt.rs b/drivers/cpufreq/rcpufreq_dt.rs > index 2b1f18b..e0e1814 100644 > --- a/drivers/cpufreq/rcpufreq_dt.rs > +++ b/drivers/cpufreq/rcpufreq_dt.rs > @@ -60,7 +60,9 @@ impl opp::ConfigOps for CPUFreqDTDriver {} > impl cpufreq::Driver for CPUFreqDTDriver { > const NAME: &'static CStr = c"cpufreq-dt"; > const FLAGS: u16 = cpufreq::flags::NEED_INITIAL_FREQ_CHECK | cpufreq::flags::IS_COOLING_DEV; > - const BOOST_ENABLED: bool = true; > + // Keep the initial driver level boost state disabled and let the userspace enable it if > + // required, like the C driver does. > + const BOOST_ENABLED: bool = false; > > type PData = Arc; > > @@ -190,8 +192,8 @@ impl cpufreq::Driver for CPUFreqDTDriver { > policy.generic_get() > } > > - fn set_boost(_policy: &mut cpufreq::Policy, _state: i32) -> Result { > - Ok(()) > + fn set_boost(policy: &mut cpufreq::Policy, state: i32) -> Result { > + policy.set_boost_sw(state) > } > > fn register_em(policy: &mut cpufreq::Policy) { > diff --git a/rust/kernel/cpufreq.rs b/rust/kernel/cpufreq.rs > index f316711..ad01387 100644 > --- a/rust/kernel/cpufreq.rs > +++ b/rust/kernel/cpufreq.rs > @@ -544,6 +544,16 @@ impl Policy { > Ok(unsafe { bindings::cpufreq_generic_get(u32::from(self.cpu())) }) > } > > + /// Provides a wrapper to the generic software boost routine. > + /// > + /// This recomputes the policy's `cpuinfo` limits from its frequency table, taking the > + /// current driver and per-policy boost state into account. > + #[inline] > + pub fn set_boost_sw(&mut self, state: i32) -> Result { > + // SAFETY: By the type invariant, the pointer stored in `self` is valid. > + to_result(unsafe { bindings::cpufreq_boost_set_sw(self.as_mut_ref(), state) }) > + } > + > /// Provides a wrapper to the register with energy model using the OPP core. > #[cfg(CONFIG_PM_OPP)] > #[inline] > @@ -741,7 +751,10 @@ pub trait Driver { > /// Driver's flags. > const FLAGS: u16; > > - /// Boost support. > + /// Initial state of the driver level boost support. > + /// > + /// This maps to `cpufreq_driver.boost_enabled`. Boost support itself is advertised to the > + /// core by implementing [`Driver::set_boost`]. > const BOOST_ENABLED: bool; > > /// Policy specific data. -- Thx and BRs, Zhongqiu Han