Skip to contentSkip to conversation

clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst

PATCH In review Geert Uytterhoeven 2 participants 6 messages Jul 12, 2024 – Jul 14, 2024

Subsystems (2)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

cover clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst

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(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
author maintainer
#1 lore raw

PATCH 1/4 clk: renesas: r8a779a0: cpg_pll_configs should be __initconst

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")
---
 drivers/clk/renesas/r8a779a0-cpg-mssr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/r8a779a0-cpg-mssr.c +1 -1
index ff3f85e906fe17e1..d75d01b4c554a9e0 100644
@@ -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,	},
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH 2/4 clk: renesas: r8a779f0: cpg_pll_configs should be __initconst

In reply to 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")
---
 drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/r8a779f0-cpg-mssr.c +1 -1
index cc06127406ab5737..0a14f34105d0fadd 100644
@@ -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,	},
Signature · 1 line
2.34.1
author maintainer
#3 lore raw

PATCH 3/4 clk: renesas: r8a779g0: cpg_pll_configs should be __initconst

In reply to 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")
---
 drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/r8a779g0-cpg-mssr.c +1 -1
index c4b1938db76b35f4..a2bc3b0d38db6570 100644
@@ -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,	},
Signature · 1 line
2.34.1
author maintainer
#4 lore raw

PATCH 4/4 clk: renesas: r8a779h0: Initial clock descriptions should be __initconst

In reply to 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")
---
 drivers/clk/renesas/r8a779h0-cpg-mssr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/renesas/r8a779h0-cpg-mssr.c +3 -3
index e00e247a056fc96e..379e652293bf1964 100644
@@ -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,	},
Signature · 1 line
2.34.1
Reviewed-by on the v1 series
#5 lore raw
In reply to Geert Uytterhoeven

Hi Geert,

Thanks for your work.

Quoted 10 lines · 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!

For the whole series,

Quoted 27 lines

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(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
Signature · 2 lines
Kind Regards,
Niklas Söderlund