public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Christopher Obbard <chris.obbard@collabora.com>,
	David Laight <David.Laight@ACULAB.COM>,
	kernel@collabora.com
Subject: Re: [PATCH v2 2/2] clk: divider: Fix divisions
Date: Mon, 29 May 2023 10:50:51 +0200	[thread overview]
Message-ID: <66d9eaa2-4eb5-e9d1-cc76-0e0b68be44ca@collabora.com> (raw)
In-Reply-To: <20230526171057.66876-3-sebastian.reichel@collabora.com>

Il 26/05/23 19:10, Sebastian Reichel ha scritto:
> The clock framework handles clock rates as "unsigned long", so u32 on
> 32-bit architectures and u64 on 64-bit architectures.
> 
> The current code pointlessly casts the dividend to u64 on 32-bit
> architectures and thus pointlessly reducing the performance.
> 
> On the other hand on 64-bit architectures the divisor is masked and only
> the lower 32-bit are used. Thus requesting a frequency >= 4.3GHz results
> in incorrect values. For example requesting 4300000000 (4.3 GHz) will
> effectively request ca. 5 MHz. Requesting clk_round_rate(clk, ULONG_MAX)
> is a bit of a special case, since that still returns correct values as
> long as the parent clock is below 8.5 GHz.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



  reply	other threads:[~2023-05-29  8:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 17:10 [PATCH v2 0/2] Fix 64 bit issues in common clock framework Sebastian Reichel
2023-05-26 17:10 ` [PATCH v2 1/2] clk: composite: Fix handling of high clock rates Sebastian Reichel
2023-05-29  8:50   ` AngeloGioacchino Del Regno
2023-06-13  0:10   ` Stephen Boyd
2023-06-13 12:14     ` Maxime Ripard
2023-06-13 18:25       ` Stephen Boyd
2023-06-14 10:28         ` Maxime Ripard
2023-05-26 17:10 ` [PATCH v2 2/2] clk: divider: Fix divisions Sebastian Reichel
2023-05-29  8:50   ` AngeloGioacchino Del Regno [this message]
2023-06-13  0:41   ` Stephen Boyd
2023-06-13  8:05     ` David Laight

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=66d9eaa2-4eb5-e9d1-cc76-0e0b68be44ca@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=chris.obbard@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    /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