public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst
@ 2024-07-12 14:26 Geert Uytterhoeven
  2024-07-12 14:26 ` [PATCH 1/4] clk: renesas: r8a779a0: cpg_pll_configs " Geert Uytterhoeven
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-07-12 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Yoshihiro Shimoda,
	Niklas Söderlund, Cong Dang
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

	Hi all,

The various R-Car Gen4 clock drivers missed a few opportunities to put
constant clock description data in the __init section.  Fix this to
reduce memory consumption.

To be queued in renesas-clk-for-v6.12 (unless I get to doing a fixes
branch for v6.11).

Thanks for your comments!

Geert Uytterhoeven (4):
  clk: renesas: r8a779a0: cpg_pll_configs should be __initconst
  clk: renesas: r8a779f0: cpg_pll_configs should be __initconst
  clk: renesas: r8a779g0: cpg_pll_configs should be __initconst
  clk: renesas: r8a779h0: Initial clock descriptions should be
    __initconst

 drivers/clk/renesas/r8a779a0-cpg-mssr.c | 2 +-
 drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +-
 drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 +-
 drivers/clk/renesas/r8a779h0-cpg-mssr.c | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 1/4] clk: renesas: r8a779a0: cpg_pll_configs should be __initconst
  2024-07-12 14:26 [PATCH 0/4] clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst Geert Uytterhoeven
@ 2024-07-12 14:26 ` Geert Uytterhoeven
  2024-07-12 14:26 ` [PATCH 2/4] clk: renesas: r8a779f0: " Geert Uytterhoeven
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-07-12 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Yoshihiro Shimoda,
	Niklas Söderlund, Cong Dang
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

cpg_pll_configs[] is only used during initialization.  Hence make it
__initconst, so it will be freed later.

Fixes: 17bcc8035d2d19fc ("clk: renesas: cpg-mssr: Add support for R-Car V3U")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/renesas/r8a779a0-cpg-mssr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/renesas/r8a779a0-cpg-mssr.c b/drivers/clk/renesas/r8a779a0-cpg-mssr.c
index ff3f85e906fe17e1..d75d01b4c554a9e0 100644
--- a/drivers/clk/renesas/r8a779a0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779a0-cpg-mssr.c
@@ -253,7 +253,7 @@ static const unsigned int r8a779a0_crit_mod_clks[] __initconst = {
  */
 #define CPG_PLL_CONFIG_INDEX(md)	((((md) & BIT(14)) >> 13) | \
 					 (((md) & BIT(13)) >> 13))
-static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4] = {
+static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4] __initconst = {
 	/* EXTAL div	PLL1 mult/div	PLL2 mult/div	PLL3 mult/div	PLL4 mult/div	PLL5 mult/div	PLL6 mult/div	OSC prediv */
 	{ 1,		128,	1,	0,	0,	0,	0,	144,	1,	192,	1,	0,	0,	16,	},
 	{ 1,		106,	1,	0,	0,	0,	0,	120,	1,	160,	1,	0,	0,	19,	},
-- 
2.34.1


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

* [PATCH 2/4] clk: renesas: r8a779f0: cpg_pll_configs should be __initconst
  2024-07-12 14:26 [PATCH 0/4] clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst Geert Uytterhoeven
  2024-07-12 14:26 ` [PATCH 1/4] clk: renesas: r8a779a0: cpg_pll_configs " Geert Uytterhoeven
@ 2024-07-12 14:26 ` Geert Uytterhoeven
  2024-07-12 14:26 ` [PATCH 3/4] clk: renesas: r8a779g0: " Geert Uytterhoeven
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-07-12 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Yoshihiro Shimoda,
	Niklas Söderlund, Cong Dang
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

cpg_pll_configs[] is only used during initialization.  Hence make it
__initconst, so it will be freed later.

Fixes: 24aaff6a6ce4c4de ("clk: renesas: cpg-mssr: Add support for R-Car S4-8")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/renesas/r8a779f0-cpg-mssr.c b/drivers/clk/renesas/r8a779f0-cpg-mssr.c
index cc06127406ab5737..0a14f34105d0fadd 100644
--- a/drivers/clk/renesas/r8a779f0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779f0-cpg-mssr.c
@@ -187,7 +187,7 @@ static const unsigned int r8a779f0_crit_mod_clks[] __initconst = {
 #define CPG_PLL_CONFIG_INDEX(md)	((((md) & BIT(14)) >> 13) | \
 					 (((md) & BIT(13)) >> 13))
 
-static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4] = {
+static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4] __initconst = {
 	/* EXTAL div	PLL1 mult/div	PLL2 mult/div	PLL3 mult/div	PLL4 mult/div	PLL5 mult/div	PLL6 mult/div	OSC prediv */
 	{ 1,		200,	1,	150,	1,	200,	1,	0,	0,	200,	1,	134,	1,	15,	},
 	{ 1,		160,	1,	120,	1,	160,	1,	0,	0,	160,	1,	106,	1,	19,	},
-- 
2.34.1


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

* [PATCH 3/4] clk: renesas: r8a779g0: cpg_pll_configs should be __initconst
  2024-07-12 14:26 [PATCH 0/4] clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst Geert Uytterhoeven
  2024-07-12 14:26 ` [PATCH 1/4] clk: renesas: r8a779a0: cpg_pll_configs " Geert Uytterhoeven
  2024-07-12 14:26 ` [PATCH 2/4] clk: renesas: r8a779f0: " Geert Uytterhoeven
@ 2024-07-12 14:26 ` Geert Uytterhoeven
  2024-07-12 14:26 ` [PATCH 4/4] clk: renesas: r8a779h0: Initial clock descriptions " Geert Uytterhoeven
  2024-07-14  5:36 ` [PATCH 0/4] clk: renesas: rcar-gen4: " Niklas Söderlund
  4 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-07-12 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Yoshihiro Shimoda,
	Niklas Söderlund, Cong Dang
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

cpg_pll_configs[] is only used during initialization.  Hence make it
__initconst, so it will be freed later.

Fixes: 0ab55cf1834177a2 ("clk: renesas: cpg-mssr: Add support for R-Car V4H")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/renesas/r8a779g0-cpg-mssr.c b/drivers/clk/renesas/r8a779g0-cpg-mssr.c
index c4b1938db76b35f4..a2bc3b0d38db6570 100644
--- a/drivers/clk/renesas/r8a779g0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779g0-cpg-mssr.c
@@ -258,7 +258,7 @@ static const struct mssr_mod_clk r8a779g0_mod_clks[] __initconst = {
 #define CPG_PLL_CONFIG_INDEX(md)	((((md) & BIT(14)) >> 13) | \
 					 (((md) & BIT(13)) >> 13))
 
-static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4] = {
+static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4] __initconst = {
 	/* EXTAL div	PLL1 mult/div	PLL2 mult/div	PLL3 mult/div	PLL4 mult/div	PLL5 mult/div	PLL6 mult/div	OSC prediv */
 	{ 1,		192,	1,	204,	1,	192,	1,	144,	1,	192,	1,	168,	1,	16,	},
 	{ 1,		160,	1,	170,	1,	160,	1,	120,	1,	160,	1,	140,	1,	19,	},
-- 
2.34.1


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

* [PATCH 4/4] clk: renesas: r8a779h0: Initial clock descriptions should be __initconst
  2024-07-12 14:26 [PATCH 0/4] clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2024-07-12 14:26 ` [PATCH 3/4] clk: renesas: r8a779g0: " Geert Uytterhoeven
@ 2024-07-12 14:26 ` Geert Uytterhoeven
  2024-07-14  5:36 ` [PATCH 0/4] clk: renesas: rcar-gen4: " Niklas Söderlund
  4 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-07-12 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Yoshihiro Shimoda,
	Niklas Söderlund, Cong Dang
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

r8a779h0_core_clks[], r8a779h0_mod_clks[], and cpg_pll_configs[] are
only used during initialization.  Hence make them __initconst, so they
will be freed later.

Fixes: f077cab34df3010d ("clk: renesas: cpg-mssr: Add support for R-Car V4M")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/renesas/r8a779h0-cpg-mssr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/renesas/r8a779h0-cpg-mssr.c b/drivers/clk/renesas/r8a779h0-cpg-mssr.c
index e00e247a056fc96e..379e652293bf1964 100644
--- a/drivers/clk/renesas/r8a779h0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779h0-cpg-mssr.c
@@ -63,7 +63,7 @@ enum clk_ids {
 	MOD_CLK_BASE
 };
 
-static const struct cpg_core_clk r8a779h0_core_clks[] = {
+static const struct cpg_core_clk r8a779h0_core_clks[] __initconst = {
 	/* External Clock Inputs */
 	DEF_INPUT("extal",	CLK_EXTAL),
 	DEF_INPUT("extalr",	CLK_EXTALR),
@@ -172,7 +172,7 @@ static const struct cpg_core_clk r8a779h0_core_clks[] = {
 	DEF_GEN4_MDSEL("r",	R8A779H0_CLK_R, 29, CLK_EXTALR, 1, CLK_OCO, 1),
 };
 
-static const struct mssr_mod_clk r8a779h0_mod_clks[] = {
+static const struct mssr_mod_clk r8a779h0_mod_clks[] __initconst = {
 	DEF_MOD("avb0:rgmii0",	211,	R8A779H0_CLK_S0D8_HSC),
 	DEF_MOD("avb1:rgmii1",	212,	R8A779H0_CLK_S0D8_HSC),
 	DEF_MOD("avb2:rgmii2",	213,	R8A779H0_CLK_S0D8_HSC),
@@ -253,7 +253,7 @@ static const struct mssr_mod_clk r8a779h0_mod_clks[] = {
 #define CPG_PLL_CONFIG_INDEX(md)	((((md) & BIT(14)) >> 13) | \
 					 (((md) & BIT(13)) >> 13))
 
-static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4] = {
+static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4] __initconst = {
 	/* EXTAL div	PLL1 mult/div	PLL2 mult/div	PLL3 mult/div	PLL4 mult/div	PLL5 mult/div	PLL6 mult/div	OSC prediv */
 	{ 1,		192,	1,	240,	1,	192,	1,	240,	1,	192,	1,	168,	1,	16,	},
 	{ 1,		160,	1,	200,	1,	160,	1,	200,	1,	160,	1,	140,	1,	19,	},
-- 
2.34.1


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

* Re: [PATCH 0/4] clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst
  2024-07-12 14:26 [PATCH 0/4] clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2024-07-12 14:26 ` [PATCH 4/4] clk: renesas: r8a779h0: Initial clock descriptions " Geert Uytterhoeven
@ 2024-07-14  5:36 ` Niklas Söderlund
  4 siblings, 0 replies; 6+ messages in thread
From: Niklas Söderlund @ 2024-07-14  5:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, Yoshihiro Shimoda, Cong Dang,
	linux-renesas-soc, linux-clk

Hi Geert,

Thanks for your work.

On 2024-07-12 16:26:42 +0200, Geert Uytterhoeven wrote:
> 	Hi all,
> 
> The various R-Car Gen4 clock drivers missed a few opportunities to put
> constant clock description data in the __init section.  Fix this to
> reduce memory consumption.
> 
> To be queued in renesas-clk-for-v6.12 (unless I get to doing a fixes
> branch for v6.11).
> 
> Thanks for your comments!

For the whole series,

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> 
> Geert Uytterhoeven (4):
>   clk: renesas: r8a779a0: cpg_pll_configs should be __initconst
>   clk: renesas: r8a779f0: cpg_pll_configs should be __initconst
>   clk: renesas: r8a779g0: cpg_pll_configs should be __initconst
>   clk: renesas: r8a779h0: Initial clock descriptions should be
>     __initconst
> 
>  drivers/clk/renesas/r8a779a0-cpg-mssr.c | 2 +-
>  drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +-
>  drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 +-
>  drivers/clk/renesas/r8a779h0-cpg-mssr.c | 6 +++---
>  4 files changed, 6 insertions(+), 6 deletions(-)
> 
> -- 
> 2.34.1
> 
> Gr{oetje,eeting}s,
> 
> 						Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> 							    -- Linus Torvalds

-- 
Kind Regards,
Niklas Söderlund

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

end of thread, other threads:[~2024-07-14  5:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 14:26 [PATCH 0/4] clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst Geert Uytterhoeven
2024-07-12 14:26 ` [PATCH 1/4] clk: renesas: r8a779a0: cpg_pll_configs " Geert Uytterhoeven
2024-07-12 14:26 ` [PATCH 2/4] clk: renesas: r8a779f0: " Geert Uytterhoeven
2024-07-12 14:26 ` [PATCH 3/4] clk: renesas: r8a779g0: " Geert Uytterhoeven
2024-07-12 14:26 ` [PATCH 4/4] clk: renesas: r8a779h0: Initial clock descriptions " Geert Uytterhoeven
2024-07-14  5:36 ` [PATCH 0/4] clk: renesas: rcar-gen4: " Niklas Söderlund

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