From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21B03C001DD for ; Thu, 13 Jul 2023 05:06:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233757AbjGMFGM (ORCPT ); Thu, 13 Jul 2023 01:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233728AbjGMFGL (ORCPT ); Thu, 13 Jul 2023 01:06:11 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49211198A for ; Wed, 12 Jul 2023 22:06:09 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-66c729f5618so351050b3a.1 for ; Wed, 12 Jul 2023 22:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689224769; x=1691816769; 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=+Qk0spvjqelsgWYpeQ4kuozBgLhUKaEE8K+ZAEOKFHI=; b=nc5qfVE+I1vS9zuVMeqaj6ZZnHW/m6LQosS9BCYtyi9vS/ZI/mRtPmNJV06jbclv2T 6OEUpPk3DNqV/q6zaAXs2IeBBeMqS4qFsyO30n401Y2JRIodmbGZQhN+t7QVwS9vi3R2 m+spgpGa9SDjPkuUcRuxdEovZwlp6419r3eKqI8A6a3XM9zYK3fyghxv1hYgfHAnBaw0 WjHgFUAaO8qxBknEjsSNIGUeD4mH4gdz9t++pAvOgrLkRo9dxu96yrGGa1zz0ySN0Z/l Esaq8AgM+y+DwlwwwLYyn33FMVDEKefidr9ReAiKKORVRlv2YjXTqEUMgpDIHSPoEcGc lTgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689224769; x=1691816769; 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=+Qk0spvjqelsgWYpeQ4kuozBgLhUKaEE8K+ZAEOKFHI=; b=PeuCbyHsV8Dn52XseyXJrpNxEt+TzPkxZ/XqBG2h2eZ+Ua/i1o8bj8z8te60rSx8iL acMRCSa1DJB/SYPBqCCfj2MFOyA1CD+SZY0SXzl6XZ18wFlAsACsDVpV1WCpFXdtbPnv C1MehVmukfzwCepp9tf9copv7xHsRsqy2OjYJHbJMxFKvhn33cTuT2UtB5aKAMo8k6Xt RGV7K2Arro64HXj5WTJq5bcNy4BjFRZIBJLROrJsGOgKjmbjhGLLvUlTcK2+zz3CtPYD JIi2DSGv/6lHw17fUQtTdKuAnNqpWCuYn9h5ZcU8sZlv/uGh5E8NrCNl1GJ8+HSMq9JG HM5g== X-Gm-Message-State: ABy/qLZ09nZ4JGxAS8dbYWDVlSJeVuNZgNhlxeHFxpzpNrRE6jyAEjFS gsdrcmZ3gFD1W6/iHJwtu9Yb X-Google-Smtp-Source: APBJJlF/hqFCRZdE64GpVVbs24NyzUFsLplRA/w8LLjXD9OzLL/2jfLMegk0qSbqFNrpgcwWBLzCQQ== X-Received: by 2002:a05:6a00:2e94:b0:654:4a24:d787 with SMTP id fd20-20020a056a002e9400b006544a24d787mr977416pfb.12.1689224768761; Wed, 12 Jul 2023 22:06:08 -0700 (PDT) Received: from thinkpad ([117.207.27.112]) by smtp.gmail.com with ESMTPSA id h25-20020a62b419000000b0063f00898245sm4589847pfn.146.2023.07.12.22.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 22:06:08 -0700 (PDT) Date: Thu, 13 Jul 2023 10:35:50 +0530 From: Manivannan Sadhasivam To: Viresh Kumar Cc: Dmitry Baryshkov , 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, linux-pm@vger.kernel.org, linux-kernel@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 Subject: Re: [PATCH 11/14] scsi: ufs: host: Add support for parsing OPP Message-ID: <20230713050550.GB3047@thinkpad> References: <20230712103213.101770-1-manivannan.sadhasivam@linaro.org> <20230712103213.101770-14-manivannan.sadhasivam@linaro.org> <20230712163406.GG102757@thinkpad> <20230713040918.jnf5oqiwymrdnrmq@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230713040918.jnf5oqiwymrdnrmq@vireshk-i7> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Thu, Jul 13, 2023 at 09:39:18AM +0530, Viresh Kumar wrote: > On 12-07-23, 19:48, Dmitry Baryshkov wrote: > > On Wed, 12 Jul 2023 at 19:34, Manivannan Sadhasivam > > wrote: > > > On Wed, Jul 12, 2023 at 04:15:12PM +0300, Dmitry Baryshkov wrote: > > > > On 12/07/2023 13:32, Manivannan Sadhasivam wrote: > > > > > > +static int ufshcd_opp_config_clks(struct device *dev, struct opp_table *opp_table, > > > > > + struct dev_pm_opp *opp, void *data, > > > > > + bool scaling_down) > > > > > +{ > > > > > + struct ufs_hba *hba = dev_get_drvdata(dev); > > > > > + struct list_head *head = &hba->clk_list_head; > > > > > + struct ufs_clk_info *clki; > > > > > + unsigned long freq; > > > > > + u8 idx = 0; > > > > > + int ret; > > > > > + > > > > > + list_for_each_entry(clki, head, list) { > > > > > + if (!IS_ERR_OR_NULL(clki->clk)) { > > > > > + freq = dev_pm_opp_get_freq_indexed(opp, idx++); > > > > > + > > > > > + /* Do not set rate for clocks having frequency as 0 */ > > > > > + if (!freq) > > > > > + continue; > > > > > > > > Can we omit these clocks from the opp table? I don't think they serve any > > > > purpose. > > > > > > > > > > No, we cannot. OPP requires the clocks and opp-hz to be of same length. > > I am okay with having a patch for the OPP core to modify this > behavior, as I told privately earlier. > > > > And we > > > cannot omit those clocks as well since linux needs to gate control them. > > > > Hmm, I thought we push the list of "interesting" clocks through > > config->clock_names. > > Yes, another way to solve this would be keep the interesting clocks in > the beginning in "clock-names" field and let the platform pass only > those to the OPP core. > > > > > > > > Maybe it would even make sense to move this function to drivers/opp then, as > > > > it will be generic enough. > > > > > > > > > > There is already a generic function available in OPP core. But we cannot use it > > > as we need to skip setting 0 freq and that's not applicable in OPP core as > > > discussed with Viresh offline. > > > > Ack. > > I am okay with either of the solutions, it is for you guys to decide > what works better for your platform. > We can settle with this custom callback for now. If there are drivers in the future trying to do the same (skipping 0 freq) then we can generalize. - Mani > -- > viresh -- மணிவண்ணன் சதாசிவம்