Linux-OMAP Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/3] clk: ti: couple of fixes towards 5.8
@ 2020-04-29 13:13 Tero Kristo
  2020-04-29 13:13 ` [PATCH 1/3] clk: ti: composite: fix memory leak Tero Kristo
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Tero Kristo @ 2020-04-29 13:13 UTC (permalink / raw)
  To: linux-clk, sboyd, mturquette; +Cc: linux-omap, tony

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

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

* [PATCH 1/3] clk: ti: composite: fix memory leak
  2020-04-29 13:13 [PATCH 0/3] clk: ti: couple of fixes towards 5.8 Tero Kristo
@ 2020-04-29 13:13 ` Tero Kristo
  2020-05-14 19:54   ` Stephen Boyd
  2020-04-29 13:13 ` [PATCH 2/3] clk: ti: omap4: Add proper parent clocks for l4-secure clocks Tero Kristo
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Tero Kristo @ 2020-04-29 13:13 UTC (permalink / raw)
  To: linux-clk, sboyd, mturquette; +Cc: linux-omap, tony

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.

Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/clk/ti/composite.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c
index 6a89936ba03a..eaa43575cfa5 100644
--- a/drivers/clk/ti/composite.c
+++ b/drivers/clk/ti/composite.c
@@ -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]);
 	}
 
-- 
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 2/3] clk: ti: omap4: Add proper parent clocks for l4-secure clocks
  2020-04-29 13:13 [PATCH 0/3] clk: ti: couple of fixes towards 5.8 Tero Kristo
  2020-04-29 13:13 ` [PATCH 1/3] clk: ti: composite: fix memory leak Tero Kristo
@ 2020-04-29 13:13 ` Tero Kristo
  2020-05-14 19:54   ` Stephen Boyd
  2020-04-29 13:13 ` [PATCH 3/3] clk: ti: omap5: " Tero Kristo
  2020-04-29 22:21 ` [PATCH 0/3] clk: ti: couple of fixes towards 5.8 Tony Lindgren
  3 siblings, 1 reply; 8+ messages in thread
From: Tero Kristo @ 2020-04-29 13:13 UTC (permalink / raw)
  To: linux-clk, sboyd, mturquette; +Cc: linux-omap, tony

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 <t-kristo@ti.com>
---
 drivers/clk/ti/clk-44xx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/ti/clk-44xx.c b/drivers/clk/ti/clk-44xx.c
index 312a20f8ec0e..a38c92153979 100644
--- a/drivers/clk/ti/clk-44xx.c
+++ b/drivers/clk/ti/clk-44xx.c
@@ -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 },
 };
 
-- 
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 3/3] clk: ti: omap5: Add proper parent clocks for l4-secure clocks
  2020-04-29 13:13 [PATCH 0/3] clk: ti: couple of fixes towards 5.8 Tero Kristo
  2020-04-29 13:13 ` [PATCH 1/3] clk: ti: composite: fix memory leak Tero Kristo
  2020-04-29 13:13 ` [PATCH 2/3] clk: ti: omap4: Add proper parent clocks for l4-secure clocks Tero Kristo
@ 2020-04-29 13:13 ` Tero Kristo
  2020-05-14 19:55   ` Stephen Boyd
  2020-04-29 22:21 ` [PATCH 0/3] clk: ti: couple of fixes towards 5.8 Tony Lindgren
  3 siblings, 1 reply; 8+ messages in thread
From: Tero Kristo @ 2020-04-29 13:13 UTC (permalink / raw)
  To: linux-clk, sboyd, mturquette; +Cc: linux-omap, tony

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 <t-kristo@ti.com>
---
 drivers/clk/ti/clk-54xx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/ti/clk-54xx.c b/drivers/clk/ti/clk-54xx.c
index 92bf2dda95b9..8694bc9f5fc7 100644
--- a/drivers/clk/ti/clk-54xx.c
+++ b/drivers/clk/ti/clk-54xx.c
@@ -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 },
 };
 
-- 
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Re: [PATCH 0/3] clk: ti: couple of fixes towards 5.8
  2020-04-29 13:13 [PATCH 0/3] clk: ti: couple of fixes towards 5.8 Tero Kristo
                   ` (2 preceding siblings ...)
  2020-04-29 13:13 ` [PATCH 3/3] clk: ti: omap5: " Tero Kristo
@ 2020-04-29 22:21 ` Tony Lindgren
  3 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2020-04-29 22:21 UTC (permalink / raw)
  To: Tero Kristo; +Cc: linux-clk, sboyd, mturquette, linux-omap

* Tero Kristo <t-kristo@ti.com> [200429 13:14]:
> 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.

> 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:

Acked-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCH 1/3] clk: ti: composite: fix memory leak
  2020-04-29 13:13 ` [PATCH 1/3] clk: ti: composite: fix memory leak Tero Kristo
@ 2020-05-14 19:54   ` Stephen Boyd
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2020-05-14 19:54 UTC (permalink / raw)
  To: Tero Kristo, linux-clk, mturquette; +Cc: linux-omap, tony

Quoting Tero Kristo (2020-04-29 06:13:39)
> 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.
> 
> Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---

Applied to clk-next

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

* Re: [PATCH 2/3] clk: ti: omap4: Add proper parent clocks for l4-secure clocks
  2020-04-29 13:13 ` [PATCH 2/3] clk: ti: omap4: Add proper parent clocks for l4-secure clocks Tero Kristo
@ 2020-05-14 19:54   ` Stephen Boyd
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2020-05-14 19:54 UTC (permalink / raw)
  To: Tero Kristo, linux-clk, mturquette; +Cc: linux-omap, tony

Quoting Tero Kristo (2020-04-29 06:13:40)
> 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 <t-kristo@ti.com>
> ---

Applied to clk-next

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

* Re: [PATCH 3/3] clk: ti: omap5: Add proper parent clocks for l4-secure clocks
  2020-04-29 13:13 ` [PATCH 3/3] clk: ti: omap5: " Tero Kristo
@ 2020-05-14 19:55   ` Stephen Boyd
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2020-05-14 19:55 UTC (permalink / raw)
  To: Tero Kristo, linux-clk, mturquette; +Cc: linux-omap, tony

Quoting Tero Kristo (2020-04-29 06:13:41)
> 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 <t-kristo@ti.com>
> ---

Applied to clk-next

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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 13:13 [PATCH 0/3] clk: ti: couple of fixes towards 5.8 Tero Kristo
2020-04-29 13:13 ` [PATCH 1/3] clk: ti: composite: fix memory leak Tero Kristo
2020-05-14 19:54   ` Stephen Boyd
2020-04-29 13:13 ` [PATCH 2/3] clk: ti: omap4: Add proper parent clocks for l4-secure clocks Tero Kristo
2020-05-14 19:54   ` Stephen Boyd
2020-04-29 13:13 ` [PATCH 3/3] clk: ti: omap5: " Tero Kristo
2020-05-14 19:55   ` Stephen Boyd
2020-04-29 22:21 ` [PATCH 0/3] clk: ti: couple of fixes towards 5.8 Tony Lindgren

Linux-OMAP Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-omap/0 linux-omap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-omap linux-omap/ https://lore.kernel.org/linux-omap \
		linux-omap@vger.kernel.org
	public-inbox-index linux-omap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-omap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git