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=1796272398; b=LMMt7dGBhW+rNmeOyzl0gzXaaK+e8uscLgBivdrp3bJq5xnnFmQP4k5WzadNbSbuyop8 9MSFMBKkTgffnGQDDBj9Viaq7FLHBVtR42pzu7GK0ZiJAoSfZx1zDkgFT3wY18EWA9qBF UtZ/xY+R8ECzIJuAXGactBu17/AsgUb9psjeETRyl66XGgdgp1DYzjf9vmtE4ZlQlejYh t9y4DTo0f2t2hFFntFANvkvfi16GViow3mSyM5MbMJnjhvCxt33rqtWdxJGP7GQ7WyW2u rWNHZPgYhcXEP2zL0KUjSs5CFelaA7oB7sYVyAjNK8RiKCqpASGAN+GOtTdyPGtAlBA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796272398; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature: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-ORIG-GUID: X-Authority-Analysis:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Spam-Info:X-Proofpoint-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=MkQGrBePzas5VLqg6XtAWMV6aefOqibIYG2oiHF02DQ=; b=u6R5NEBJyZqjl5AZmxNRK+KcZlGpHIAy1GfYIXbuxP0mS/pVgZ99jAqDY2hf3G/2xyWk x1K2DWKY+B1VHANkqtwQltyspBmgx1MdVXG5PY+YUkP2bg4Vf1pwds8iCnyLyJL5bFz7L qAjE/R1vrvg3UHqDNbE+0H+FhfZwl7vXtOjDoTc2705NMwfsjkR8+QMMLm7MijolBdLZ+ 0K+HJSpmYU2pJrwoMGobMLl/NCeXuEz2ZzdHzVYOlMi7cIEyPrvAR32gWwH703Ys2tnl1 1HOouza1x6Z+YzqkHDEX90cfxtHikhQNjLXwupUjHdHvjVM84dE+w+iQKcG03/3ZiqA== 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 9D464606A330 for ; Thu, 3 Dec 2026 04:33:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9D464606A330 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 (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B336JWC2342554 for ; Thu, 3 Dec 2026 04:33:16 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 4jak3y3q5h-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 03 Dec 2026 04:33:16 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2f040056fd0so3901135ad.1 for ; Wed, 02 Dec 2026 20:33:16 -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=0PnuEDtFO9yS7R9K5n/OdL1C/1Aj98zx6E0aSTejE8Q8wWBK1e0h1r7ZUYDsV9nn3O xyHZDqxPL+HCQWcYob/mroK0YSRmJnDBhsx1PX5m6YenaEhrezUDb4rewYb2Kn4fEFsD 4lfJNxQa046ZlRDxjQ1eYG9fKllynlOfvv1dC66aiJ5L/spenUACLRDdaNmx+e/cpmi5 E4ryJzAYUfWiUXTGLXrqrbstY4qM3A3PQQO3HIEMzPM+IZBwmpodP8qf8omsxOzJAXf1 L//sWHfNitooAS1CWVd5WQBbRWTnkpBqcK24dSsZUZ6golXZruz2r1SEcQbrRVgOxqmW YdOg== X-Gm-Message-State: APuU4Z+tnRI/ymWkRJhOB8Rvi5voF8HMDI2ohAbmdozYjLGGC3Upr4+7 m+9KPLVAosEhFHZDDwlTJ8rPn9r0DTn4NKEieKJKG18980ogGbc/HhqGN15fSvDgwnUbqFcT419 w3l5xS2FEUcBs5AE4iGvOE93RRhA4N2UKXqnO5s3/7/djJ5X5lsA3yjEheEKbWw== X-Gm-Gg: AZFdTZc7NvYWKaa7nslD0CNxiAu3GtKmhrb4eeomCECOCRshKQuR+IrPqXw43FgUQvO BlKo/yT9Hnm4FZDfQrHxyjBFPIMuvAgfQtyhTaUDFnkBNpbMvr/pNgFg3p0Q7/9vpKf/NWlmKBE xy2cuPnlY3mqLYSpU9Cfmcg2XnC1G1Iokg7CT+DwKWe4yP3DSx2i73agShAKtUwnRvet8tX7Gkx UQOYVRVbNyG1KwxjSK5/yzLiwu1iFg/N0VCOXCX/PLWeF9DXcP5eOTccos1iBb3MMNZt89QRK94 BGiF0nzJoeFmuvx+Dub8+Cs9ImimXmWnY4mS82iL34G8/Ys/cJoAWmEa1m4H+nDOIJENwXR1JfV Sp8mKOrpIH1Aw3IsnVsG9jQ8h+s3IBORtIWf/35dYCx9+uSVqKACXpLfcVOJ2kcJ7BJ3y5GmQOI yvUV0lfvrWfxIsrzpzlxil7sQaPyaFPTmbRnXVfG5gF84= X-Received: by 2002:a17:903:2f43:b0:2f0:d976:655a with SMTP id d9443c01a7336-2f19707b788mr6666325ad.9.1796272394653; 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: linux-pm@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-ORIG-GUID: m6qqNaKwQjO0MhUcMj1Kqs2jtxO6Lq9G X-Authority-Analysis: v=2.4 cv=NPdAaE6g c=1 sm=1 tr=0 ts=6b10f10c 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=ZpdpYltYx_vBUK5n70dp:22 a=pGLkceISAAAA:8 a=EUspDBNiAAAA:8 a=EzeXCZCh7Sv6-gzM7ygA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDAxNyBTYWx0ZWRfX5qESypKS/lfJ Km5kz26gDS5u5EfFnLjBQoscyqYvHdgZKIxpqm27LrV6ms5Mye7DsblaJQy/K9SjCVAWLZfw0HG zmSm7nN7lfzAOaoKGtyypioMUFda/9lx32Gy1QUzubmxqiSXBUqHFXZ5gF+mbdfamdL+84C3zm3 g/nCJIM4S7Zv+SQIqnbyUJnhWlr9bbv3nvXwDNkLQWTQN4l6nIh+kvrQFZHW7s1gPr9+NnEpTvb 8pWCn2Pj30NdDifRNRS5BcWLENRq4q6kYCTdbh5yAraAa8dxw3fmltdJBqy8XK0zKUGLtQ83IUj z+l3QY/p9bN5d08p9XRAQfHgEVW2LQewclwT9HJamcXk38YBmTqgMK+dPpzixv3sV5aqvVDxzo9 8CMjb2A/ZVakUK8VdtZWpsYkwrIvA8YxnEuAA9O3SvaJxkXY3oTi8McSrb5GWar1hSZIXNVHuqG kQWl42varmyh/EVRNaw== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDAxNyBTYWx0ZWRfX2lUyFDgSbu0t kWw2z1SoNlzxvvnPF+/sdNpjyRZHRDl6L3wJY2QEvtAIvj4M6XzCRjxFUI50zPLpkzQVPxU/ako if7dzagEEDA8KOypom3klGDS7JEQ/aQ= X-Proofpoint-GUID: m6qqNaKwQjO0MhUcMj1Kqs2jtxO6Lq9G 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 clxscore=1015 malwarescore=0 spamscore=0 bulkscore=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