All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration"
@ 2019-08-15 16:00 Stephen Boyd
  2019-08-15 16:00 ` [PATCH 1/4] clk: milbeaut: Don't reference clk_init_data after registration Stephen Boyd
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Stephen Boyd @ 2019-08-15 16:00 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-clk, linux-rtc, bot, tomeu.vizoso,
	guillaume.tucker, mgalka, broonie, matthew.hart, khilman,
	enric.balletbo, Sylwester Nawrocki, Alessandro Zummo,
	Alexandre Belloni, Chen-Yu Tsai, Jun Nie, Maxime Ripard,
	Shawn Guo, Sugaya Taichi, Taniya Das

I found some more cases where the init structure is referenced from
within the clk_hw struct after clk_registration is called. I suspect the
rtc driver fix is useful to avoid crashes on Allwinner devices, reported
by kernel-ci.

Cc: <bot@kernelci.org>                                                                                                                                      
Cc: <tomeu.vizoso@collabora.com>
Cc: <guillaume.tucker@collabora.com>
Cc: <mgalka@collabora.com>
Cc: <broonie@kernel.org>
Cc: <matthew.hart@linaro.org>
Cc: <khilman@baylibre.com>
Cc: <enric.balletbo@collabora.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>      
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Jun Nie <jun.nie@linaro.org>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sugaya Taichi <sugaya.taichi@socionext.com>
Cc: Taniya Das <tdas@codeaurora.org>

Stephen Boyd (4):
  clk: milbeaut:  Don't reference clk_init_data after registration
  clk: zx296718: Don't reference clk_init_data after registration
  rtc: sun6i: Don't reference clk_init_data after registration
  clk: qcom: Remove error prints from DFS registration

 drivers/clk/clk-milbeaut.c     |   2 +-
 drivers/clk/qcom/clk-rcg2.c    |   8 +--
 drivers/clk/zte/clk-zx296718.c | 109 +++++++++++++++------------------
 drivers/rtc/rtc-sun6i.c        |   2 +-
 4 files changed, 52 insertions(+), 69 deletions(-)

-- 
Sent by a computer through tubes


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

* [PATCH 1/4] clk: milbeaut:  Don't reference clk_init_data after registration
  2019-08-15 16:00 [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Stephen Boyd
@ 2019-08-15 16:00 ` Stephen Boyd
  2019-08-16 17:20   ` Stephen Boyd
  2019-08-15 16:00 ` [PATCH 2/4] clk: zx296718: " Stephen Boyd
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Stephen Boyd @ 2019-08-15 16:00 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk, Sugaya Taichi

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Sugaya Taichi <sugaya.taichi@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/clk-milbeaut.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-milbeaut.c b/drivers/clk/clk-milbeaut.c
index 5fc78faf820c..80b9d78493bc 100644
--- a/drivers/clk/clk-milbeaut.c
+++ b/drivers/clk/clk-milbeaut.c
@@ -437,7 +437,7 @@ static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 		if (readl_poll_timeout(divider->write_valid_reg, val,
 			!val, M10V_UPOLL_RATE, M10V_UTIMEOUT))
 			pr_err("%s:%s couldn't stabilize\n",
-				__func__, divider->hw.init->name);
+				__func__, clk_hw_get_name(hw));
 	}
 
 	if (divider->lock)
-- 
Sent by a computer through tubes


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

* [PATCH 2/4] clk: zx296718: Don't reference clk_init_data after registration
  2019-08-15 16:00 [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Stephen Boyd
  2019-08-15 16:00 ` [PATCH 1/4] clk: milbeaut: Don't reference clk_init_data after registration Stephen Boyd
@ 2019-08-15 16:00 ` Stephen Boyd
  2019-08-16 17:20   ` Stephen Boyd
  2019-08-15 16:00 ` [PATCH 3/4] rtc: sun6i: " Stephen Boyd
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Stephen Boyd @ 2019-08-15 16:00 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-clk, Jun Nie, Shawn Guo

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Jun Nie <jun.nie@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/zte/clk-zx296718.c | 109 +++++++++++++++------------------
 1 file changed, 49 insertions(+), 60 deletions(-)

diff --git a/drivers/clk/zte/clk-zx296718.c b/drivers/clk/zte/clk-zx296718.c
index fd6c347bec6a..dd7045bc48c1 100644
--- a/drivers/clk/zte/clk-zx296718.c
+++ b/drivers/clk/zte/clk-zx296718.c
@@ -564,6 +564,7 @@ static int __init top_clocks_init(struct device_node *np)
 {
 	void __iomem *reg_base;
 	int i, ret;
+	const char *name;
 
 	reg_base = of_iomap(np, 0);
 	if (!reg_base) {
@@ -573,11 +574,10 @@ static int __init top_clocks_init(struct device_node *np)
 
 	for (i = 0; i < ARRAY_SIZE(zx296718_pll_clk); i++) {
 		zx296718_pll_clk[i].reg_base += (uintptr_t)reg_base;
+		name = zx296718_pll_clk[i].hw.init->name;
 		ret = clk_hw_register(NULL, &zx296718_pll_clk[i].hw);
-		if (ret) {
-			pr_warn("top clk %s init error!\n",
-				zx296718_pll_clk[i].hw.init->name);
-		}
+		if (ret)
+			pr_warn("top clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(top_ffactor_clk); i++) {
@@ -585,11 +585,10 @@ static int __init top_clocks_init(struct device_node *np)
 			top_hw_onecell_data.hws[top_ffactor_clk[i].id] =
 					&top_ffactor_clk[i].factor.hw;
 
+		name = top_ffactor_clk[i].factor.hw.init->name;
 		ret = clk_hw_register(NULL, &top_ffactor_clk[i].factor.hw);
-		if (ret) {
-			pr_warn("top clk %s init error!\n",
-				top_ffactor_clk[i].factor.hw.init->name);
-		}
+		if (ret)
+			pr_warn("top clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(top_mux_clk); i++) {
@@ -598,11 +597,10 @@ static int __init top_clocks_init(struct device_node *np)
 					&top_mux_clk[i].mux.hw;
 
 		top_mux_clk[i].mux.reg += (uintptr_t)reg_base;
+		name = top_mux_clk[i].mux.hw.init->name;
 		ret = clk_hw_register(NULL, &top_mux_clk[i].mux.hw);
-		if (ret) {
-			pr_warn("top clk %s init error!\n",
-				top_mux_clk[i].mux.hw.init->name);
-		}
+		if (ret)
+			pr_warn("top clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(top_gate_clk); i++) {
@@ -611,11 +609,10 @@ static int __init top_clocks_init(struct device_node *np)
 					&top_gate_clk[i].gate.hw;
 
 		top_gate_clk[i].gate.reg += (uintptr_t)reg_base;
+		name = top_gate_clk[i].gate.hw.init->name;
 		ret = clk_hw_register(NULL, &top_gate_clk[i].gate.hw);
-		if (ret) {
-			pr_warn("top clk %s init error!\n",
-				top_gate_clk[i].gate.hw.init->name);
-		}
+		if (ret)
+			pr_warn("top clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(top_div_clk); i++) {
@@ -624,11 +621,10 @@ static int __init top_clocks_init(struct device_node *np)
 					&top_div_clk[i].div.hw;
 
 		top_div_clk[i].div.reg += (uintptr_t)reg_base;
+		name = top_div_clk[i].div.hw.init->name;
 		ret = clk_hw_register(NULL, &top_div_clk[i].div.hw);
-		if (ret) {
-			pr_warn("top clk %s init error!\n",
-				top_div_clk[i].div.hw.init->name);
-		}
+		if (ret)
+			pr_warn("top clk %s init error!\n", name);
 	}
 
 	ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get,
@@ -754,6 +750,7 @@ static int __init lsp0_clocks_init(struct device_node *np)
 {
 	void __iomem *reg_base;
 	int i, ret;
+	const char *name;
 
 	reg_base = of_iomap(np, 0);
 	if (!reg_base) {
@@ -767,11 +764,10 @@ static int __init lsp0_clocks_init(struct device_node *np)
 					&lsp0_mux_clk[i].mux.hw;
 
 		lsp0_mux_clk[i].mux.reg += (uintptr_t)reg_base;
+		name = lsp0_mux_clk[i].mux.hw.init->name;
 		ret = clk_hw_register(NULL, &lsp0_mux_clk[i].mux.hw);
-		if (ret) {
-			pr_warn("lsp0 clk %s init error!\n",
-				lsp0_mux_clk[i].mux.hw.init->name);
-		}
+		if (ret)
+			pr_warn("lsp0 clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(lsp0_gate_clk); i++) {
@@ -780,11 +776,10 @@ static int __init lsp0_clocks_init(struct device_node *np)
 					&lsp0_gate_clk[i].gate.hw;
 
 		lsp0_gate_clk[i].gate.reg += (uintptr_t)reg_base;
+		name = lsp0_gate_clk[i].gate.hw.init->name;
 		ret = clk_hw_register(NULL, &lsp0_gate_clk[i].gate.hw);
-		if (ret) {
-			pr_warn("lsp0 clk %s init error!\n",
-				lsp0_gate_clk[i].gate.hw.init->name);
-		}
+		if (ret)
+			pr_warn("lsp0 clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(lsp0_div_clk); i++) {
@@ -793,11 +788,10 @@ static int __init lsp0_clocks_init(struct device_node *np)
 					&lsp0_div_clk[i].div.hw;
 
 		lsp0_div_clk[i].div.reg += (uintptr_t)reg_base;
+		name = lsp0_div_clk[i].div.hw.init->name;
 		ret = clk_hw_register(NULL, &lsp0_div_clk[i].div.hw);
-		if (ret) {
-			pr_warn("lsp0 clk %s init error!\n",
-				lsp0_div_clk[i].div.hw.init->name);
-		}
+		if (ret)
+			pr_warn("lsp0 clk %s init error!\n", name);
 	}
 
 	ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get,
@@ -862,6 +856,7 @@ static int __init lsp1_clocks_init(struct device_node *np)
 {
 	void __iomem *reg_base;
 	int i, ret;
+	const char *name;
 
 	reg_base = of_iomap(np, 0);
 	if (!reg_base) {
@@ -875,11 +870,10 @@ static int __init lsp1_clocks_init(struct device_node *np)
 					&lsp0_mux_clk[i].mux.hw;
 
 		lsp1_mux_clk[i].mux.reg += (uintptr_t)reg_base;
+		name = lsp1_mux_clk[i].mux.hw.init->name;
 		ret = clk_hw_register(NULL, &lsp1_mux_clk[i].mux.hw);
-		if (ret) {
-			pr_warn("lsp1 clk %s init error!\n",
-				lsp1_mux_clk[i].mux.hw.init->name);
-		}
+		if (ret)
+			pr_warn("lsp1 clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(lsp1_gate_clk); i++) {
@@ -888,11 +882,10 @@ static int __init lsp1_clocks_init(struct device_node *np)
 					&lsp1_gate_clk[i].gate.hw;
 
 		lsp1_gate_clk[i].gate.reg += (uintptr_t)reg_base;
+		name = lsp1_gate_clk[i].gate.hw.init->name;
 		ret = clk_hw_register(NULL, &lsp1_gate_clk[i].gate.hw);
-		if (ret) {
-			pr_warn("lsp1 clk %s init error!\n",
-				lsp1_gate_clk[i].gate.hw.init->name);
-		}
+		if (ret)
+			pr_warn("lsp1 clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(lsp1_div_clk); i++) {
@@ -901,11 +894,10 @@ static int __init lsp1_clocks_init(struct device_node *np)
 					&lsp1_div_clk[i].div.hw;
 
 		lsp1_div_clk[i].div.reg += (uintptr_t)reg_base;
+		name = lsp1_div_clk[i].div.hw.init->name;
 		ret = clk_hw_register(NULL, &lsp1_div_clk[i].div.hw);
-		if (ret) {
-			pr_warn("lsp1 clk %s init error!\n",
-				lsp1_div_clk[i].div.hw.init->name);
-		}
+		if (ret)
+			pr_warn("lsp1 clk %s init error!\n", name);
 	}
 
 	ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get,
@@ -979,6 +971,7 @@ static int __init audio_clocks_init(struct device_node *np)
 {
 	void __iomem *reg_base;
 	int i, ret;
+	const char *name;
 
 	reg_base = of_iomap(np, 0);
 	if (!reg_base) {
@@ -992,11 +985,10 @@ static int __init audio_clocks_init(struct device_node *np)
 					&audio_mux_clk[i].mux.hw;
 
 		audio_mux_clk[i].mux.reg += (uintptr_t)reg_base;
+		name = audio_mux_clk[i].mux.hw.init->name;
 		ret = clk_hw_register(NULL, &audio_mux_clk[i].mux.hw);
-		if (ret) {
-			pr_warn("audio clk %s init error!\n",
-				audio_mux_clk[i].mux.hw.init->name);
-		}
+		if (ret)
+			pr_warn("audio clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(audio_adiv_clk); i++) {
@@ -1005,11 +997,10 @@ static int __init audio_clocks_init(struct device_node *np)
 					&audio_adiv_clk[i].hw;
 
 		audio_adiv_clk[i].reg_base += (uintptr_t)reg_base;
+		name = audio_adiv_clk[i].hw.init->name;
 		ret = clk_hw_register(NULL, &audio_adiv_clk[i].hw);
-		if (ret) {
-			pr_warn("audio clk %s init error!\n",
-				audio_adiv_clk[i].hw.init->name);
-		}
+		if (ret)
+			pr_warn("audio clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(audio_div_clk); i++) {
@@ -1018,11 +1009,10 @@ static int __init audio_clocks_init(struct device_node *np)
 					&audio_div_clk[i].div.hw;
 
 		audio_div_clk[i].div.reg += (uintptr_t)reg_base;
+		name = audio_div_clk[i].div.hw.init->name;
 		ret = clk_hw_register(NULL, &audio_div_clk[i].div.hw);
-		if (ret) {
-			pr_warn("audio clk %s init error!\n",
-				audio_div_clk[i].div.hw.init->name);
-		}
+		if (ret)
+			pr_warn("audio clk %s init error!\n", name);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(audio_gate_clk); i++) {
@@ -1031,11 +1021,10 @@ static int __init audio_clocks_init(struct device_node *np)
 					&audio_gate_clk[i].gate.hw;
 
 		audio_gate_clk[i].gate.reg += (uintptr_t)reg_base;
+		name = audio_gate_clk[i].gate.hw.init->name;
 		ret = clk_hw_register(NULL, &audio_gate_clk[i].gate.hw);
-		if (ret) {
-			pr_warn("audio clk %s init error!\n",
-				audio_gate_clk[i].gate.hw.init->name);
-		}
+		if (ret)
+			pr_warn("audio clk %s init error!\n", name);
 	}
 
 	ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get,
-- 
Sent by a computer through tubes


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

* [PATCH 3/4] rtc: sun6i: Don't reference clk_init_data after registration
  2019-08-15 16:00 [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Stephen Boyd
  2019-08-15 16:00 ` [PATCH 1/4] clk: milbeaut: Don't reference clk_init_data after registration Stephen Boyd
  2019-08-15 16:00 ` [PATCH 2/4] clk: zx296718: " Stephen Boyd
@ 2019-08-15 16:00 ` Stephen Boyd
  2019-08-15 16:11   ` Chen-Yu Tsai
                     ` (3 more replies)
  2019-08-15 16:00 ` [PATCH 4/4] clk: qcom: Remove error prints from DFS registration Stephen Boyd
  2019-08-19  7:02 ` [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Guillaume Tucker
  4 siblings, 4 replies; 14+ messages in thread
From: Stephen Boyd @ 2019-08-15 16:00 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-clk, linux-rtc, Alessandro Zummo,
	Alexandre Belloni, Maxime Ripard, Chen-Yu Tsai

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---

Please ack so I can take this through clk tree.

 drivers/rtc/rtc-sun6i.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index c0e75c373605..d50ee023b559 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -279,7 +279,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node,
 
 	of_property_read_string_index(node, "clock-output-names", 1,
 				      &clkout_name);
-	rtc->ext_losc = clk_register_gate(NULL, clkout_name, rtc->hw.init->name,
+	rtc->ext_losc = clk_register_gate(NULL, clkout_name, init.name,
 					  0, rtc->base + SUN6I_LOSC_OUT_GATING,
 					  SUN6I_LOSC_OUT_GATING_EN_OFFSET, 0,
 					  &rtc->lock);
-- 
Sent by a computer through tubes


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

* [PATCH 4/4] clk: qcom: Remove error prints from DFS registration
  2019-08-15 16:00 [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Stephen Boyd
                   ` (2 preceding siblings ...)
  2019-08-15 16:00 ` [PATCH 3/4] rtc: sun6i: " Stephen Boyd
@ 2019-08-15 16:00 ` Stephen Boyd
  2019-08-16  2:48   ` Taniya Das
  2019-08-16 17:20   ` Stephen Boyd
  2019-08-19  7:02 ` [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Guillaume Tucker
  4 siblings, 2 replies; 14+ messages in thread
From: Stephen Boyd @ 2019-08-15 16:00 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk, Taniya Das

These aren't useful and they reference the init structure name. Let's
just drop them.

Cc: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/qcom/clk-rcg2.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
index 8c02bffe50df..161a6498ed5a 100644
--- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c
@@ -1105,8 +1105,6 @@ static int clk_rcg2_enable_dfs(const struct clk_rcg_dfs_data *data,
 
 	rcg->freq_tbl = NULL;
 
-	pr_debug("DFS registered for clk %s\n", init->name);
-
 	return 0;
 }
 
@@ -1117,12 +1115,8 @@ int qcom_cc_register_rcg_dfs(struct regmap *regmap,
 
 	for (i = 0; i < len; i++) {
 		ret = clk_rcg2_enable_dfs(&rcgs[i], regmap);
-		if (ret) {
-			const char *name = rcgs[i].init->name;
-
-			pr_err("DFS register failed for clk %s\n", name);
+		if (ret)
 			return ret;
-		}
 	}
 
 	return 0;
-- 
Sent by a computer through tubes


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

* Re: [PATCH 3/4] rtc: sun6i: Don't reference clk_init_data after registration
  2019-08-15 16:00 ` [PATCH 3/4] rtc: sun6i: " Stephen Boyd
@ 2019-08-15 16:11   ` Chen-Yu Tsai
  2019-08-15 21:59   ` Stephen Boyd
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Chen-Yu Tsai @ 2019-08-15 16:11 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Michael Turquette, linux-kernel, linux-clk, linux-rtc,
	Alessandro Zummo, Alexandre Belloni, Maxime Ripard

On Fri, Aug 16, 2019 at 12:00 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> A future patch is going to change semantics of clk_register() so that
> clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
> referencing this member here so that we don't run into NULL pointer
> exceptions.
>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>

Acked-by: Chen-Yu Tsai <wens@csie.org>

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

* Re: [PATCH 3/4] rtc: sun6i: Don't reference clk_init_data after registration
  2019-08-15 16:00 ` [PATCH 3/4] rtc: sun6i: " Stephen Boyd
  2019-08-15 16:11   ` Chen-Yu Tsai
@ 2019-08-15 21:59   ` Stephen Boyd
  2019-08-16 14:50   ` Alexandre Belloni
  2019-08-16 17:20   ` Stephen Boyd
  3 siblings, 0 replies; 14+ messages in thread
From: Stephen Boyd @ 2019-08-15 21:59 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-clk, linux-rtc, Alessandro Zummo,
	Alexandre Belloni, Maxime Ripard, Chen-Yu Tsai

Quoting Stephen Boyd (2019-08-15 09:00:19)
> A future patch is going to change semantics of clk_register() so that
> clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
> referencing this member here so that we don't run into NULL pointer
> exceptions.
> 
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---
> 

Looks like this fixed the sunxi boot crashes in -next. I'll add a tag
for kernelci credit.


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

* Re: [PATCH 4/4] clk: qcom: Remove error prints from DFS registration
  2019-08-15 16:00 ` [PATCH 4/4] clk: qcom: Remove error prints from DFS registration Stephen Boyd
@ 2019-08-16  2:48   ` Taniya Das
  2019-08-16 17:20   ` Stephen Boyd
  1 sibling, 0 replies; 14+ messages in thread
From: Taniya Das @ 2019-08-16  2:48 UTC (permalink / raw)
  To: Stephen Boyd, Michael Turquette; +Cc: linux-kernel, linux-clk



On 8/15/2019 9:30 PM, Stephen Boyd wrote:
> These aren't useful and they reference the init structure name. Let's
> just drop them.
> 
> Cc: Taniya Das <tdas@codeaurora.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Acked-by: Taniya Das <tdas@codeaurora.org>


-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation.

--

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

* Re: [PATCH 3/4] rtc: sun6i: Don't reference clk_init_data after registration
  2019-08-15 16:00 ` [PATCH 3/4] rtc: sun6i: " Stephen Boyd
  2019-08-15 16:11   ` Chen-Yu Tsai
  2019-08-15 21:59   ` Stephen Boyd
@ 2019-08-16 14:50   ` Alexandre Belloni
  2019-08-16 17:20   ` Stephen Boyd
  3 siblings, 0 replies; 14+ messages in thread
From: Alexandre Belloni @ 2019-08-16 14:50 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Michael Turquette, linux-kernel, linux-clk, linux-rtc,
	Alessandro Zummo, Maxime Ripard, Chen-Yu Tsai

On 15/08/2019 09:00:19-0700, Stephen Boyd wrote:
> A future patch is going to change semantics of clk_register() so that
> clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
> referencing this member here so that we don't run into NULL pointer
> exceptions.
> 
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
> 
> Please ack so I can take this through clk tree.
> 
>  drivers/rtc/rtc-sun6i.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
> index c0e75c373605..d50ee023b559 100644
> --- a/drivers/rtc/rtc-sun6i.c
> +++ b/drivers/rtc/rtc-sun6i.c
> @@ -279,7 +279,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node,
>  
>  	of_property_read_string_index(node, "clock-output-names", 1,
>  				      &clkout_name);
> -	rtc->ext_losc = clk_register_gate(NULL, clkout_name, rtc->hw.init->name,
> +	rtc->ext_losc = clk_register_gate(NULL, clkout_name, init.name,
>  					  0, rtc->base + SUN6I_LOSC_OUT_GATING,
>  					  SUN6I_LOSC_OUT_GATING_EN_OFFSET, 0,
>  					  &rtc->lock);
> -- 
> Sent by a computer through tubes
> 

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

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

* Re: [PATCH 1/4] clk: milbeaut:  Don't reference clk_init_data after registration
  2019-08-15 16:00 ` [PATCH 1/4] clk: milbeaut: Don't reference clk_init_data after registration Stephen Boyd
@ 2019-08-16 17:20   ` Stephen Boyd
  0 siblings, 0 replies; 14+ messages in thread
From: Stephen Boyd @ 2019-08-16 17:20 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk, Sugaya Taichi

Quoting Stephen Boyd (2019-08-15 09:00:17)
> A future patch is going to change semantics of clk_register() so that
> clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
> referencing this member here so that we don't run into NULL pointer
> exceptions.
> 
> Cc: Sugaya Taichi <sugaya.taichi@socionext.com>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next


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

* Re: [PATCH 2/4] clk: zx296718: Don't reference clk_init_data after registration
  2019-08-15 16:00 ` [PATCH 2/4] clk: zx296718: " Stephen Boyd
@ 2019-08-16 17:20   ` Stephen Boyd
  0 siblings, 0 replies; 14+ messages in thread
From: Stephen Boyd @ 2019-08-16 17:20 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-clk, Jun Nie, Shawn Guo

Quoting Stephen Boyd (2019-08-15 09:00:18)
> A future patch is going to change semantics of clk_register() so that
> clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
> referencing this member here so that we don't run into NULL pointer
> exceptions.
> 
> Cc: Jun Nie <jun.nie@linaro.org>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next


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

* Re: [PATCH 3/4] rtc: sun6i: Don't reference clk_init_data after registration
  2019-08-15 16:00 ` [PATCH 3/4] rtc: sun6i: " Stephen Boyd
                     ` (2 preceding siblings ...)
  2019-08-16 14:50   ` Alexandre Belloni
@ 2019-08-16 17:20   ` Stephen Boyd
  3 siblings, 0 replies; 14+ messages in thread
From: Stephen Boyd @ 2019-08-16 17:20 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-clk, linux-rtc, Alessandro Zummo,
	Alexandre Belloni, Maxime Ripard, Chen-Yu Tsai

Quoting Stephen Boyd (2019-08-15 09:00:19)
> A future patch is going to change semantics of clk_register() so that
> clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
> referencing this member here so that we don't run into NULL pointer
> exceptions.
> 
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next


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

* Re: [PATCH 4/4] clk: qcom: Remove error prints from DFS registration
  2019-08-15 16:00 ` [PATCH 4/4] clk: qcom: Remove error prints from DFS registration Stephen Boyd
  2019-08-16  2:48   ` Taniya Das
@ 2019-08-16 17:20   ` Stephen Boyd
  1 sibling, 0 replies; 14+ messages in thread
From: Stephen Boyd @ 2019-08-16 17:20 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk, Taniya Das

Quoting Stephen Boyd (2019-08-15 09:00:20)
> These aren't useful and they reference the init structure name. Let's
> just drop them.
> 
> Cc: Taniya Das <tdas@codeaurora.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next


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

* Re: [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration"
  2019-08-15 16:00 [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Stephen Boyd
                   ` (3 preceding siblings ...)
  2019-08-15 16:00 ` [PATCH 4/4] clk: qcom: Remove error prints from DFS registration Stephen Boyd
@ 2019-08-19  7:02 ` Guillaume Tucker
  4 siblings, 0 replies; 14+ messages in thread
From: Guillaume Tucker @ 2019-08-19  7:02 UTC (permalink / raw)
  To: Stephen Boyd, Michael Turquette
  Cc: linux-kernel, linux-clk, linux-rtc, bot, tomeu.vizoso, mgalka,
	broonie, matthew.hart, khilman, enric.balletbo,
	Sylwester Nawrocki, Alessandro Zummo, Alexandre Belloni,
	Chen-Yu Tsai, Jun Nie, Maxime Ripard, Shawn Guo, Sugaya Taichi,
	Taniya Das

On 15/08/2019 17:00, Stephen Boyd wrote:
> I found some more cases where the init structure is referenced from
> within the clk_hw struct after clk_registration is called. I suspect the
> rtc driver fix is useful to avoid crashes on Allwinner devices, reported
> by kernel-ci.

Please feel free to add this trailer where appropriate:

  Reported-by: "kernelci.org bot" <bot@kernelci.org>


Thanks,
Guillaume

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

end of thread, other threads:[~2019-08-19  7:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 16:00 [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Stephen Boyd
2019-08-15 16:00 ` [PATCH 1/4] clk: milbeaut: Don't reference clk_init_data after registration Stephen Boyd
2019-08-16 17:20   ` Stephen Boyd
2019-08-15 16:00 ` [PATCH 2/4] clk: zx296718: " Stephen Boyd
2019-08-16 17:20   ` Stephen Boyd
2019-08-15 16:00 ` [PATCH 3/4] rtc: sun6i: " Stephen Boyd
2019-08-15 16:11   ` Chen-Yu Tsai
2019-08-15 21:59   ` Stephen Boyd
2019-08-16 14:50   ` Alexandre Belloni
2019-08-16 17:20   ` Stephen Boyd
2019-08-15 16:00 ` [PATCH 4/4] clk: qcom: Remove error prints from DFS registration Stephen Boyd
2019-08-16  2:48   ` Taniya Das
2019-08-16 17:20   ` Stephen Boyd
2019-08-19  7:02 ` [PATCH 0/4] Followup to "Make clk_hw::init NULL after clk registration" Guillaume Tucker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.