Skip to contentSkip to conversation

clk: rockchip: add critical clock for rk3368

PATCH New Heiko Stübner 3 participants 6 messages Sep 13, 2015 – Sep 14, 2015

Subsystems (2)
lore
Share & tools
lore

Heiko Stübner

author maintainer
#0 lore raw

PATCH 1/1 clk: rockchip: add critical clock for rk3368

Again a result of the gpio-clock-liberation the rk3368 needs the pclk_pd_pmu marked as critical, to boot successfully.

---
should go on top of clk-fixes. Sorry only finding these piece by piece :-) .

 drivers/clk/rockchip/clk-rk3368.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/clk/rockchip/clk-rk3368.c +6 -0
index 9c5d61e..7e6b783 100644
@@ -818,6 +818,10 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
 	GATE(0, "sclk_timer00", "xin24m", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(24), 0, GFLAGS),
 };
 
+static const char *const rk3368_critical_clocks[] __initconst = {
+	"pclk_pd_pmu",
+};
+
 static void __init rk3368_clk_init(struct device_node *np)
 {
 	void __iomem *reg_base;
@@ -862,6 +866,8 @@ static void __init rk3368_clk_init(struct device_node *np)
 				   RK3368_GRF_SOC_STATUS0);
 	rockchip_clk_register_branches(rk3368_clk_branches,
 				  ARRAY_SIZE(rk3368_clk_branches));
+	rockchip_clk_protect_critical(rk3368_critical_clocks,
+				      ARRAY_SIZE(rk3368_critical_clocks));
 
 	rockchip_clk_register_armclk(ARMCLKB, "armclkb",
 			mux_armclkb_p, ARRAY_SIZE(mux_armclkb_p),
Signature · 1 line
2.5.1
#1 lore raw

PATCH 1/1 clk: rockchip: add critical clock for rk3368

Quoted 5 lines · Heiko St?bner

Again a result of the gpio-clock-liberation the rk3368 needs the pclk_pd_pmu marked as critical, to boot successfully.

FWIW: Tested-by: Mark Rutland <[email protected]>

I'm surprised that we don't describe these as critical in the DT, given that this isn't really an internal property of the clock controller, but rather what happens to be attached to it. That ship appears to have sailed, however.

Thanks,
Mark.

Quoted 35 lines

---
should go on top of clk-fixes. Sorry only finding these piece by piece :-) .

 drivers/clk/rockchip/clk-rk3368.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/clk/rockchip/clk-rk3368.c +6 -0
index 9c5d61e..7e6b783 100644
@@ -818,6 +818,10 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
 	GATE(0, "sclk_timer00", "xin24m", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(24), 0, GFLAGS),
 };
 
+static const char *const rk3368_critical_clocks[] __initconst = {
+	"pclk_pd_pmu",
+};
+
 static void __init rk3368_clk_init(struct device_node *np)
 {
 	void __iomem *reg_base;
@@ -862,6 +866,8 @@ static void __init rk3368_clk_init(struct device_node *np)
 				   RK3368_GRF_SOC_STATUS0);
 	rockchip_clk_register_branches(rk3368_clk_branches,
 				  ARRAY_SIZE(rk3368_clk_branches));
+	rockchip_clk_protect_critical(rk3368_critical_clocks,
+				      ARRAY_SIZE(rk3368_critical_clocks));
 
 	rockchip_clk_register_armclk(ARMCLKB, "armclkb",
 			mux_armclkb_p, ARRAY_SIZE(mux_armclkb_p),
Signature · 1 line
2.5.1
author maintainer
#2 lore raw

PATCH 1/1 clk: rockchip: add critical clock for rk3368

Am Montag, 14. September 2015, 15:19:21 schrieb Mark Rutland:

Quoted 7 lines · Heiko St?bner
Quoted 5 lines

Again a result of the gpio-clock-liberation the rk3368 needs the pclk_pd_pmu marked as critical, to boot successfully.

Quoted 6 lines

FWIW: Tested-by: Mark Rutland <[email protected]>

I'm surprised that we don't describe these as critical in the DT, given that this isn't really an internal property of the clock controller, but rather what happens to be attached to it. That ship appears to have sailed, however.

I wouldn't necessarily think so ... what is called critical only means "don't turn off when walking the clock-tree upwards".

The pclk_pd_pmu for example simply supplies some more clocks we don't handle at all currently (pclk_pmu_noc, ...). That we currently choose to ignore those [because we don't have any code nor dt-bindings to handle the components supplied] sounds very much like an implementation-specific detail, not something about the hardware.

I really like the concept of critical clock handling Mike is working on, which implements some sort of hand-off and keeps so marked clocks on until a real components picks them up.

#3 lore raw

PATCH 1/1 clk: rockchip: add critical clock for rk3368

Quoted 15 lines · Heiko St?bner

Am Montag, 14. September 2015, 15:19:21 schrieb Mark Rutland:

Quoted 7 lines · Heiko St?bner
Quoted 5 lines

Again a result of the gpio-clock-liberation the rk3368 needs the pclk_pd_pmu marked as critical, to boot successfully.

Quoted 6 lines

FWIW: Tested-by: Mark Rutland <[email protected]>

I'm surprised that we don't describe these as critical in the DT, given that this isn't really an internal property of the clock controller, but rather what happens to be attached to it. That ship appears to have sailed, however.

Quoted 8 lines

I wouldn't necessarily think so ... what is called critical only means "don't turn off when walking the clock-tree upwards".

The pclk_pd_pmu for example simply supplies some more clocks we don't handle at all currently (pclk_pmu_noc, ...). That we currently choose to ignore those [because we don't have any code nor dt-bindings to handle the components supplied] sounds very much like an implementation-specific detail, not something about the hardware.

Sure, but the specific case that lead to this report was the fact that this clock (directly?) feeds the pinctrl programming interface, and that fact is neither described in the DT nor handled by the driver. Surely that should be described and handled?

Thanks,
Mark.

author maintainer
#4 lore raw

PATCH 1/1 clk: rockchip: add critical clock for rk3368

Am Montag, 14. September 2015, 16:19:42 schrieb Mark Rutland:

Quoted 25 lines · Heiko St?bner
Quoted 15 lines

Am Montag, 14. September 2015, 15:19:21 schrieb Mark Rutland:

Quoted 7 lines · Heiko St?bner
Quoted 5 lines

Again a result of the gpio-clock-liberation the rk3368 needs the pclk_pd_pmu marked as critical, to boot successfully.

Quoted 6 lines

FWIW: Tested-by: Mark Rutland <[email protected]>

I'm surprised that we don't describe these as critical in the DT, given that this isn't really an internal property of the clock controller, but rather what happens to be attached to it. That ship appears to have sailed, however.

Quoted 8 lines

I wouldn't necessarily think so ... what is called critical only means "don't turn off when walking the clock-tree upwards".

The pclk_pd_pmu for example simply supplies some more clocks we don't handle at all currently (pclk_pmu_noc, ...). That we currently choose to ignore those [because we don't have any code nor dt-bindings to handle the components supplied] sounds very much like an implementation-specific detail, not something about the hardware.

Quoted 4 lines

Sure, but the specific case that lead to this report was the fact that this clock (directly?) feeds the pinctrl programming interface, and that fact is neither described in the DT nor handled by the driver. Surely that should be described and handled?

nope it doesn't :-) pclk_pd_pmu feeds pclk_gpio0.

Before the pinctrl patch, pclk_gpio0 was just statically on all the time, now it gets turned off when bank0 is not in use (between reads/writes and if no interrupts are enabled). This in turn makes the clock framework turn off pclk_pd_pmu (and thus its other unhandled child-clocks).

Applied
#5 lore raw

PATCH 1/1 clk: rockchip: add critical clock for rk3368

In reply to Heiko Stübner
Quoted 6 lines · Heiko St?bner

Again a result of the gpio-clock-liberation the rk3368 needs the pclk_pd_pmu marked as critical, to boot successfully.

---

Applied to clk-fixes

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project