Linux clock framework development
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Carlo Caione <ccaione@baylibre.com>
Cc: "Brian Masney" <masneyb@kernel.org>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Brian Masney" <bmasney+clk@redhat.com>,
	"Jerome Brunet" <jbrunet+clk@baylibre.com>,
	"Brian Norris" <computersforpeace@gmail.com>,
	"Maxime Coquelin" <maxime.coquelin@st.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Michael Turquette" <mturquette@linaro.org>,
	"Stephen Boyd" <sboyd@codeaurora.org>,
	"David Laight" <david.laight.linux@gmail.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jerome Brunet" <jbrunet@baylibre.com>
Subject: Re: [PATCH v2 1/3] clk: divider: Fix the divisor for rates above 4.29 GHz
Date: Thu, 12 Nov 2026 16:38:42 +0100	[thread overview]
Message-ID: <avXcic19CqrpL3SH@venus> (raw)
In-Reply-To: <avXa2Z3R6Xogr6Sw@macbook.homenet.telecomitalia.it>

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

Hi,

On Thu, Nov 12, 2026 at 04:29:55PM +0100, Carlo Caione wrote:
> On Thu, Nov 12, 2026 at 10:09:46 +0100, Brian Masney wrote:
> > Hi Carlo,
> 
> Hi Brian,
> 
> > >  static int _div_round_up(const struct clk_div_table *table,
> > >  			 unsigned long parent_rate, unsigned long rate,
> > >  			 unsigned long flags)
> > >  {
> > > -	int div = DIV_ROUND_UP_ULL((u64)parent_rate, rate);
> > > +	int div = _get_div_round_up(parent_rate, rate);
> > 
> > _get_div_round_up() returns an unsigned long however it's downsized to
> > an int here.
> 
> Right, but wasn't also DIV_ROUND_UP_ULL() previously returning a u64
> that was stored in the same int?

I would also argue, that this is a separate fix. Looking at the code
involved it goes all the way down to this incorrectly using int for
a clock rate:

/*
 * ...
 * @determine_rate: Given a target rate as input, returns the closest rate
 *		actually supported by the clock, and optionally the parent clock
 *		that should be used to provide the clock rate.
 * ...
 */
struct clk_ops {
    ...
    int (*determine_rate)(struct clk_hw *hw,
                          struct clk_rate_request *req);
    ...
}

Fixing that will be a bigger task.

Greetings,

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-11-12 15:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  9:36 [PATCH v2 0/3] Fix clk-divider rates above 4.29 GHz on 64-bit Carlo Caione
2026-11-12  9:36 ` [PATCH v2 1/3] clk: divider: Fix the divisor for rates above 4.29 GHz Carlo Caione
2026-11-12 15:09   ` Brian Masney
2026-11-12 15:29     ` Carlo Caione
2026-11-12 15:38       ` Sebastian Reichel [this message]
2026-11-12 15:34   ` Sebastian Reichel
2026-11-12  9:37 ` [PATCH v2 2/3] clk: divider: Fix round-closest for rates above the parent rate Carlo Caione
2026-11-12 15:41   ` Sebastian Reichel
2026-11-12  9:37 ` [PATCH v2 3/3] clk: divider: test: Add tests for rates above 4.29 GHz Carlo Caione
2026-11-12  9:50   ` sashiko-bot

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=avXcic19CqrpL3SH@venus \
    --to=sebastian.reichel@collabora.com \
    --cc=bmasney+clk@redhat.com \
    --cc=ccaione@baylibre.com \
    --cc=computersforpeace@gmail.com \
    --cc=david.laight.linux@gmail.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jbrunet@baylibre.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masneyb@kernel.org \
    --cc=maxime.coquelin@st.com \
    --cc=mturquette@linaro.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@codeaurora.org \
    --cc=sboyd@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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