linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: sunxi-ng: Consider alternative parent rates when determining NKM clock rate
@ 2023-06-05 19:07 Frank Oltmanns
  2023-06-05 19:07 ` [PATCH 1/2] clk: sunxi-ng: nkm: consider alternative parent rates when finding rate Frank Oltmanns
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Frank Oltmanns @ 2023-06-05 19:07 UTC (permalink / raw)
  To: Andre Przywara, Chen-Yu Tsai, Frank Oltmanns, Jernej Skrabec,
	Maxime Ripard, Michael Turquette, Roman Beranek, Samuel Holland,
	Stephen Boyd
  Cc: linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi

I would like to share a patchset that enables the NKM clock in pll-video0 to
consider alternative parent rates. I have found this feature particularly useful
to adjust the pll-video0's clock on Allwinner A64, as it allows me to achieve an
optimal rate for driving the board's panel (in my case, the Pinephone).

To provide some context, the clock structure involved in this process is as follows:
    clock                       clock type
    --------------------------------------
    pll-video0                  ccu_nm
       pll-mipi                 ccu_nkm
          tcon0                 ccu_mux
             tcon-data-clock    sun4i_dclk

The divider between tcon0 and tcon-data-clock is fixed at 4. Therefore, in order
to achieve a rate that closely matches the desired rate of the panel, I need
pll-mipi to operate at a specific rate.

However, I must emphasize that setting the parent's rate for NKM clocks results
in a significant increase in the time required to find the optimal rate. For
instance, setting DCLK on the pinephone has seen a 60-fold increase in the time
taken, from approximately 0.5 ms to around 30 ms. These figures were obtained
through informal measurements on my pinephone, involving kernel logging and a
few reboots. The worst-case scenario observed was approximately 37 ms, while the
majority of cases were just under 30 ms.

The reason for this considerable increase in time is that the code now iterates
over all combinations of NKM for pll-mipi. For each combination, it subsequently
iterates over all combinations of NM for pll-video0.

I greatly appreciate your feedback and suggestions for further improving this
patchset.

Thanks,
  Frank

Frank Oltmanns (2):
  clk: sunxi-ng: nkm: consider alternative parent rates when finding
    rate
  clk: sunxi-ng: a64: allow pll-mipi to set parent's rate

 drivers/clk/sunxi-ng/ccu-sun50i-a64.c |  3 +-
 drivers/clk/sunxi-ng/ccu_nkm.c        | 40 +++++++++++++++++++++------
 2 files changed, 33 insertions(+), 10 deletions(-)

-- 
2.40.1


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

end of thread, other threads:[~2023-07-30 14:35 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-05 19:07 [PATCH 0/2] clk: sunxi-ng: Consider alternative parent rates when determining NKM clock rate Frank Oltmanns
2023-06-05 19:07 ` [PATCH 1/2] clk: sunxi-ng: nkm: consider alternative parent rates when finding rate Frank Oltmanns
2023-06-07  6:38   ` Maxime Ripard
2023-06-07  7:39     ` Frank Oltmanns
2023-06-12 12:19       ` Maxime Ripard
2023-06-12 16:29         ` Frank Oltmanns
2023-06-13  9:10           ` Maxime Ripard
2023-06-13 10:17             ` Frank Oltmanns
2023-06-13 15:30               ` Maxime Ripard
2023-06-15 16:04                 ` Frank Oltmanns
2023-06-19 16:36                   ` Maxime Ripard
2023-06-19  8:16             ` Frank Oltmanns
2023-06-19 18:05               ` Maxime Ripard
2023-06-20 18:51                 ` Frank Oltmanns
2023-06-26 16:45                   ` Maxime Ripard
2023-07-12  4:39                 ` Frank Oltmanns
2023-07-17 14:06                   ` Maxime Ripard
2023-07-23  8:59                     ` Frank Oltmanns
2023-07-25 13:55                       ` Maxime Ripard
2023-07-30 14:35                         ` Frank Oltmanns
2023-06-05 19:07 ` [PATCH 2/2] clk: sunxi-ng: a64: allow pll-mipi to set parent's rate Frank Oltmanns
2023-06-07  7:35 ` [PATCH 0/2] clk: sunxi-ng: Consider alternative parent rates when determining NKM clock rate Frank Oltmanns
2023-06-07 12:27   ` Maxime Ripard
2023-06-08  9:29     ` Frank Oltmanns
2023-06-12  8:53       ` Maxime Ripard

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).