mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix clk-divider rates above 4.29 GHz on 64-bit
@ 2026-11-02 21:07 Carlo Caione
  2026-11-02 21:07 ` [PATCH 1/2] clk: divider: Fix the divisor for rates above 4.29 GHz Carlo Caione
  2026-11-02 21:07 ` [PATCH 2/2] clk: divider: test: Add tests " Carlo Caione
  0 siblings, 2 replies; 6+ messages in thread
From: Carlo Caione @ 2026-11-02 21:07 UTC (permalink / raw)
  To: Stephen Boyd, Brian Masney, Jerome Brunet, Brian Norris
  Cc: Brian Norris, Sebastian Reichel, David Laight, linux-clk,
	linux-kernel, Stephen Boyd, Carlo Caione

On 64-bit platforms, the clk-divider truncates requested rates above
4.29 GHz when computing a divisor. Fix it and add KUnit tests.

Sebastian Reichel fixed this in 2023 [1], but later versions moved to a
new generic macro and were never applied. Patch 1 resends his v1 with a
new commit message. It uses the existing DIV64_U64_ROUND_UP(), as
Stephen asked for then [2]. On 32-bit, the rate fits in 32 bits, so
div64_u64() does the same 64/32 division as today [3].

[1] https://lore.kernel.org/linux-clk/20230519190522.194729-3-sebastian.reichel@collabora.com/
[2] https://lore.kernel.org/linux-clk/5e9e776db6628d02d7081292b81ab102.sboyd@kernel.org/
[3] https://lore.kernel.org/linux-clk/1b74d2ea2c3a458694c4c74f2381fcab@AcuMS.aculab.com/

---
Carlo Caione (1):
      clk: divider: test: Add tests for rates above 4.29 GHz

Sebastian Reichel (1):
      clk: divider: Fix the divisor for rates above 4.29 GHz

 drivers/clk/clk-divider.c      |   6 +--
 drivers/clk/clk-divider_test.c | 117 ++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 118 insertions(+), 5 deletions(-)
---
base-commit: ab94dbf302331eed3679e262e1d8d1a73f308640
change-id: 20261102-upstream-clk-divider-large-rates-872467864e39

Best regards,
--  
Carlo Caione <ccaione@baylibre.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-04 23:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 21:07 [PATCH 0/2] Fix clk-divider rates above 4.29 GHz on 64-bit Carlo Caione
2026-11-02 21:07 ` [PATCH 1/2] clk: divider: Fix the divisor for rates above 4.29 GHz Carlo Caione
2026-11-04 21:52   ` Brian Masney
2026-11-04 23:10     ` David Laight
2026-11-02 21:07 ` [PATCH 2/2] clk: divider: test: Add tests " Carlo Caione
2026-11-04 21:52   ` Brian Masney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®