linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] clk: at91: sckc: improve error path
@ 2019-06-13 15:37 Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 1/7] clk: at91: sckc: add support to free slow oscillator Claudiu.Beznea
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-13 15:37 UTC (permalink / raw)
  To: mturquette, sboyd, Nicolas.Ferre, alexandre.belloni
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Hi,

This series tries to improve error path for slow clock registrations
by adding functions to free resources and using them on failures.

It is created on top of patch series at [1].

Thank you,
Claudiu Beznea

[1] https://lore.kernel.org/lkml/1558433454-27971-1-git-send-email-claudiu.beznea@microchip.com/

Claudiu Beznea (7):
  clk: at91: sckc: add support to free slow oscillator
  clk: at91: sckc: add support to free slow rc oscillator
  clk: at91: sckc: add support to free slow clock osclillator
  clk: at91: sckc: improve error path for sam9x5 sck register
  clk: at91: sckc: remove unnecessary line
  clk: at91: sckc: improve error path for sama5d4 sck registration
  clk: at91: sckc: use dedicated functions to unregister clock

 drivers/clk/at91/sckc.c | 122 ++++++++++++++++++++++++++++++++++--------------
 1 file changed, 86 insertions(+), 36 deletions(-)

-- 
2.7.4


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

* [PATCH 1/7] clk: at91: sckc: add support to free slow oscillator
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
@ 2019-06-13 15:37 ` Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 2/7] clk: at91: sckc: add support to free slow rc oscillator Claudiu.Beznea
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-13 15:37 UTC (permalink / raw)
  To: mturquette, sboyd, Nicolas.Ferre, alexandre.belloni
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Add support to free slow oscillator resources.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clk/at91/sckc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index 2c410f41b413..c1d7edd33416 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -166,6 +166,14 @@ at91_clk_register_slow_osc(void __iomem *sckcr,
 	return hw;
 }
 
+static void at91_clk_unregister_slow_osc(struct clk_hw *hw)
+{
+	struct clk_slow_osc *osc = to_clk_slow_osc(hw);
+
+	clk_hw_unregister(hw);
+	kfree(osc);
+}
+
 static unsigned long clk_slow_rc_osc_recalc_rate(struct clk_hw *hw,
 						 unsigned long parent_rate)
 {
-- 
2.7.4


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

* [PATCH 2/7] clk: at91: sckc: add support to free slow rc oscillator
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 1/7] clk: at91: sckc: add support to free slow oscillator Claudiu.Beznea
@ 2019-06-13 15:37 ` Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 3/7] clk: at91: sckc: add support to free slow clock osclillator Claudiu.Beznea
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-13 15:37 UTC (permalink / raw)
  To: mturquette, sboyd, Nicolas.Ferre, alexandre.belloni
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Add support to free slow rc oscillator resources.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clk/at91/sckc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index c1d7edd33416..492b139a7c15 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -268,6 +268,14 @@ at91_clk_register_slow_rc_osc(void __iomem *sckcr,
 	return hw;
 }
 
+static void at91_clk_unregister_slow_rc_osc(struct clk_hw *hw)
+{
+	struct clk_slow_rc_osc *osc = to_clk_slow_rc_osc(hw);
+
+	clk_hw_unregister(hw);
+	kfree(osc);
+}
+
 static int clk_sam9x5_slow_set_parent(struct clk_hw *hw, u8 index)
 {
 	struct clk_sam9x5_slow *slowck = to_clk_sam9x5_slow(hw);
-- 
2.7.4


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

* [PATCH 3/7] clk: at91: sckc: add support to free slow clock osclillator
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 1/7] clk: at91: sckc: add support to free slow oscillator Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 2/7] clk: at91: sckc: add support to free slow rc oscillator Claudiu.Beznea
@ 2019-06-13 15:37 ` Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 4/7] clk: at91: sckc: improve error path for sam9x5 sck register Claudiu.Beznea
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-13 15:37 UTC (permalink / raw)
  To: mturquette, sboyd, Nicolas.Ferre, alexandre.belloni
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Add support to free slow clock oscillator resources.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clk/at91/sckc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index 492b139a7c15..2a677c56f901 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -355,6 +355,14 @@ at91_clk_register_sam9x5_slow(void __iomem *sckcr,
 	return hw;
 }
 
+static void at91_clk_unregister_sam9x5_slow(struct clk_hw *hw)
+{
+	struct clk_sam9x5_slow *slowck = to_clk_sam9x5_slow(hw);
+
+	clk_hw_unregister(hw);
+	kfree(slowck);
+}
+
 static void __init at91sam9x5_sckc_register(struct device_node *np,
 					    unsigned int rc_osc_startup_us,
 					    const struct clk_slow_bits *bits)
-- 
2.7.4


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

* [PATCH 4/7] clk: at91: sckc: improve error path for sam9x5 sck register
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
                   ` (2 preceding siblings ...)
  2019-06-13 15:37 ` [PATCH 3/7] clk: at91: sckc: add support to free slow clock osclillator Claudiu.Beznea
@ 2019-06-13 15:37 ` Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 5/7] clk: at91: sckc: remove unnecessary line Claudiu.Beznea
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-13 15:37 UTC (permalink / raw)
  To: mturquette, sboyd, Nicolas.Ferre, alexandre.belloni
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Improve error path for sam9x5 slow clock registration.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clk/at91/sckc.c | 50 +++++++++++++++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 18 deletions(-)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index 2a677c56f901..a2b905c91085 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -371,16 +371,17 @@ static void __init at91sam9x5_sckc_register(struct device_node *np,
 	void __iomem *regbase = of_iomap(np, 0);
 	struct device_node *child = NULL;
 	const char *xtal_name;
-	struct clk_hw *hw;
+	struct clk_hw *slow_rc, *slow_osc, *slowck;
 	bool bypass;
+	int ret;
 
 	if (!regbase)
 		return;
 
-	hw = at91_clk_register_slow_rc_osc(regbase, parent_names[0], 32768,
-					   50000000, rc_osc_startup_us,
-					   bits);
-	if (IS_ERR(hw))
+	slow_rc = at91_clk_register_slow_rc_osc(regbase, parent_names[0],
+						32768, 50000000,
+						rc_osc_startup_us, bits);
+	if (IS_ERR(slow_rc))
 		return;
 
 	xtal_name = of_clk_get_parent_name(np, 0);
@@ -388,7 +389,7 @@ static void __init at91sam9x5_sckc_register(struct device_node *np,
 		/* DT backward compatibility */
 		child = of_get_compatible_child(np, "atmel,at91sam9x5-clk-slow-osc");
 		if (!child)
-			return;
+			goto unregister_slow_rc;
 
 		xtal_name = of_clk_get_parent_name(child, 0);
 		bypass = of_property_read_bool(child, "atmel,osc-bypass");
@@ -399,23 +400,36 @@ static void __init at91sam9x5_sckc_register(struct device_node *np,
 	}
 
 	if (!xtal_name)
-		return;
-
-	hw = at91_clk_register_slow_osc(regbase, parent_names[1], xtal_name,
-					1200000, bypass, bits);
-	if (IS_ERR(hw))
-		return;
+		goto unregister_slow_rc;
 
-	hw = at91_clk_register_sam9x5_slow(regbase, "slowck", parent_names, 2,
-					   bits);
-	if (IS_ERR(hw))
-		return;
+	slow_osc = at91_clk_register_slow_osc(regbase, parent_names[1],
+					      xtal_name, 1200000, bypass, bits);
+	if (IS_ERR(slow_osc))
+		goto unregister_slow_rc;
 
-	of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
+	slowck = at91_clk_register_sam9x5_slow(regbase, "slowck", parent_names,
+					       2, bits);
+	if (IS_ERR(slowck))
+		goto unregister_slow_osc;
 
 	/* DT backward compatibility */
 	if (child)
-		of_clk_add_hw_provider(child, of_clk_hw_simple_get, hw);
+		ret = of_clk_add_hw_provider(child, of_clk_hw_simple_get,
+					     slowck);
+	else
+		ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, slowck);
+
+	if (WARN_ON(ret))
+		goto unregister_slowck;
+
+	return;
+
+unregister_slowck:
+	at91_clk_unregister_sam9x5_slow(slowck);
+unregister_slow_osc:
+	at91_clk_unregister_slow_osc(slow_osc);
+unregister_slow_rc:
+	at91_clk_unregister_slow_rc_osc(slow_rc);
 }
 
 static const struct clk_slow_bits at91sam9x5_bits = {
-- 
2.7.4


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

* [PATCH 5/7] clk: at91: sckc: remove unnecessary line
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
                   ` (3 preceding siblings ...)
  2019-06-13 15:37 ` [PATCH 4/7] clk: at91: sckc: improve error path for sam9x5 sck register Claudiu.Beznea
@ 2019-06-13 15:37 ` Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 6/7] clk: at91: sckc: improve error path for sama5d4 sck registration Claudiu.Beznea
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-13 15:37 UTC (permalink / raw)
  To: mturquette, sboyd, Nicolas.Ferre, alexandre.belloni
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Remove unnecessary line.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clk/at91/sckc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index a2b905c91085..c61b6c9ddb94 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -601,7 +601,6 @@ static void __init of_sama5d4_sckc_setup(struct device_node *np)
 	osc->startup_usec = 1200000;
 	osc->bits = &at91sama5d4_bits;
 
-	hw = &osc->hw;
 	ret = clk_hw_register(NULL, &osc->hw);
 	if (ret) {
 		kfree(osc);
-- 
2.7.4


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

* [PATCH 6/7] clk: at91: sckc: improve error path for sama5d4 sck registration
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
                   ` (4 preceding siblings ...)
  2019-06-13 15:37 ` [PATCH 5/7] clk: at91: sckc: remove unnecessary line Claudiu.Beznea
@ 2019-06-13 15:37 ` Claudiu.Beznea
  2019-06-13 15:37 ` [PATCH 7/7] clk: at91: sckc: use dedicated functions to unregister clock Claudiu.Beznea
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-13 15:37 UTC (permalink / raw)
  To: mturquette, sboyd, Nicolas.Ferre, alexandre.belloni
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Improve error path for sama5d4 sck registration.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clk/at91/sckc.c | 43 ++++++++++++++++++++++++++++---------------
 1 file changed, 28 insertions(+), 15 deletions(-)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index c61b6c9ddb94..f7ad3e9414dc 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -568,7 +568,7 @@ static const struct clk_slow_bits at91sama5d4_bits = {
 static void __init of_sama5d4_sckc_setup(struct device_node *np)
 {
 	void __iomem *regbase = of_iomap(np, 0);
-	struct clk_hw *hw;
+	struct clk_hw *slow_rc, *slowck;
 	struct clk_sama5d4_slow_osc *osc;
 	struct clk_init_data init;
 	const char *xtal_name;
@@ -578,17 +578,18 @@ static void __init of_sama5d4_sckc_setup(struct device_node *np)
 	if (!regbase)
 		return;
 
-	hw = clk_hw_register_fixed_rate_with_accuracy(NULL, parent_names[0],
-						      NULL, 0, 32768,
-						      250000000);
-	if (IS_ERR(hw))
+	slow_rc = clk_hw_register_fixed_rate_with_accuracy(NULL,
+							   parent_names[0],
+							   NULL, 0, 32768,
+							   250000000);
+	if (IS_ERR(slow_rc))
 		return;
 
 	xtal_name = of_clk_get_parent_name(np, 0);
 
 	osc = kzalloc(sizeof(*osc), GFP_KERNEL);
 	if (!osc)
-		return;
+		goto unregister_slow_rc;
 
 	init.name = parent_names[1];
 	init.ops = &sama5d4_slow_osc_ops;
@@ -602,17 +603,29 @@ static void __init of_sama5d4_sckc_setup(struct device_node *np)
 	osc->bits = &at91sama5d4_bits;
 
 	ret = clk_hw_register(NULL, &osc->hw);
-	if (ret) {
-		kfree(osc);
-		return;
-	}
+	if (ret)
+		goto free_slow_osc_data;
 
-	hw = at91_clk_register_sam9x5_slow(regbase, "slowck", parent_names, 2,
-					   &at91sama5d4_bits);
-	if (IS_ERR(hw))
-		return;
+	slowck = at91_clk_register_sam9x5_slow(regbase, "slowck",
+					       parent_names, 2,
+					       &at91sama5d4_bits);
+	if (IS_ERR(slowck))
+		goto unregister_slow_osc;
 
-	of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
+	ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, slowck);
+	if (WARN_ON(ret))
+		goto unregister_slowck;
+
+	return;
+
+unregister_slowck:
+	at91_clk_unregister_sam9x5_slow(slowck);
+unregister_slow_osc:
+	clk_hw_unregister(&osc->hw);
+free_slow_osc_data:
+	kfree(osc);
+unregister_slow_rc:
+	clk_hw_unregister(slow_rc);
 }
 CLK_OF_DECLARE(sama5d4_clk_sckc, "atmel,sama5d4-sckc",
 	       of_sama5d4_sckc_setup);
-- 
2.7.4


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

* [PATCH 7/7] clk: at91: sckc: use dedicated functions to unregister clock
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
                   ` (5 preceding siblings ...)
  2019-06-13 15:37 ` [PATCH 6/7] clk: at91: sckc: improve error path for sama5d4 sck registration Claudiu.Beznea
@ 2019-06-13 15:37 ` Claudiu.Beznea
  2019-06-18  9:55 ` [PATCH 0/7] clk: at91: sckc: improve error path Alexandre Belloni
  2019-06-27 15:03 ` Stephen Boyd
  8 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-13 15:37 UTC (permalink / raw)
  To: mturquette, sboyd, Nicolas.Ferre, alexandre.belloni
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Use at91 specific functions to free all resources in case of error.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clk/at91/sckc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index f7ad3e9414dc..42502830a56a 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -514,13 +514,13 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np)
 	return;
 
 unregister_td_slck:
-	clk_hw_unregister(clk_data->hws[1]);
+	at91_clk_unregister_sam9x5_slow(clk_data->hws[1]);
 unregister_md_slck:
 	clk_hw_unregister(clk_data->hws[0]);
 clk_data_free:
 	kfree(clk_data);
 unregister_slow_osc:
-	clk_hw_unregister(slow_osc);
+	at91_clk_unregister_slow_osc(slow_osc);
 unregister_slow_rc:
 	clk_hw_unregister(slow_rc);
 }
-- 
2.7.4


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

* Re: [PATCH 0/7] clk: at91: sckc: improve error path
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
                   ` (6 preceding siblings ...)
  2019-06-13 15:37 ` [PATCH 7/7] clk: at91: sckc: use dedicated functions to unregister clock Claudiu.Beznea
@ 2019-06-18  9:55 ` Alexandre Belloni
  2019-06-20 10:30   ` Claudiu.Beznea
  2019-06-27 15:03 ` Stephen Boyd
  8 siblings, 1 reply; 15+ messages in thread
From: Alexandre Belloni @ 2019-06-18  9:55 UTC (permalink / raw)
  To: Claudiu.Beznea
  Cc: mturquette, sboyd, Nicolas.Ferre, linux-clk, linux-arm-kernel,
	linux-kernel, claudiu.beznea

On 13/06/2019 15:37:06+0000, Claudiu.Beznea@microchip.com wrote:
> From: Claudiu Beznea <claudiu.beznea@microchip.com>
> 
> Hi,
> 
> This series tries to improve error path for slow clock registrations
> by adding functions to free resources and using them on failures.
> 

Does the platform even boot when the slow clock is not available? 

The TCB clocksource would fail at:

        tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk");
        if (IS_ERR(tc.slow_clk))
                return PTR_ERR(tc.slow_clk);


> It is created on top of patch series at [1].
> 
> Thank you,
> Claudiu Beznea
> 
> [1] https://lore.kernel.org/lkml/1558433454-27971-1-git-send-email-claudiu.beznea@microchip.com/
> 
> Claudiu Beznea (7):
>   clk: at91: sckc: add support to free slow oscillator
>   clk: at91: sckc: add support to free slow rc oscillator
>   clk: at91: sckc: add support to free slow clock osclillator
>   clk: at91: sckc: improve error path for sam9x5 sck register
>   clk: at91: sckc: remove unnecessary line
>   clk: at91: sckc: improve error path for sama5d4 sck registration
>   clk: at91: sckc: use dedicated functions to unregister clock
> 
>  drivers/clk/at91/sckc.c | 122 ++++++++++++++++++++++++++++++++++--------------
>  1 file changed, 86 insertions(+), 36 deletions(-)
> 
> -- 
> 2.7.4
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 0/7] clk: at91: sckc: improve error path
  2019-06-18  9:55 ` [PATCH 0/7] clk: at91: sckc: improve error path Alexandre Belloni
@ 2019-06-20 10:30   ` Claudiu.Beznea
  2019-06-21  9:33     ` Alexandre Belloni
  0 siblings, 1 reply; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-20 10:30 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: mturquette, sboyd, Nicolas.Ferre, linux-clk, linux-arm-kernel,
	linux-kernel, claudiu.beznea

Hi,

On 18.06.2019 12:55, Alexandre Belloni wrote:
> On 13/06/2019 15:37:06+0000, Claudiu.Beznea@microchip.com wrote:
>> From: Claudiu Beznea <claudiu.beznea@microchip.com>
>>
>> Hi,
>>
>> This series tries to improve error path for slow clock registrations
>> by adding functions to free resources and using them on failures.
>>
> 
> Does the platform even boot when the slow clock is not available? 
> 
> The TCB clocksource would fail at:
> 
>         tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk");
>         if (IS_ERR(tc.slow_clk))
>                 return PTR_ERR(tc.slow_clk);
> 

In case of using TC as clocksource, yes, the platform wouldn't boot if slow
clock is not available, because, anyway the TC needs it. PIT may work
without it (if slow clock is not used to drive the PIT).

For sure there are other IPs (which may be or are driven by slow clock)
which may not work if slow clock is driven them.

Anyway, please let me know if you feel this series has no meaning.

Thank you,
Claudiu Beznea

> 
>> It is created on top of patch series at [1].
>>
>> Thank you,
>> Claudiu Beznea
>>
>> [1] https://lore.kernel.org/lkml/1558433454-27971-1-git-send-email-claudiu.beznea@microchip.com/
>>
>> Claudiu Beznea (7):
>>   clk: at91: sckc: add support to free slow oscillator
>>   clk: at91: sckc: add support to free slow rc oscillator
>>   clk: at91: sckc: add support to free slow clock osclillator
>>   clk: at91: sckc: improve error path for sam9x5 sck register
>>   clk: at91: sckc: remove unnecessary line
>>   clk: at91: sckc: improve error path for sama5d4 sck registration
>>   clk: at91: sckc: use dedicated functions to unregister clock
>>
>>  drivers/clk/at91/sckc.c | 122 ++++++++++++++++++++++++++++++++++--------------
>>  1 file changed, 86 insertions(+), 36 deletions(-)
>>
>> -- 
>> 2.7.4
>>
> 

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

* Re: [PATCH 0/7] clk: at91: sckc: improve error path
  2019-06-20 10:30   ` Claudiu.Beznea
@ 2019-06-21  9:33     ` Alexandre Belloni
  2019-06-26 18:53       ` Stephen Boyd
  0 siblings, 1 reply; 15+ messages in thread
From: Alexandre Belloni @ 2019-06-21  9:33 UTC (permalink / raw)
  To: Claudiu.Beznea
  Cc: mturquette, sboyd, Nicolas.Ferre, linux-clk, linux-arm-kernel,
	linux-kernel, claudiu.beznea

On 20/06/2019 10:30:42+0000, Claudiu.Beznea@microchip.com wrote:
> Hi,
> 
> On 18.06.2019 12:55, Alexandre Belloni wrote:
> > On 13/06/2019 15:37:06+0000, Claudiu.Beznea@microchip.com wrote:
> >> From: Claudiu Beznea <claudiu.beznea@microchip.com>
> >>
> >> Hi,
> >>
> >> This series tries to improve error path for slow clock registrations
> >> by adding functions to free resources and using them on failures.
> >>
> > 
> > Does the platform even boot when the slow clock is not available? 
> > 
> > The TCB clocksource would fail at:
> > 
> >         tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk");
> >         if (IS_ERR(tc.slow_clk))
> >                 return PTR_ERR(tc.slow_clk);
> > 
> 
> In case of using TC as clocksource, yes, the platform wouldn't boot if slow
> clock is not available, because, anyway the TC needs it. PIT may work
> without it (if slow clock is not used to drive the PIT).
> 
> For sure there are other IPs (which may be or are driven by slow clock)
> which may not work if slow clock is driven them.
> 
> Anyway, please let me know if you feel this series has no meaning.
> 

Well, I'm not sure it is worth it but at the same time, it is not adding
many lines and you already developed it...


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 0/7] clk: at91: sckc: improve error path
  2019-06-21  9:33     ` Alexandre Belloni
@ 2019-06-26 18:53       ` Stephen Boyd
  2019-06-26 19:00         ` Alexandre Belloni
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Boyd @ 2019-06-26 18:53 UTC (permalink / raw)
  To: Alexandre Belloni, Claudiu.Beznea
  Cc: mturquette, Nicolas.Ferre, linux-clk, linux-arm-kernel,
	linux-kernel, claudiu.beznea

Quoting Alexandre Belloni (2019-06-21 02:33:02)
> On 20/06/2019 10:30:42+0000, Claudiu.Beznea@microchip.com wrote:
> > Hi,
> > 
> > On 18.06.2019 12:55, Alexandre Belloni wrote:
> > > On 13/06/2019 15:37:06+0000, Claudiu.Beznea@microchip.com wrote:
> > >> From: Claudiu Beznea <claudiu.beznea@microchip.com>
> > >>
> > >> Hi,
> > >>
> > >> This series tries to improve error path for slow clock registrations
> > >> by adding functions to free resources and using them on failures.
> > >>
> > > 
> > > Does the platform even boot when the slow clock is not available? 
> > > 
> > > The TCB clocksource would fail at:
> > > 
> > >         tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk");
> > >         if (IS_ERR(tc.slow_clk))
> > >                 return PTR_ERR(tc.slow_clk);
> > > 
> > 
> > In case of using TC as clocksource, yes, the platform wouldn't boot if slow
> > clock is not available, because, anyway the TC needs it. PIT may work
> > without it (if slow clock is not used to drive the PIT).
> > 
> > For sure there are other IPs (which may be or are driven by slow clock)
> > which may not work if slow clock is driven them.
> > 
> > Anyway, please let me know if you feel this series has no meaning.
> > 
> 
> Well, I'm not sure it is worth it but at the same time, it is not adding
> many lines and you already developed it...
> 

Is that a Reviewed-by or a Rejected-by tag?


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

* Re: [PATCH 0/7] clk: at91: sckc: improve error path
  2019-06-26 18:53       ` Stephen Boyd
@ 2019-06-26 19:00         ` Alexandre Belloni
  0 siblings, 0 replies; 15+ messages in thread
From: Alexandre Belloni @ 2019-06-26 19:00 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Claudiu.Beznea, mturquette, Nicolas.Ferre, linux-clk,
	linux-arm-kernel, linux-kernel, claudiu.beznea

On 26/06/2019 11:53:59-0700, Stephen Boyd wrote:
> Quoting Alexandre Belloni (2019-06-21 02:33:02)
> > On 20/06/2019 10:30:42+0000, Claudiu.Beznea@microchip.com wrote:
> > > Hi,
> > > 
> > > On 18.06.2019 12:55, Alexandre Belloni wrote:
> > > > On 13/06/2019 15:37:06+0000, Claudiu.Beznea@microchip.com wrote:
> > > >> From: Claudiu Beznea <claudiu.beznea@microchip.com>
> > > >>
> > > >> Hi,
> > > >>
> > > >> This series tries to improve error path for slow clock registrations
> > > >> by adding functions to free resources and using them on failures.
> > > >>
> > > > 
> > > > Does the platform even boot when the slow clock is not available? 
> > > > 
> > > > The TCB clocksource would fail at:
> > > > 
> > > >         tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk");
> > > >         if (IS_ERR(tc.slow_clk))
> > > >                 return PTR_ERR(tc.slow_clk);
> > > > 
> > > 
> > > In case of using TC as clocksource, yes, the platform wouldn't boot if slow
> > > clock is not available, because, anyway the TC needs it. PIT may work
> > > without it (if slow clock is not used to drive the PIT).
> > > 
> > > For sure there are other IPs (which may be or are driven by slow clock)
> > > which may not work if slow clock is driven them.
> > > 
> > > Anyway, please let me know if you feel this series has no meaning.
> > > 
> > 
> > Well, I'm not sure it is worth it but at the same time, it is not adding
> > many lines and you already developed it...
> > 
> 
> Is that a Reviewed-by or a Rejected-by tag?
> 

Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 0/7] clk: at91: sckc: improve error path
  2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
                   ` (7 preceding siblings ...)
  2019-06-18  9:55 ` [PATCH 0/7] clk: at91: sckc: improve error path Alexandre Belloni
@ 2019-06-27 15:03 ` Stephen Boyd
  2019-06-27 15:55   ` Claudiu.Beznea
  8 siblings, 1 reply; 15+ messages in thread
From: Stephen Boyd @ 2019-06-27 15:03 UTC (permalink / raw)
  To: Claudiu.Beznea, Nicolas.Ferre, alexandre.belloni, mturquette
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea,
	Claudiu.Beznea

Quoting Claudiu.Beznea@microchip.com (2019-06-13 08:37:06)
> From: Claudiu Beznea <claudiu.beznea@microchip.com>
> 
> Hi,
> 
> This series tries to improve error path for slow clock registrations
> by adding functions to free resources and using them on failures.

If possible, resend this patch series in plain text. Thanks.


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

* Re: [PATCH 0/7] clk: at91: sckc: improve error path
  2019-06-27 15:03 ` Stephen Boyd
@ 2019-06-27 15:55   ` Claudiu.Beznea
  0 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2019-06-27 15:55 UTC (permalink / raw)
  To: sboyd, Nicolas.Ferre, alexandre.belloni, mturquette
  Cc: linux-clk, linux-arm-kernel, linux-kernel, claudiu.beznea



On 27.06.2019 18:03, Stephen Boyd wrote:
> External E-Mail
> 
> 
> Quoting Claudiu.Beznea@microchip.com (2019-06-13 08:37:06)
>> From: Claudiu Beznea <claudiu.beznea@microchip.com>
>>
>> Hi,
>>
>> This series tries to improve error path for slow clock registrations
>> by adding functions to free resources and using them on failures.
> 
> If possible, resend this patch series in plain text. Thanks.

Done! Thank you!

> 

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

end of thread, other threads:[~2019-06-27 15:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-13 15:37 [PATCH 0/7] clk: at91: sckc: improve error path Claudiu.Beznea
2019-06-13 15:37 ` [PATCH 1/7] clk: at91: sckc: add support to free slow oscillator Claudiu.Beznea
2019-06-13 15:37 ` [PATCH 2/7] clk: at91: sckc: add support to free slow rc oscillator Claudiu.Beznea
2019-06-13 15:37 ` [PATCH 3/7] clk: at91: sckc: add support to free slow clock osclillator Claudiu.Beznea
2019-06-13 15:37 ` [PATCH 4/7] clk: at91: sckc: improve error path for sam9x5 sck register Claudiu.Beznea
2019-06-13 15:37 ` [PATCH 5/7] clk: at91: sckc: remove unnecessary line Claudiu.Beznea
2019-06-13 15:37 ` [PATCH 6/7] clk: at91: sckc: improve error path for sama5d4 sck registration Claudiu.Beznea
2019-06-13 15:37 ` [PATCH 7/7] clk: at91: sckc: use dedicated functions to unregister clock Claudiu.Beznea
2019-06-18  9:55 ` [PATCH 0/7] clk: at91: sckc: improve error path Alexandre Belloni
2019-06-20 10:30   ` Claudiu.Beznea
2019-06-21  9:33     ` Alexandre Belloni
2019-06-26 18:53       ` Stephen Boyd
2019-06-26 19:00         ` Alexandre Belloni
2019-06-27 15:03 ` Stephen Boyd
2019-06-27 15:55   ` Claudiu.Beznea

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).