Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Christian Marangi <ansuelsmth@gmail.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/3] clk: qcom: clk-rcg2: add support for rcg2 freq multi ops
Date: Thu, 15 Jun 2023 13:29:24 +0200	[thread overview]
Message-ID: <648af616.1c0a0220.f8289.b7a9@mx.google.com> (raw)
In-Reply-To: <d251be3e02b2fe28357c884e39fe7601.sboyd@kernel.org>

On Wed, Jun 14, 2023 at 05:28:08PM -0700, Stephen Boyd wrote:
> Quoting Christian Marangi (2023-05-29 05:34:57)
> > On Mon, May 29, 2023 at 02:12:23PM +0200, Konrad Dybcio wrote:
> > > On 28.05.2023 14:37, Christian Marangi wrote:
> > > > On Sat, May 27, 2023 at 06:11:16PM +0200, Konrad Dybcio wrote:
> > > >> On 27.04.2023 17:07, Christian Marangi wrote:
> > > >>> +  * Force the first conf if we can't find a correct config.
> > > >>> +  */
> > > >>> + if (unlikely(i == f->num_confs))
> > > >>> +         best_conf = f->confs;
> > > >> Is that a supported scenario or would it be a device driver / clock
> > > >> driver error?
> > > >>
> > > > 
> > > > It's to handle case for the 2 continue in the loop and arriving in a
> > > > situation where best_conf was never set?
> > > > 
> > > > Should we return a warning and an ERR_PTR? Idea was to provide a best
> > > > effort selection.
> > > Hm.. I'm not sure what's the expected behavior here.. Stephen?
> > > 
> > 
> > I have this implementation rady, if you want I can send this revision
> > and discuss that in v5 directly. It's WARN and returning -EINVAL.
> 
> I'd only have a WARN if you never expect to hit that case. Otherwise, it
> should return -EINVAL and not warn. At a quick glance it sounds like
> some sort of rounding policy, so just make sure the
> round_rate/determine_rate implementation agrees with what set_rate()
> will do and it should be good.

Hi, in theory the WAN path should never happen, as it means no parent
for the clk are present. So I guess with your logic printing a WARN is
correct.

About the rounding policy this is more or less problematic, it's a
CLOSEST policy, so not a CEIL or FLOOR one. The determine_rate apply the
very same selection logic of set_rate so also that should be good.

I sent v5 some time ago with the concern here addressed so if you have
time it would be good if you can check that.

-- 
	Ansuel

  reply	other threads:[~2023-06-15 11:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 15:07 [PATCH v4 0/3] clk: qcom: clk-rcg2: introduce support for multiple conf for same freq Christian Marangi
2023-04-27 15:07 ` [PATCH v4 1/3] clk: qcom: clk-rcg: " Christian Marangi
2023-04-27 15:07 ` [PATCH v4 2/3] clk: qcom: clk-rcg2: add support for rcg2 freq multi ops Christian Marangi
2023-05-27 16:11   ` Konrad Dybcio
2023-05-28 12:37     ` Christian Marangi
2023-05-29 12:12       ` Konrad Dybcio
2023-05-29 12:34         ` Christian Marangi
2023-06-15  0:28           ` Stephen Boyd
2023-06-15 11:29             ` Christian Marangi [this message]
2023-04-27 15:07 ` [PATCH v4 3/3] clk: qcom: gcc-ipq8074: rework nss_port5/6 clock to multiple conf Christian Marangi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=648af616.1c0a0220.f8289.b7a9@mx.google.com \
    --to=ansuelsmth@gmail.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox