linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] clk: bcm2835: mark enabled pll_dividers as critical
@ 2016-04-26  8:56 kernel at martin.sperl.org
  2016-04-26 19:31 ` Eric Anholt
  0 siblings, 1 reply; 6+ messages in thread
From: kernel at martin.sperl.org @ 2016-04-26  8:56 UTC (permalink / raw)
  To: linux-arm-kernel

From: Martin Sperl <kernel@martin.sperl.org>

The bcm2835 firmware enables several clocks and plls before
booting the linux kernel.

These plls should never get disabled as it may result in a
stopped system clock and more.

So during probing we check if the pll_divider is enabled
and if it is then mark that pll_divider as critical.
As a consequence this will also enable the corresponding parent pll.

Here the list of pll_div that are marked as critical:
[    2.022437] bcm2835-clk 20101000.cprman: found enabled pll_div plla_core - marking it as critical
[    2.031640] bcm2835-clk 20101000.cprman: found enabled pll_div pllb_arm - marking it as critical
[    2.040966] bcm2835-clk 20101000.cprman: found enabled pll_div pllc_core0 - marking it as critical
[    2.050351] bcm2835-clk 20101000.cprman: found enabled pll_div pllc_per - marking it as critical
[    2.059427] bcm2835-clk 20101000.cprman: found enabled pll_div plld_core - marking it as critical
[    2.068590] bcm2835-clk 20101000.cprman: found enabled pll_div plld_per - marking it as critical
[    2.077724] bcm2835-clk 20101000.cprman: found enabled pll_div pllh_pix - marking it as critical

Changelog:
  V1 -> V2: apply to pll_dividers instead of clocks
            use CLK_IS_CRITICAL flag instead of prepare/enable manually

Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
---
 drivers/clk/bcm/clk-bcm2835.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index 6479283c..7f6838f 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -1086,6 +1086,15 @@ bcm2835_register_pll_divider(struct bcm2835_cprman *cprman,
 	divider->cprman = cprman;
 	divider->data = data;
 
+	/* if the pll-divider is running, then mark is as critical */
+	if ((cprman_read(cprman, data->a2w_reg) &
+	     A2W_PLL_CHANNEL_DISABLE) == 0) {
+		dev_info(cprman->dev,
+			 "found enabled pll_div %s - marking it as critical\n",
+			 data->name);
+		init.flags |= CLK_IS_CRITICAL;
+	}
+
 	clk = devm_clk_register(cprman->dev, &divider->div.hw);
 	if (IS_ERR(clk))
 		return clk;
-- 
2.1.4

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

end of thread, other threads:[~2016-04-27 14:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26  8:56 [PATCH V2] clk: bcm2835: mark enabled pll_dividers as critical kernel at martin.sperl.org
2016-04-26 19:31 ` Eric Anholt
2016-04-26 21:07   ` Martin Sperl
2016-04-27  1:30     ` Eric Anholt
2016-04-27  5:31       ` Martin Sperl
2016-04-27 14:55         ` Martin Sperl

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