clk: ti: couple of fixes towards 5.8
Subsystems (2)
cover clk: ti: couple of fixes towards 5.8
Hi,
The issues fixed by these patches have been around for a while, so they can be picked up for 5.8.
Patch #1 fixes a memory leak within composite clock registration, which is only visible on platforms actually using composite clocks; omap4/omap5.
Last two patches fix parenting of the l4-secure clocks for omap4/omap5, which was apparenly missed when the clkctrl data for these domains was created.
-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
PATCH 1/3 clk: ti: composite: fix memory leak
The parent_names is never released for a component clock definition, causing some memory leak. Fix by releasing it once it is no longer needed.
--- drivers/clk/ti/composite.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/ti/composite.c +1 -0
@@ -196,6 +196,7 @@ static void __init _register_composite(void *user,if (!cclk->comp_clks[i])continue ;list_del (&cclk->comp_clks[i]->link); +kfree (cclk->comp_clks[i]->parent_names);kfree (cclk->comp_clks[i]); }
Signature · 4 lines
2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Re: [PATCH 1/3] clk: ti: composite: fix memory leak
Quoting Tero Kristo (2020-04-29 06:13:39)
Quoted 7 lines
The
parent_namesis never released for a component clock definition, causing some memory leak. Fix by releasing it once it is no longer needed.Reported-by Tomi Valkeinen <[email protected]>Signed-off-by Tero Kristo <[email protected]>---
Applied to clk-next
PATCH 2/3 clk: ti: omap4: Add proper parent clocks for l4-secure clocks
In reply to Tero KristoL4 secure clocks do not have their parents set currently, which ends them up to the orphan clock list. Fix this by adding either l3 or l4 clock as their parent.
--- drivers/clk/ti/clk-44xx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/clk/ti/clk-44xx.c +7 -7
@@ -606,13 +606,13 @@ static const struct omap_clkctrl_reg_data omap4_l4_per_clkctrl_regs[] __initconsstatic const struct omap_clkctrl_reg_data omap4_l4_secure_clkctrl_regs[]__initconst = { - {OMAP4_AES1_CLKCTRL ,NULL ,CLKF_SW_SUP ,"" }, - {OMAP4_AES2_CLKCTRL ,NULL ,CLKF_SW_SUP ,"" }, - {OMAP4_DES3DES_CLKCTRL ,NULL ,CLKF_SW_SUP ,"" }, - {OMAP4_PKA_CLKCTRL ,NULL ,CLKF_SW_SUP ,"" }, - {OMAP4_RNG_CLKCTRL ,NULL ,CLKF_HW_SUP |CLKF_SOC_NONSEC ,"" }, - {OMAP4_SHA2MD5_CLKCTRL ,NULL ,CLKF_SW_SUP ,"" }, - {OMAP4_CRYPTODMA_CLKCTRL ,NULL ,CLKF_HW_SUP |CLKF_SOC_NONSEC ,"" }, + {OMAP4_AES1_CLKCTRL ,NULL ,CLKF_SW_SUP ,"l3_div_ck" }, + {OMAP4_AES2_CLKCTRL ,NULL ,CLKF_SW_SUP ,"l3_div_ck" }, + {OMAP4_DES3DES_CLKCTRL ,NULL ,CLKF_SW_SUP ,"l4_div_ck" }, + {OMAP4_PKA_CLKCTRL ,NULL ,CLKF_SW_SUP ,"l4_div_ck" }, + {OMAP4_RNG_CLKCTRL ,NULL ,CLKF_HW_SUP |CLKF_SOC_NONSEC ,"l4_div_ck" }, + {OMAP4_SHA2MD5_CLKCTRL ,NULL ,CLKF_SW_SUP ,"l3_div_ck" }, + {OMAP4_CRYPTODMA_CLKCTRL ,NULL ,CLKF_HW_SUP |CLKF_SOC_NONSEC ,"l3_div_ck" }, {0 }, };
Signature · 4 lines
2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Re: [PATCH 2/3] clk: ti: omap4: Add proper parent clocks for l4-secure clocks
Quoting Tero Kristo (2020-04-29 06:13:40)
Quoted 6 lines
L4 secure clocks do not have their parents set currently, which ends them up to the orphan clock list. Fix this by adding either l3 or l4 clock as their parent.
Signed-off-by Tero Kristo <[email protected]>---
Applied to clk-next
PATCH 3/3 clk: ti: omap5: Add proper parent clocks for l4-secure clocks
In reply to Tero KristoL4 secure clocks do not have their parents set currently, which ends them up to the orphan clock list. Fix this by adding either l3 or l4 clock as their parent.
--- drivers/clk/ti/clk-54xx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/clk/ti/clk-54xx.c +7 -7
@@ -303,13 +303,13 @@ static const struct omap_clkctrl_reg_data omap5_l4per_clkctrl_regs[] __initconststatic const struct omap_clkctrl_reg_data omap5_l4_secure_clkctrl_regs[]__initconst = { - {OMAP5_AES1_CLKCTRL ,NULL ,CLKF_HW_SUP ,"" }, - {OMAP5_AES2_CLKCTRL ,NULL ,CLKF_HW_SUP ,"" }, - {OMAP5_DES3DES_CLKCTRL ,NULL ,CLKF_HW_SUP ,"" }, - {OMAP5_FPKA_CLKCTRL ,NULL ,CLKF_SW_SUP ,"" }, - {OMAP5_RNG_CLKCTRL ,NULL ,CLKF_HW_SUP |CLKF_SOC_NONSEC ,"" }, - {OMAP5_SHA2MD5_CLKCTRL ,NULL ,CLKF_HW_SUP ,"" }, - {OMAP5_DMA_CRYPTO_CLKCTRL ,NULL ,CLKF_HW_SUP |CLKF_SOC_NONSEC ,"" }, + {OMAP5_AES1_CLKCTRL ,NULL ,CLKF_HW_SUP ,"l3_iclk_div" }, + {OMAP5_AES2_CLKCTRL ,NULL ,CLKF_HW_SUP ,"l3_iclk_div" }, + {OMAP5_DES3DES_CLKCTRL ,NULL ,CLKF_HW_SUP ,"l4_root_clk_div" }, + {OMAP5_FPKA_CLKCTRL ,NULL ,CLKF_SW_SUP ,"l4_root_clk_div" }, + {OMAP5_RNG_CLKCTRL ,NULL ,CLKF_HW_SUP |CLKF_SOC_NONSEC ,"l4_root_clk_div" }, + {OMAP5_SHA2MD5_CLKCTRL ,NULL ,CLKF_HW_SUP ,"l3_iclk_div" }, + {OMAP5_DMA_CRYPTO_CLKCTRL ,NULL ,CLKF_HW_SUP |CLKF_SOC_NONSEC ,"l3_iclk_div" }, {0 }, };
Signature · 4 lines
2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Re: [PATCH 3/3] clk: ti: omap5: Add proper parent clocks for l4-secure clocks
Quoting Tero Kristo (2020-04-29 06:13:41)
Quoted 6 lines
L4 secure clocks do not have their parents set currently, which ends them up to the orphan clock list. Fix this by adding either l3 or l4 clock as their parent.
Signed-off-by Tero Kristo <[email protected]>---
Applied to clk-next
Quoted 8 lines · Tero Kristo
Hi,
The issues fixed by these patches have been around for a while, so they can be picked up for 5.8.
Patch #1 fixes a memory leak within composite clock registration, which is only visible on platforms actually using composite clocks; omap4/omap5.
OK great thanks for chasing that one down.
Quoted 3 lines
Last two patches fix parenting of the l4-secure clocks for omap4/omap5, which was apparenly missed when the clkctrl data for these domains was created.
Oops sorry about that. Looks like I totally missed adding the source clocks for those.
For the whole series: