Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2411799rdb; Tue, 3 Oct 2023 23:26:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMGshns7F3jRLUBd9+jC9bcn/yLhkZhPEa7JH/Hc+2TR7nGIYSzo6+V9hdd73uQ7f3AxsK X-Received: by 2002:a67:fdc6:0:b0:44d:506c:b9c8 with SMTP id l6-20020a67fdc6000000b0044d506cb9c8mr934631vsq.26.1696400788327; Tue, 03 Oct 2023 23:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696400788; cv=none; d=google.com; s=arc-20160816; b=E9ochgcowjUohYZWnX0Fcx0Hbh3U6JmJOyZwVZgdbfhnlUj3mKeMDi/pxRGU5u0pC5 k+i6IjIHzlIQemiJMfLLR+9c/QZ1uJS9NXLfdoN7/C1dNxqFcH7CtZvEXTpmlrZlL5wA 0r87tm5QnLa6fGy08yw2rEZvi4ipbHny9wqZm0V02jTT01z37xnBMnRt+NHLw0JOn+4t w1Ui5jfzHZINrGzG0PaKp4mPMa077IqwswiGHky4fhRNOkd2q6/PNcDbVtKtulegKz8W oTn7oCwBP/phWTYwZXwGgKFLGf1HhQLwhgrJijEymo+XfRI//wCdmPmbhu48nqfFsJvm RJLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=f0giunb9BhnZYuBT/MmDlnRVSxHXgyke+1Gd+H5zheI=; fh=pzBBknRxlU7T1TsFTw+O15lVSBNcjNRPmnYpl9GwoUA=; b=tyZJCyDI1KeNPRKb5mk5IasbbNjEn7lQYaHW+NOyM/mYsg8QIvWXwFQPyjti2Gox2y AIyEHJTDmDBOIp7AhVvF7n04m9R2HyVdfyPmkeb16aN4WMqHytqj9GV6T50Of8JMDsEt QXL0J+53E7M3BIOb3Rvf9NCkmJgTg2D3UQIxsXAzIOgDszdyi0Tb8XwCMpgbMZJ7f4MZ /X1KO/ZghFWj/J/CW0ailKnThbgi1HbFZf1zyXZX/1VzG9ZQIKBm1xRSpUWttBBdT/Ao SUHgxp5qhU7TcD6dCb3hcsDJ1Ow5EQze0K9v2f0sw6+oSL+qYaX2EpHNiZXsaaByY+Be xL4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qwOPWgC7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bz25-20020a056a02061900b005775a0544e6si3578011pgb.135.2023.10.03.23.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 23:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qwOPWgC7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 808B980A770A; Tue, 3 Oct 2023 23:25:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241358AbjJDGZn (ORCPT + 99 others); Wed, 4 Oct 2023 02:25:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbjJDGZi (ORCPT ); Wed, 4 Oct 2023 02:25:38 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23417B8 for ; Tue, 3 Oct 2023 23:25:32 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso1355372a12.3 for ; Tue, 03 Oct 2023 23:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696400731; x=1697005531; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=f0giunb9BhnZYuBT/MmDlnRVSxHXgyke+1Gd+H5zheI=; b=qwOPWgC7ZX8ZZ6Za/SHn7TEjABBj52petaMyVmRZ5nOkr+Kn0U+CZNNMJf/eJq/TnG uhKLX7F1xVhoC4IYzfRPj0/BZnelmiK2M6cJeHumqG+2Y06DdEPlmfd65Q17CKuDVZks 58nOOFx82aYKFpo9FXa/qHEh3/xUON6bgEByLh7+kD2fPCFLqOrCZa17c69r6R+6F8Ml foXwRVtkn6Lx/KeI3VMftvX7eszgIcTeynyXmwXMb/A7uhAQcu0eUH9quzGGw6Wjv6+m T20TQAlhWYJ0DHEKxkFSIIWv8VUT0Z9n74fwii6BrgUCV3iwt5up51rQiqn3RFyUGXSh R/1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696400731; x=1697005531; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f0giunb9BhnZYuBT/MmDlnRVSxHXgyke+1Gd+H5zheI=; b=dyLfF11XU6MdcDBm5ECWLgNBUrQg2OE71Hm+Xg5JrHYXn4o5D9rNGecP/Q2EIONK4g Tp/uj4zAG/kf5SBak8sbP1tk+p4YoPubs3Q7ypheugJOdI8DuleXlqnLTyc2O1exz4/l eXvTtv0onBCyzyPH6x1YM7UWswp+s560XFfP30O2U4lnJV5UN39QYpbwHzOh4lBypW7O 402rt/z6xhNKxduZAdaujn093edycmzIJ2JZlSF3J8yOpl8+sfg8RhjpZlnDGq+JASR2 rHRFA+gwmbHdfvM1yK4G4GTB8SCUgXmA3j3yahAzZkGLRRtdsz4Bm8TfTWSmxtUOmIYv os6w== X-Gm-Message-State: AOJu0Yzt3DtAZ/8XEL+ejzQJmzCMooMSFY2hRq61xUIgvzsSGzLQFiOY IvJRxiXWyMmKQA79dfnxnlw4 X-Received: by 2002:a05:6a20:6a25:b0:163:f945:42da with SMTP id p37-20020a056a206a2500b00163f94542damr1749678pzk.48.1696400731277; Tue, 03 Oct 2023 23:25:31 -0700 (PDT) Received: from thinkpad ([117.217.185.220]) by smtp.gmail.com with ESMTPSA id c1-20020a170903234100b001c728609574sm2756459plh.6.2023.10.03.23.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 23:25:30 -0700 (PDT) Date: Wed, 4 Oct 2023 11:55:18 +0530 From: Manivannan Sadhasivam To: Dmitry Baryshkov Cc: vireshk@kernel.org, nm@ti.com, sboyd@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com, alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, quic_asutoshd@quicinc.com, quic_cang@quicinc.com, quic_nitirawa@quicinc.com, quic_narepall@quicinc.com, quic_bhaskarv@quicinc.com, quic_richardp@quicinc.com, quic_nguyenb@quicinc.com, quic_ziqichen@quicinc.com, bmasney@redhat.com, krzysztof.kozlowski@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 6/6] arm64: dts: qcom: sm8250: Add OPP table support to UFSHC Message-ID: <20231004062518.GB7298@thinkpad> References: <20231003111232.42663-1-manivannan.sadhasivam@linaro.org> <20231003111232.42663-7-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 23:25:51 -0700 (PDT) On Tue, Oct 03, 2023 at 06:25:22PM +0300, Dmitry Baryshkov wrote: > On Tue, 3 Oct 2023 at 14:16, Manivannan Sadhasivam > wrote: > > > > UFS host controller, when scaling gears, should choose appropriate > > performance state of RPMh power domain controller along with clock > > frequency. So let's add the OPP table support to specify both clock > > frequency and RPMh performance states replacing the old "freq-table-hz" > > property. > > > > Signed-off-by: Manivannan Sadhasivam > > --- > > arch/arm64/boot/dts/qcom/sm8250.dtsi | 39 +++++++++++++++++++++------- > > 1 file changed, 30 insertions(+), 9 deletions(-) > > > > diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi > > index a4e58ad731c3..33abd84aae53 100644 > > --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi > > +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi > > @@ -2198,21 +2198,42 @@ ufs_mem_hc: ufshc@1d84000 { > > <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>, > > <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>, > > <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>; > > - freq-table-hz = > > - <37500000 300000000>, > > - <0 0>, > > - <0 0>, > > - <37500000 300000000>, > > - <0 0>, > > - <0 0>, > > - <0 0>, > > - <0 0>; > > + > > + operating-points-v2 = <&ufs_opp_table>; > > > > interconnects = <&aggre1_noc MASTER_UFS_MEM 0 &mc_virt SLAVE_EBI_CH0 0>, > > <&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_UFS_MEM_CFG 0>; > > interconnect-names = "ufs-ddr", "cpu-ufs"; > > > > status = "disabled"; > > + > > + ufs_opp_table: opp-table { > > + compatible = "operating-points-v2"; > > + > > + opp-37500000 { > > + opp-hz = /bits/ 64 <37500000>, > > + /bits/ 64 <0>, > > + /bits/ 64 <0>, > > + /bits/ 64 <37500000>, > > + /bits/ 64 <0>, > > + /bits/ 64 <0>, > > + /bits/ 64 <0>, > > + /bits/ 64 <0>; > > I must say I still consider this to be uglier than hard coding clock > names in the driver. > It is all about choosing the less uglier one... First of all, it is not a good practice to hardcode clk names in the driver as the driver has to trust what is being supplied from DT. Also, the OPP support is added in the generic "ufshcd-platfrm" driver. Now for getting the clk names, I need to introduce a method to pass the names from the vendor drivers. There are already many such methods going between these two drivers making it messy and adding one more would only add up the worse. So I'd like to stick to this approach. - Mani > > + required-opps = <&rpmhpd_opp_low_svs>; > > + }; > > + > > + opp-300000000 { > > + opp-hz = /bits/ 64 <300000000>, > > + /bits/ 64 <0>, > > + /bits/ 64 <0>, > > + /bits/ 64 <300000000>, > > + /bits/ 64 <0>, > > + /bits/ 64 <0>, > > + /bits/ 64 <0>, > > + /bits/ 64 <0>; > > + required-opps = <&rpmhpd_opp_nom>; > > + }; > > + }; > > }; > > > > ufs_mem_phy: phy@1d87000 { > > -- > > 2.25.1 > > > > > -- > With best wishes > Dmitry -- மணிவண்ணன் சதாசிவம்