From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 C760032C92A for ; Fri, 20 Feb 2026 07:33:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771572828; cv=none; b=c2tgLsT0hrZ5WPeslPkoReaW2MjTI7PWbIwfir1cfPgC8FexOKomY1itTU+EnyP2GFL3eWwTikQtbYucqGvi0MuSFVEIC6dJxmJg3GOlxLQta33Nl6HZoEUMGmWvbEkTPQmSBOmvdG4W1YIFiFwbHWAIlx+EGQlpo0gaJYWbzHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771572828; c=relaxed/simple; bh=xsvf9jYLQBHdxJveFh1wo9nT6UQDkdrlu1DELW+03LI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O5GBhJD+OjRD0vdqesixy03KysixiJU1LIjzJqhl0UlExDmxy1HT/YNDL51AZR9fOC/qsoludp/2ECELrgjIIwjjAsFmPODaIsxQ/L4hXbJmzQc8C2pk5qgdnjvg1EyaohIX6ikYj6yqImMhFoYZMzLlnJNTVABnugZ4UUFqJRk= 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=Q34j58us; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gPuTGfjm; arc=none smtp.client-ip=205.220.168.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="Q34j58us"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gPuTGfjm" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61K5S1Bj1805928 for ; Fri, 20 Feb 2026 07:33:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=4qV3RCnNtuJMys8ptmXIK3yq TjaBi+kJiADEiO/bAwU=; b=Q34j58us3ZFKvTyOKKsR7HHKlHXgTMmIqP+OhCfB hfH4FlNralDhDbpYMp8UhQZz4mpDTw7V7fK5MGyDemoX0bPl1PvA7LYumGR/eVCz NU7hfCMa01ea+rlqkeYXjbHDI/jcbJd+6v3BjTU+W2lbT2KXZmyQ3QsII5ww6seF kV9i/8LiOEFosAZTwAEWeuVC9RRQuE0VCI/i+cxk1XZzwc8j7vn+ahkof8AEiktn xg+Et7tB7JcQ3Im54bAgyMzDV5yxGDWPj9anwwv75aOdIEXzTuzFKPf2Ks2xU7Xa y5pNYAVmiD/tsLtOlLyVPAOp1wE5DmAZ8BZsMpO03STH3Q== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cedsnrv3k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 20 Feb 2026 07:33:46 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3561f5bd22eso1567501a91.2 for ; Thu, 19 Feb 2026 23:33:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771572826; x=1772177626; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4qV3RCnNtuJMys8ptmXIK3yqTjaBi+kJiADEiO/bAwU=; b=gPuTGfjmThFGFJ7vDA/nldhNkVLjQaKBT5RfUBxuqjNqsC+T7HL0DvLi+niqb3P/vd Jpetz9KvTcMMtpbLm+poF4R4soFyZqyV/scYb8V3PgczPhQ3v2XWCFadnYCoiwmecR/O 44c44P1/drLOG2D8GBVdE/E5bpQ7VKLGe+zLzsefSLHoB9dhvq18wU8Cyc0tkN8lx3GS ddMH6l+rghliHTXnSsadODh366uns0wieugqhLnwUsBJKb7DPHp3uhWIXaBKpC/yXqse M0JZdUgwSjaXDri3LhiWwR9lv2w5ft8YZoRVTbdLiT1YblpFNsvEifNbSn0z4IojC/d/ veNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771572826; x=1772177626; h=in-reply-to:content-disposition: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; bh=4qV3RCnNtuJMys8ptmXIK3yqTjaBi+kJiADEiO/bAwU=; b=wpl7Lw1KBO19BSCxBnOm15bJqf6MzhdNV4cM+JpXTN2WM5s424rLR83QHtIqNs3EyP Datg8lZBybIIBBmMpaPPyeCClDn4l6EFKGIucf2yZI322IeSqzNXDQQqw0+Mxc0yBB/w /85dcMQVZFFXoq1dSqhM5K6wIf054LS23L/UPmTlA2PFeIAWXxVINJEBB34h9aDBxI3J LWkOYsYypQnaS0ZH8Jt+xkrGajLPNup15hPvdF1oXvC2bUAeWHp27K6FizrBVQBHEBvS I0vIJNaSXs3UWzA3XxZ4/GwZBLspGyCrFH44n8Wt6aEE5IelqljxB9eaHEf0zuQKctKN spZQ== X-Forwarded-Encrypted: i=1; AJvYcCWD/3y72FZXy2JC7OVqqIe6hC1y2nkoTbThedj1JQgQxiHTkdU7Fr+uAuORw9IoJbBNuLLA39FJy3j2p2Q=@vger.kernel.org X-Gm-Message-State: AOJu0YzAQZZ2UK0LbyQwImSSaQsfPBGNClEm9YGhj69S8Un4Ccgowtcy gT+IcGPuuIVVBSHE1pGhcgf1eyOR0RgLHrHkLN9MAcCQ7C8QunLsHunj4Pt3udw3HqraMnME/tH idN3PXghdWYPydeVFoCn29MvgJfAcTYn68RXGexxStqFB2QvPbYZ0w2V/Nv4VGzHwfxo= X-Gm-Gg: AZuq6aIufN+B871pbECtV+6MpJhng99vIZAC/GUAJI9k6e4g3AsO2sRFP4NoqLU/mub 5vyO8n2MNfdJllz9wbLNP0uBFbLXdNQQ9E2dY2iGrwQG59YbkEAKc0Mr0yyHQ3o/72OOpnCh6Rn Tu4tHCgVg1ZCr7S+ghvAjaKd7yfkxq4w8JX91rLiTPvFsf7wuVTLZI0rS66QMW6Yz3X3Zj5Ou61 4sN+kYP9/G5gcm+QlDLyCrf/XVNLBEER6WBVNPVzNElebAGLUQyG6kPVg9V6kKhoKw+A4t3eRYT gHz5zURQB3IxX8VQ5ALfOeS6ojA9rnqIUh8G12vmgAFEVv6XBGSFsVKpGPPIx9f+S6nfRSojJmY KBem13jY7SJUimEJ/qlk201q4nIajDfw6IEhztwMlJJBBD2vNiZqolKIUV6c= X-Received: by 2002:a17:90b:1b41:b0:341:134:a962 with SMTP id 98e67ed59e1d1-358891ca0f2mr5846330a91.28.1771572826223; Thu, 19 Feb 2026 23:33:46 -0800 (PST) X-Received: by 2002:a17:90b:1b41:b0:341:134:a962 with SMTP id 98e67ed59e1d1-358891ca0f2mr5846304a91.28.1771572825705; Thu, 19 Feb 2026 23:33:45 -0800 (PST) Received: from hu-arakshit-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c6e532f2ba0sm17096468a12.25.2026.02.19.23.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Feb 2026 23:33:45 -0800 (PST) Date: Fri, 20 Feb 2026 13:03:38 +0530 From: Abhinaba Rakshit To: Konrad Dybcio 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 Subject: Re: [PATCH v5 2/4] soc: qcom: ice: Add OPP-based clock scaling support for ICE Message-ID: 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d2c99c4-3fe0-4e79-94e8-98b752158bd6@oss.qualcomm.com> X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIwMDA2NCBTYWx0ZWRfX599R9eLwRfbX kPWcLcMpXre/6vuULXqNCyEZBCbBaXIrIrVQQNxyt7AbikYi/b1d1HPxV1zPXrg1lFdYHHCgmuX Aw4KBFv/JaTnTaRDZs5EL7s7JIDY809s5MjQRi+Pi0bLlJOQhOcs5UWx5nAMmYPvgCeEdMDNRL/ l4grH5wbQYnxg/t1WR8lwZQwmmKblCWAtM4sx0rav2H1xeE9yvAYraSaA5HJxQCaOduK3UwyNcS NtYcWLEMxo4oufZm0u3dmI+Oj4bfo7zNrF44aJDq/Q4NY27ilhQwRkegFxyJN77KVZxMvUVIqhD A1AUPEdJgdxHfPxbE1Kiff7wvNiuDXQc7pm01j/lZDO1TWbDgkQFsjn+LVS4nlZrhGVqvdtuug4 r7QWChgA7SNBsU+wXHJJIWwKUmjJbjEoXkmaskhLS21DEbZSbvBTmr1RhE1w6+/ZcbE+gnkysXm XFDxzUUoFrAq8EiGwGw== X-Proofpoint-ORIG-GUID: Rk_-Tl0NWc02GSjlDg_2ZbzET1VOrEaE X-Authority-Analysis: v=2.4 cv=JsD8bc4C c=1 sm=1 tr=0 ts=69980e5a cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=kj9zAlcOel0A:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=BdqzZBkdcrjdDIVejFcA:9 a=CjuIK1q_8ugA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-GUID: Rk_-Tl0NWc02GSjlDg_2ZbzET1VOrEaE 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-19_06,2026-02-20_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602200064 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. 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. Abhinaba Rakshit