linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Quanyang Wang <quanyang.wang@windriver.com>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Michal Simek <michal.simek@xilinx.com>,
	Rajan Vaja <rajan.vaja@xilinx.com>
Subject: Re: [PATCH] clk: zynqmp: pll: Fix divider calculation to avoid out-of-range rate
Date: Sat, 1 Oct 2022 12:40:01 +0200	[thread overview]
Message-ID: <20221001104001.r7r2utwymm32tv53@houat> (raw)
In-Reply-To: <20221001000503.23268C433D6@smtp.kernel.org>

Hi

On Fri, Sep 30, 2022 at 05:05:01PM -0700, Stephen Boyd wrote:
> +Maxime
> 
> Quoting Quanyang Wang (2022-09-28 18:05:10)
> > Hi Laurent,
> > 
> > I have sent a patch as below to fix this issue which set rate failed and 
> > it's in linux-next repo now.
> > 
> > https://lore.kernel.org/linux-arm-kernel/20220826142030.213805-1-quanyang.wang@windriver.com/T/
> > 

It looks to me that the fundamental issue is that, in some situations,
the round_rate implementation can return a rate outside of the
boundaries enforced on a clock.

I think that's the current behaviour (that was there prior to my
patches) to reject any rate outside of the boundaries in
clk_calc_new_rates() makes it clear that it's not something we should
allow.

I'm a bit two-minded on this though. All the failures of that test I've
seen actually turned out to be bugs, so I guess it's useful, but it's
also true that for rounding errors it's a bit overkill. We could also
relax that check and warn instead of failing.

> > As for the frequency gap between the requested rate and the actual, it's 
> > because of the commit:
> > 
> > commit 948fb0969eae8
> > Author: Maxime Ripard <maxime@cerno.tech>
> > Date:   Fri Feb 25 15:35:26 2022 +0100
> > 
> >      clk: Always clamp the rounded rate
> > 
> > And I haven't figured out how to fix it.

Again, it boils down on whether or not we should allow a rate outside of
boundaries. If we don't and if the clock can't do better, then yeah, the
rate difference is fairly big but we can't do better.

> Maxime has some more patches to fix this and they're in linux-next.
> Maybe those fix this problem?

I don't think they will fix it. However, depending on the outcome of
that discussion I can send more fixes your way :)

Maxime

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-10-01 10:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 20:16 [PATCH] clk: zynqmp: pll: Fix divider calculation to avoid out-of-range rate Laurent Pinchart
2022-09-29  1:05 ` Quanyang Wang
2022-10-01  0:05   ` Stephen Boyd
2022-10-01 10:40     ` Maxime Ripard [this message]
2022-10-02  2:17       ` Quanyang Wang
2022-10-03  0:06         ` Laurent Pinchart
2022-10-10  8:49         ` Maxime Ripard
2022-10-10 12:12           ` Quanyang Wang
2022-10-10 12:49             ` Maxime Ripard
2022-10-11  3:11               ` Quanyang Wang
2022-10-11 12:27                 ` Maxime Ripard
2022-10-02 23:45   ` Laurent Pinchart

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=20221001104001.r7r2utwymm32tv53@houat \
    --to=maxime@cerno.tech \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=quanyang.wang@windriver.com \
    --cc=rajan.vaja@xilinx.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;
as well as URLs for NNTP newsgroup(s).