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 845323242DF for ; Fri, 20 Feb 2026 09:43:04 +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=1771580585; cv=none; b=ciJe4FQKnZY2QuHKM5z8v3C2jaaPv3VTNOBUB6N8ZgN2FHGIFLrHSjlr2x1V1wQOFjd+UoL5kVoi9/LGsYnvVwjrd6RfQIbQlHoqjZ9LkfdXMcFkP8uSgUaYal8TxXxYKocp1jyxX+akCqyGdTZoIAma+uLOMaNFmRtp795+EfY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771580585; c=relaxed/simple; bh=CiWq+Xs4vmJh57HSDRnCX837eKkd1jg+USAW7LmCI34=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZSpIwicX9pbafhX7WtAqc+1YqEf1aMVuMCsPEDlmYEiUl6yUbtNYuEjy3pU8O/CegAGzAo9GfBH9MuHTT1OC2E0zqO9rUcayxlpX2XepdmOqUZeTpUPC02NRjEjuOpAaPXcAUtpGjCsLer2OfD0Oz3EhcP+krbUv2DBaaUPiWp4= 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=SigV1Ufs; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iRrDifmY; 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="SigV1Ufs"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iRrDifmY" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61K5Rlfp3154452 for ; Fri, 20 Feb 2026 09:43:03 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= Yq1Y/8D7dzvVWIg3adPvOmmq+xjHtt7YPV2lZuHm6v4=; b=SigV1UfsG8k21zWZ /++sdX/4++YVit6xZK1BheTCMXHzNp2CG3RyP6/BIplNRTUcEzTpxRWX7klVcJeF y9sMsznn/5KK5p9uLcxScVq9j7MivdK4gCJ9PsIZfw1jXKlJlPMEFYcn//GMGbGN oNfOF6xCfAB7N/cgLvY7brbgjpZTeMWpVKTz+4zuezbjjKs2xt0xi6AUG825rddn g9/QOEt772XFRPo0n0MslBOt1IsVF9HxxpyvJLGNLRF7UhWVn2P77f29H3zIz6BI 1nSDTOE8XmieNAurj2Qh55hft3NXxun+J8yUnPXmtFWHAOJ7/85Qm0EUDxkcoZcp g7/+dg== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ceh7bgks8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 20 Feb 2026 09:43:03 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8cb38346fdbso181640485a.0 for ; Fri, 20 Feb 2026 01:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771580582; x=1772185382; 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=Yq1Y/8D7dzvVWIg3adPvOmmq+xjHtt7YPV2lZuHm6v4=; b=iRrDifmYJ7xGqXAyT21BpE8q9uwu2Yc8i85fmKJ1t7yfIJQPiyhy321N+4plpSOGaw fa0dxq8eYugtVN45ha2Jm0NJLeGlXIyzQ71HFFEx57L2Mkl+V5xMEfcTJ33XIMgLYwSt DsZJCRilvQghrLyWQC5Oo6Iv2yMtG93Z9oyG3xvcbje5e9N/D9Py/GUmhufP7T08/+lJ 3Ik1v/41X+8Fhsfv3gF4ESwoYTob5Slaes1oJvFymq5usztK5e+Xqr1sWGHZFcrXWw0f 5DQaiG6054VjCAnsB3LvkouBFD6c/oSOE3UfHvuOD/IJtUXNIva1S5hIAbCMazr+PdPa oKDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771580582; x=1772185382; 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=Yq1Y/8D7dzvVWIg3adPvOmmq+xjHtt7YPV2lZuHm6v4=; b=jtxCu1TrPEiXf9yO02+5NNfc/boVDjoiLcUrPAg8xO/7uj0+kEuJVVrhD2iPJ0CbEK w3FOICgRrVNj//i9egEBQJ5cOWKb/hCsnDU8OLgXVhD27z3IpzIPhRDzbNsx57DgijeI Uyra9tl1uJEWlODs2s4xKa8DYN+fpaFEXmAmIUSNEjPu9UD9z3dxd48my66di+pcMntU ZKcFLWao6twwRUOXGerERTCxSqEOCjtYPqmqOUBaj7Eh5Q8CZAAOnbWywKYBZyIo8Wdh xcMRWZkFgy/Gm8c/37koyAoAfsuHleY6knSKgmIB70DXglKXfhw02uow6dSc/rWpvo1G KqgQ== X-Forwarded-Encrypted: i=1; AJvYcCUQqp8XARjvESO8bOa/n7rgdaK6RfYsYOIvlKDW2fv4eWB7nas5VGT2hICeklvv7seb7aqXSOpRrnsZRNk=@vger.kernel.org X-Gm-Message-State: AOJu0YzxhGfsaAZFGs/RD+r8+QK/y1O7kZxD2pAau3qQvebwMVIYt7m6 dP9fw1NncW77RQiHiVnWb/4Wi447pW+DqvUSpJDW94bPWSkYsdo71EEiV9jDohBVcXTHtvfAJw7 eiUetbQSSQOA+yMd64wywFPqQ0TRyCV2dWOY6AaKl5DCnKSoTtBJc7shPuGL6MfZoHSX16wetQV w= X-Gm-Gg: AZuq6aIbCmxwM59s1hmahCuAh7NKX9nNsx2dda/44b81SfMxkmrqx/a4KJ9eR9vzXy2 +/PgvTuhsNTaxBKzt72862y+pFfjf4EoKUaZTlG39jjdXD9o1M89AXjLN8uEcEcVBB2DVQS7m9V TgECijixwpZG1SVdajblehrFOhSr9ls3I/xHvhB9fY6dN8GneRQJnzd+T2A4qzJF/X40g3icFp1 6KFuYhVV6Vi7sHVka2pdSB8du2+Nn/LaUNQPm3QVFe4ut+q/OkaZmzHcFejLWg+VwpBLiT0G5HJ a3+8mTcWIJkLxzV3QWUfB3mPBdhMh2EX/8PGnNlyreUAHup4AIugYiIyV1nBLvnBfKNryFbU5lS P+6P4w63nD/H8ldD1v1pz+kgoTx+WIfMFPEXEAj3I14B395i8nXRmrg4boVv08UpKnw4VEiMk0b hEGAo= X-Received: by 2002:a05:620a:5dd1:b0:8cb:47cc:2dc8 with SMTP id af79cd13be357-8cb47cc3ad5mr1716688085a.3.1771580581657; Fri, 20 Feb 2026 01:43:01 -0800 (PST) X-Received: by 2002:a05:620a:5dd1:b0:8cb:47cc:2dc8 with SMTP id af79cd13be357-8cb47cc3ad5mr1716684785a.3.1771580581218; Fri, 20 Feb 2026 01:43:01 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-65bad4fa7c7sm4793620a12.31.2026.02.20.01.42.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Feb 2026 01:43:00 -0800 (PST) Message-ID: <5bf31bf9-835b-4b87-a4d0-8452d516f13c@oss.qualcomm.com> Date: Fri, 20 Feb 2026 10:42:58 +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> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=Voguwu2n c=1 sm=1 tr=0 ts=69982ca7 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=A-1GGxaxaoYmO2IoDNcA:9 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-ORIG-GUID: DuHvYWd-08CbRRfA8NkmBPnbh40xnuu2 X-Proofpoint-GUID: DuHvYWd-08CbRRfA8NkmBPnbh40xnuu2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIwMDA4NCBTYWx0ZWRfX42vQmYn+D8wl /kgu6d5XAn2YF7ZR25peRVk9YZz7hXnLoFzU7hLB+3it6bhZmyTtcvjR5cUgV6lJuYKeoaBfUbu 0ozyQOKXM1bS3S2YGQoURR+qS4GVg2oJKPrYjAwt720D0FK3J6dMe8xXYqx8Dkg8eXGke9siFsM SPKla+SbZt6bb7dEzFYaEIHcsSckwtFaWKqgTqOHwgl4/yT5pO8RcmZ4UKEvBeBFjsmp+X0h3zb 71LKNbuulelS8c80GFwp+P3c+rnzvL7qYrhKazmWmIkvzzWA4EwwkuODOWdMMecYqjuJat+Kzic EhO8aUETgptsZrLstIO7XhA3GsBwx7L+uO3X9vxSGQcwmG4cQmemglNcRUqyGnq1uwNYFB4XE+k EKwVUIkdbEyX4TF9ctABXhRDoPKzSAIGkttkrewcQrRy2OqnruWzdUkCVitI3puB4d4jWpeTw4L sVBJYffYFomD+rYUrIQ== 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-20_01,2026-02-20_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602200084 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 > Also, this avoids the corner case, where target_freq provided is higher that the supporter > rates (descriped in ICE OPP-table) for ICE, using _ceil makes no sense. This is potentially a valid concern, do we have cases of storage_clk > ice_clk? Konrad