From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1A9639E162 for ; Tue, 24 Feb 2026 13:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771939912; cv=none; b=OQnXOJqpfBJNez3Kaa4VC6BjRqrTArUtJuWryrPg9kjBlqV/jmPi923tRrOoIU5YDQ5zve5W97G3h+vAFCbPlBvM7Ba6r9+Bv8dUUNnSdSRnun4oZMSFh49B22xoy1DaN7+jDDDjmGfUMBMu94Fcn2e0gwnHy+uuXhL8pOU+jaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771939912; c=relaxed/simple; bh=CyXybCP2CIrZVrNr/6Av/CKn/Tkw5kvvtvSdn1OVQfQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UAAFRcc8OtsOH30nC19yGNa2GqIs/Fc2s+dOYhBv7CeOx10RGrFHXqvvK8/hel15w5zMVzOnW4+0mZih4lD9bv5xcz7DWbXG6zSvCq60CVpG8+PAz/NHZe8khGJMN5epL5kreLVypy+8nrt1Tjy24FFTerjay46vDtvFVtyuUi4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Qafm+dss; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Xa8UzC5A; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject 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.b="Qafm+dss"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Xa8UzC5A" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61OAFaHR2006547 for ; Tue, 24 Feb 2026 13:31:50 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= gBLQ8De82Wd4XTyosqLd7sRYfu8OUMzWZSMfRzba/Sc=; b=Qafm+dssDOA9e77r RCmSPAPd7B86iAhjvAPwtiXfQqXkUbWo36P+TyOjY1zZmBt7NplA/2a22wv2lftp VB5x9cv4kVYAO2cLvFV0RSAeIUOrhPtHC7G5gTPnsvH5Axfj6pMIcEzJAQnRe+o2 ix9+LCzgQOjUr7UZwd+Kbijzr2kwt1ecSidZ7CYzsAvn9Hn6mqVaAj+r/A5VtXG6 lh6esIMnmd2HdbUTAxTEEC1ZSlmQplPRmad+NdignJxmK1XBgbJg2zGHTWRmCI+h cBHsMZYEpXPLdLY3ys1WuWTuVYEmR6z5vGAm41hi2E9LcvW0C1TTdnU6yKCjqiuf j1hGSg== Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ch4569kya-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 24 Feb 2026 13:31:49 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-5f54dd17395so972158137.0 for ; Tue, 24 Feb 2026 05:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771939909; x=1772544709; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=gBLQ8De82Wd4XTyosqLd7sRYfu8OUMzWZSMfRzba/Sc=; b=Xa8UzC5AU6kNMCbiB5blOeipvCZ83WDftz9/DInzu2R00qeMJf4XFLcI6oRmspV+lF WmIDpr2uilwd9QVgttVF1WgsBJW6OSGhn42VDpRvsC/MhhjDjm5umy3zRD6hL7hOY/W2 1FO81mgkMxUzHazcfKO2rT+qPNkaBhWSkoqeSLtQuHtRm6nbNUpv+zAwgjGrMgsWSBda o3muM8fS/22c7AKa9T2/VyTNQuKEcLANKfIyImvtPW46cuTzdcvXd48fjFXRW6Xksutg +S0O4Zk3Vqlw0m2VtWTZx+ywvgv9GuDIvV5fL14mylKfqEFHQd58nyhIgHmXqE2TkfgT xyxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771939909; x=1772544709; h=content-transfer-encoding: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; bh=gBLQ8De82Wd4XTyosqLd7sRYfu8OUMzWZSMfRzba/Sc=; b=T+MmYU+OSBjm6TijJx0/d0Lat2TQEgyEhAwcZGNcL8REwzZfGt4R+SCVHo3kpY+ch0 hM3Zu2Ai7gUYllxc+8tINJT9adkrpOV23DGdMUPAulgFoMvaSeRnXs27ZRWAdUIfuMtA aUvhmvbk6fTIrZG7AcxoyUR82IPLHAM5+ZE8N39oRHckY/yGKHjAe8W3HVw1WtpzGnwt oD3i/NMVz0r72ld1JAimU74l1D860044JHZBve3L8vVXlUH138KSyV0+V0OEg7JoErw/ zUjZwY0K9g7IUEbrU3oviihLgkGslkd5VnumpCU0XqeDHjxPPMGNste74z/zPNUguSko doJw== X-Forwarded-Encrypted: i=1; AJvYcCWoeOBsf/kV6C7HZKaOEygZVxKU3YkXqthk/JB+jqmbpMPV+vwi2xak9aN6M6r5n07jayzh9LI8o+s/wmo=@vger.kernel.org X-Gm-Message-State: AOJu0Yxxa580P7nQ9FzZJ9xbhDi2XriT5AYwEJp0A8WxkOP8UTSXmRCv IikheSP6Dt6eWaIdtxuraZv7hwHfJk4b8DYWBakSr8OFa9VCZMmloV2SJWjSZyySTWLHG9Hh70w HM67BQALdqqVddaHd7emJZBlPs0kUMWGCj4eFa/NGu2/YjazOw2hblHJ92ByPiWGSYNM= X-Gm-Gg: ATEYQzzZtHNq8A1flxcR+wOlA+GOdKePBjzNLJv2ljZnlvp/bQA03NGkzNGY2eGxG6Q cqQ19bk06S/H8pG/At0D+9gurN55QaBBvccft51mLIqr2Cj4v2de9qEI/wRwhsc6p/Ap5vv13e8 dVBSaWXGJYV9Zb1m+3Pu6y2KVxQuBkqxNQiKuF5HG1mdNBWIlnO+7yjCx2RWr8x8bkzBdTqePnO rZN68H6w5GdynkXngHcrNJCWvfqC/SHzyoc9Wk2sAm4OQcXdy0tNZXXTweWKZdhD4cNUpkO/y50 CE7pbiLBg/uG481FVxODKh8/yQmQok+AfbmChrK3fK5WZrjWWuXG0DcWYzr8KCVUa8sxlvkBYG4 SLoUc+P+/cCX3d0hOFTRHUwrO+ReWhTkOuHWicnoQepcC9alL3mf0FnzDPh1HhQ6Nkz6tBdrPw3 OuqSw= X-Received: by 2002:a05:6102:50a7:b0:5eb:fc32:9361 with SMTP id ada2fe7eead31-5feb2c1c2bamr2329988137.0.1771939909170; Tue, 24 Feb 2026 05:31:49 -0800 (PST) X-Received: by 2002:a05:6102:50a7:b0:5eb:fc32:9361 with SMTP id ada2fe7eead31-5feb2c1c2bamr2329968137.0.1771939908693; Tue, 24 Feb 2026 05:31:48 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9084c5dcb2sm424792266b.6.2026.02.24.05.31.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Feb 2026 05:31:47 -0800 (PST) Message-ID: <4bcf1512-a567-44a9-8a38-8976f65c00fa@oss.qualcomm.com> Date: Tue, 24 Feb 2026 14:31:44 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/4] soc: qcom: ice: Add OPP-based clock scaling support for ICE To: Abhinaba Rakshit Cc: Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Neeraj Soni , Herbert Xu , "David S. Miller" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org References: <20260211-enable-ufs-ice-clock-scaling-v5-0-221c520a1f2e@oss.qualcomm.com> <20260211-enable-ufs-ice-clock-scaling-v5-2-221c520a1f2e@oss.qualcomm.com> <3ecb8d08-64cb-4fe1-bebd-1532dc5a86af@oss.qualcomm.com> <6d2c99c4-3fe0-4e79-94e8-98b752158bd6@oss.qualcomm.com> <5bf31bf9-835b-4b87-a4d0-8452d516f13c@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: rHMVlW2yGdc-55D7kUp4lRDbt94X2_tz X-Proofpoint-ORIG-GUID: rHMVlW2yGdc-55D7kUp4lRDbt94X2_tz X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI0MDEwNyBTYWx0ZWRfX21q/4GBlYduw soffcJ+sPHH+BlNV/zFJcnM5T3oGl9AVB5FuiEW/BqVyaSOczLU4xq9YTiQvIs8q8HhKIXGEr0R GQXGrhWXkkLf8ntNVfsfv3U5gVnJVSAY9I2ofzTaiXmxnr7G6Mj1p0UY4zIk3+OmfLNujJ1J2n+ F7h9QWwCVgBJ+0ClNaSGOaqwJMj+IOday/cPhskf5XS+1eJKhsG3JhKIn8t50wgckbCnX8f1tAN L1LCwj5l5d+TXUKYfVaIYbEq4/FtXC2uOFYDK69LJlVWW9zQj44d1ZqzMFUKjGnyqfQ1K3WCNya OUjkgr8dutaHN/xf+djM54PW5bOyDT5WGv1tTK3me4HssGvILhCy6a2b1qn2GlNVlzmqP8d8nwa wI4olOvSURek6cC3GDaAsb4GopYNjhvDJTCPMkdkiyzFzvT3NsoTwT6U+fcSRcAVzIRUfGzsFRB 7PApYr8cQ3BKlacO52A== X-Authority-Analysis: v=2.4 cv=J8enLQnS c=1 sm=1 tr=0 ts=699da845 cx=c_pps a=N1BjEkVkxJi3uNfLdpvX3g==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=zMuZoWC4Nr6WuNNbOkAA:9 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-24_01,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 suspectscore=0 phishscore=0 spamscore=0 adultscore=0 malwarescore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602240107 On 2/20/26 12:15 PM, Abhinaba Rakshit wrote: > On Fri, Feb 20, 2026 at 10:42:58AM +0100, Konrad Dybcio wrote: >> On 2/20/26 8:33 AM, Abhinaba Rakshit wrote: >>> On Thu, Feb 19, 2026 at 03:20:31PM +0100, Konrad Dybcio wrote: >>>> On 2/18/26 8:02 PM, Abhinaba Rakshit wrote: >>>>> On Mon, Feb 16, 2026 at 01:18:57PM +0100, Konrad Dybcio wrote: >>>>>> On 2/13/26 8:02 AM, Abhinaba Rakshit wrote: >>>>>>> On Thu, Feb 12, 2026 at 12:30:00PM +0100, Konrad Dybcio wrote: >>>>>>>> On 2/11/26 10:47 AM, Abhinaba Rakshit wrote: >>>>>>>>> Register optional operation-points-v2 table for ICE device >>>>>>>>> and aquire its minimum and maximum frequency during ICE >>>>>>>>> device probe. >>>> >>>> [...] >>>> >>>>>>> However, my main concern was for the corner cases, where: >>>>>>> (target_freq > max && ROUND_CEIL) >>>>>>> and >>>>>>> (target_freq < min && ROUND_FLOOR) >>>>>>> In both the cases, the OPP APIs will fail and the clock remains unchanged. >>>>>> >>>>>> I would argue that's expected behavior, if the requested rate can not >>>>>> be achieved, the "set_rate"-like function should fail >>>>>> >>>>>>> Hence, I added the checks to make the API as generic/robust as possible. >>>>>> >>>>>> AFAICT we generally set storage_ctrl_rate == ice_clk_rate with some slight >>>>>> play, but the latter never goes above the FMAX of the former >>>>>> >>>>>> For the second case, I'm not sure it's valid. For "find lowest rate" I would >>>>>> expect find_freq_*ceil*(rate=0). For other cases of scale-down I would expect >>>>>> that we want to keep the clock at >= (or ideally == )storage_ctrl_clk anyway >>>>>> so I'm not sure _floor() is useful >>>>> >>>>> Clear, I guess, the idea is to ensure ice-clk <= storage-clk in case of scale_up >>>>> and ice-clk >= storage-clk in case of scale_down. >>>> >>>> I don't quite understand the first case (ice <= storage for scale_up), could you >>>> please elaborate? >>> >>> Here I basically mean to say is that, as you mentioned "we generally set >>> storage_ctrl_rate == ice_clk_rate, but latter never goes above the FMAX of the former". >>> I guess, the ideal way to handle this is to ensure using _floor when we want to scale_up. >>> This ensures the ice_clk does not vote for more that what storage_ctrl is running on. >> >> Right, but what I was asking specifically is why we don't want that to happen > > I would argue saying that, having ice_clk higher than storage_ctrl_clk does > not makes sense, as it will not improve the throughput since the controller > clock rate will still be a bottle-neck and it will surely drain more power. Got it Konrad