[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230713050550.GB3047@thinkpad>
Date: Thu, 13 Jul 2023 10:35:50 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>, vireshk@...nel.org,
nm@...com, sboyd@...nel.org, myungjoo.ham@...sung.com,
kyungmin.park@...sung.com, cw00.choi@...sung.com,
andersson@...nel.org, konrad.dybcio@...aro.org, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
quic_asutoshd@...cinc.com, quic_cang@...cinc.com,
quic_nitirawa@...cinc.com, quic_narepall@...cinc.com,
quic_bhaskarv@...cinc.com, quic_richardp@...cinc.com,
quic_nguyenb@...cinc.com, quic_ziqichen@...cinc.com,
bmasney@...hat.com, krzysztof.kozlowski@...aro.org
Subject: Re: [PATCH 11/14] scsi: ufs: host: Add support for parsing OPP
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
> > <manivannan.sadhasivam@...aro.org> 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
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists