linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] clk: ti: minor fixes and add sha2 instance for dra7
@ 2020-09-07  8:25 Tero Kristo
  2020-09-07  8:25 ` [PATCH 1/3] clk: ti: autoidle: add checks against NULL pointer reference Tero Kristo
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tero Kristo @ 2020-09-07  8:25 UTC (permalink / raw)
  To: linux-clk, sboyd; +Cc: linux-omap

Hi,

This series adds a couple of minor static checker fixes and new data
entry for second instance of SHA accelerator on dra7 SoC.

-Tero

---

Tero Kristo (3):
  clk: ti: autoidle: add checks against NULL pointer reference
  clk: ti: clockdomain: fix static checker warning
  clk: ti: dra7: add missing clkctrl register for SHA2 instance

 drivers/clk/ti/autoidle.c        | 14 ++++++++++++--
 drivers/clk/ti/clk-7xx.c         |  1 +
 drivers/clk/ti/clockdomain.c     |  2 ++
 include/dt-bindings/clock/dra7.h |  1 +
 4 files changed, 16 insertions(+), 2 deletions(-)

-- 
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] 7+ messages in thread

* [PATCH 1/3] clk: ti: autoidle: add checks against NULL pointer reference
  2020-09-07  8:25 [PATCH 0/3] clk: ti: minor fixes and add sha2 instance for dra7 Tero Kristo
@ 2020-09-07  8:25 ` Tero Kristo
  2020-09-22 20:00   ` Stephen Boyd
  2020-09-07  8:25 ` [PATCH 2/3] clk: ti: clockdomain: fix static checker warning Tero Kristo
  2020-09-07  8:26 ` [PATCH 3/3] clk: ti: dra7: add missing clkctrl register for SHA2 instance Tero Kristo
  2 siblings, 1 reply; 7+ messages in thread
From: Tero Kristo @ 2020-09-07  8:25 UTC (permalink / raw)
  To: linux-clk, sboyd; +Cc: linux-omap

The clk pointer passed to omap2_clk_(deny|allow)_idle can be NULL, so
add checks for this.

Reported-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/clk/ti/autoidle.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/ti/autoidle.c b/drivers/clk/ti/autoidle.c
index 1cae226759dd..f6f8a409f148 100644
--- a/drivers/clk/ti/autoidle.c
+++ b/drivers/clk/ti/autoidle.c
@@ -82,7 +82,12 @@ static int _omap2_clk_allow_idle(struct clk_hw_omap *clk)
  */
 int omap2_clk_deny_idle(struct clk *clk)
 {
-	struct clk_hw *hw = __clk_get_hw(clk);
+	struct clk_hw *hw;
+
+	if (!clk)
+		return -EINVAL;
+
+	hw = __clk_get_hw(clk);
 
 	if (omap2_clk_is_hw_omap(hw)) {
 		struct clk_hw_omap *c = to_clk_hw_omap(hw);
@@ -101,7 +106,12 @@ int omap2_clk_deny_idle(struct clk *clk)
  */
 int omap2_clk_allow_idle(struct clk *clk)
 {
-	struct clk_hw *hw = __clk_get_hw(clk);
+	struct clk_hw *hw;
+
+	if (!clk)
+		return -EINVAL;
+
+	hw = __clk_get_hw(clk);
 
 	if (omap2_clk_is_hw_omap(hw)) {
 		struct clk_hw_omap *c = to_clk_hw_omap(hw);
-- 
2.17.1

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

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

* [PATCH 2/3] clk: ti: clockdomain: fix static checker warning
  2020-09-07  8:25 [PATCH 0/3] clk: ti: minor fixes and add sha2 instance for dra7 Tero Kristo
  2020-09-07  8:25 ` [PATCH 1/3] clk: ti: autoidle: add checks against NULL pointer reference Tero Kristo
@ 2020-09-07  8:25 ` Tero Kristo
  2020-09-22 20:00   ` Stephen Boyd
  2020-09-07  8:26 ` [PATCH 3/3] clk: ti: dra7: add missing clkctrl register for SHA2 instance Tero Kristo
  2 siblings, 1 reply; 7+ messages in thread
From: Tero Kristo @ 2020-09-07  8:25 UTC (permalink / raw)
  To: linux-clk, sboyd; +Cc: linux-omap

Fix a memory leak induced by not calling clk_put after doing of_clk_get.

Reported-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/clk/ti/clockdomain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
index ee56306f79d5..700b7f44f671 100644
--- a/drivers/clk/ti/clockdomain.c
+++ b/drivers/clk/ti/clockdomain.c
@@ -148,10 +148,12 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
 		if (!omap2_clk_is_hw_omap(clk_hw)) {
 			pr_warn("can't setup clkdm for basic clk %s\n",
 				__clk_get_name(clk));
+			clk_put(clk);
 			continue;
 		}
 		to_clk_hw_omap(clk_hw)->clkdm_name = clkdm_name;
 		omap2_init_clk_clkdm(clk_hw);
+		clk_put(clk);
 	}
 }
 
-- 
2.17.1

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

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

* [PATCH 3/3] clk: ti: dra7: add missing clkctrl register for SHA2 instance
  2020-09-07  8:25 [PATCH 0/3] clk: ti: minor fixes and add sha2 instance for dra7 Tero Kristo
  2020-09-07  8:25 ` [PATCH 1/3] clk: ti: autoidle: add checks against NULL pointer reference Tero Kristo
  2020-09-07  8:25 ` [PATCH 2/3] clk: ti: clockdomain: fix static checker warning Tero Kristo
@ 2020-09-07  8:26 ` Tero Kristo
  2020-09-22 20:00   ` Stephen Boyd
  2 siblings, 1 reply; 7+ messages in thread
From: Tero Kristo @ 2020-09-07  8:26 UTC (permalink / raw)
  To: linux-clk, sboyd; +Cc: linux-omap

DRA7 SoC has two SHA instances. Add the clkctrl entry for the second
one.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/clk/ti/clk-7xx.c         | 1 +
 include/dt-bindings/clock/dra7.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c
index b4cf578a69e1..4e27f88062e7 100644
--- a/drivers/clk/ti/clk-7xx.c
+++ b/drivers/clk/ti/clk-7xx.c
@@ -637,6 +637,7 @@ static const struct omap_clkctrl_reg_data dra7_l4sec_clkctrl_regs[] __initconst
 	{ DRA7_L4SEC_DES_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
 	{ DRA7_L4SEC_RNG_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_SOC_NONSEC, "l4_root_clk_div" },
 	{ DRA7_L4SEC_SHAM_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
+	{ DRA7_L4SEC_SHAM2_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
 	{ 0 },
 };
 
diff --git a/include/dt-bindings/clock/dra7.h b/include/dt-bindings/clock/dra7.h
index 8cec5a1e1806..5ec4137231e3 100644
--- a/include/dt-bindings/clock/dra7.h
+++ b/include/dt-bindings/clock/dra7.h
@@ -332,6 +332,7 @@
 #define DRA7_L4SEC_DES_CLKCTRL	DRA7_L4SEC_CLKCTRL_INDEX(0x1b0)
 #define DRA7_L4SEC_RNG_CLKCTRL	DRA7_L4SEC_CLKCTRL_INDEX(0x1c0)
 #define DRA7_L4SEC_SHAM_CLKCTRL	DRA7_L4SEC_CLKCTRL_INDEX(0x1c8)
+#define DRA7_L4SEC_SHAM2_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1f8)
 
 /* l4per2 clocks */
 #define DRA7_L4PER2_CLKCTRL_OFFSET	0xc
-- 
2.17.1

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

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

* Re: [PATCH 1/3] clk: ti: autoidle: add checks against NULL pointer reference
  2020-09-07  8:25 ` [PATCH 1/3] clk: ti: autoidle: add checks against NULL pointer reference Tero Kristo
@ 2020-09-22 20:00   ` Stephen Boyd
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2020-09-22 20:00 UTC (permalink / raw)
  To: Tero Kristo, linux-clk; +Cc: linux-omap

Quoting Tero Kristo (2020-09-07 01:25:58)
> The clk pointer passed to omap2_clk_(deny|allow)_idle can be NULL, so
> add checks for this.
> 
> Reported-by: Dan Murphy <dmurphy@ti.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---

Applied to clk-next

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

* Re: [PATCH 2/3] clk: ti: clockdomain: fix static checker warning
  2020-09-07  8:25 ` [PATCH 2/3] clk: ti: clockdomain: fix static checker warning Tero Kristo
@ 2020-09-22 20:00   ` Stephen Boyd
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2020-09-22 20:00 UTC (permalink / raw)
  To: Tero Kristo, linux-clk; +Cc: linux-omap

Quoting Tero Kristo (2020-09-07 01:25:59)
> Fix a memory leak induced by not calling clk_put after doing of_clk_get.
> 
> Reported-by: Dan Murphy <dmurphy@ti.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---

Applied to clk-next

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

* Re: [PATCH 3/3] clk: ti: dra7: add missing clkctrl register for SHA2 instance
  2020-09-07  8:26 ` [PATCH 3/3] clk: ti: dra7: add missing clkctrl register for SHA2 instance Tero Kristo
@ 2020-09-22 20:00   ` Stephen Boyd
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2020-09-22 20:00 UTC (permalink / raw)
  To: Tero Kristo, linux-clk; +Cc: linux-omap

Quoting Tero Kristo (2020-09-07 01:26:00)
> DRA7 SoC has two SHA instances. Add the clkctrl entry for the second
> one.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---

Applied to clk-next

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

end of thread, other threads:[~2020-09-22 20:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07  8:25 [PATCH 0/3] clk: ti: minor fixes and add sha2 instance for dra7 Tero Kristo
2020-09-07  8:25 ` [PATCH 1/3] clk: ti: autoidle: add checks against NULL pointer reference Tero Kristo
2020-09-22 20:00   ` Stephen Boyd
2020-09-07  8:25 ` [PATCH 2/3] clk: ti: clockdomain: fix static checker warning Tero Kristo
2020-09-22 20:00   ` Stephen Boyd
2020-09-07  8:26 ` [PATCH 3/3] clk: ti: dra7: add missing clkctrl register for SHA2 instance Tero Kristo
2020-09-22 20:00   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).