Skip to contentSkip to conversation

clk: ti: couple of fixes towards 5.8

PATCH Applied Tero Kristo 3 participants 8 messages Apr 29, 2020 – May 14, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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
index 6a89936ba03a..eaa43575cfa5 100644
@@ -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
#3 lore raw

PATCH 2/3 clk: ti: omap4: Add proper parent clocks for l4-secure clocks

In reply to Tero Kristo

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.

---
 drivers/clk/ti/clk-44xx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/clk/ti/clk-44xx.c +7 -7
index 312a20f8ec0e..a38c92153979 100644
@@ -606,13 +606,13 @@ static const struct omap_clkctrl_reg_data omap4_l4_per_clkctrl_regs[] __initcons
 
 static 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
maintainer Applied
#4 lore raw

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.

---

Applied to clk-next

#5 lore raw

PATCH 3/3 clk: ti: omap5: Add proper parent clocks for l4-secure clocks

In reply to Tero Kristo

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.

---
 drivers/clk/ti/clk-54xx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/clk/ti/clk-54xx.c +7 -7
index 92bf2dda95b9..8694bc9f5fc7 100644
@@ -303,13 +303,13 @@ static const struct omap_clkctrl_reg_data omap5_l4per_clkctrl_regs[] __initconst
 
 static 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
maintainer Applied
#6 lore raw

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.

---

Applied to clk-next

Acked-by on the v1 series
#7 lore raw
In reply to Tero Kristo
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: