Skip to contentSkip to conversation

ARM: imx35: don't disable the uart clock when DEBUG_LL is in use

PATCH New Uwe Kleine-König 2 participants 5 messages Jul 31, 2012 – Aug 6, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx35: don't disable the uart clock when DEBUG_LL is in use

Otherwise printch et al. and printk with earlyprintk and keep_bootcon becomes unfunctional when the clk framework disables all unused clocks.

---
 arch/arm/mach-imx/clk-imx35.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/clk-imx35.c +4 -0
index c6422fb..83d614c 100644
@@ -271,6 +271,10 @@ int __init mx35_clocks_init()
 	 */
 	clk_prepare_enable(clk[scc_gate]);
 
+	/* Assert that the UART clock keeps running if DEBUG_LL is in use */
+	if (IS_ENABLED(CONFIG_DEBUG_IMX31_IMX35_UART))
+		clk_prepare_enable(clk[uart1_gate]);
+
 	imx_print_silicon_rev("i.MX35", mx35_revision());
 
 #ifdef CONFIG_MXC_USE_EPIT
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw

PATCH 1/1 ARM: imx35: don't disable the uart clock when DEBUG_LL is in use

Quoted 2 lines · Uwe Kleine-K?nig

Otherwise printch et al. and printk with earlyprintk and keep_bootcon becomes unfunctional when the clk framework disables all unused clocks.

Why don't you use the regular console? Letting the clock framework disable the clocks was pretty much intentional.

Sascha

Quoted 25 lines
---
 arch/arm/mach-imx/clk-imx35.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/clk-imx35.c +4 -0
index c6422fb..83d614c 100644
@@ -271,6 +271,10 @@ int __init mx35_clocks_init()
 	 */
 	clk_prepare_enable(clk[scc_gate]);
 
+	/* Assert that the UART clock keeps running if DEBUG_LL is in use */
+	if (IS_ENABLED(CONFIG_DEBUG_IMX31_IMX35_UART))
+		clk_prepare_enable(clk[uart1_gate]);
+
 	imx_print_silicon_rev("i.MX35", mx35_revision());
 
 #ifdef CONFIG_MXC_USE_EPIT
Signature · 1 line
1.7.10.4
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#2 lore raw

PATCH 1/1 ARM: imx35: don't disable the uart clock when DEBUG_LL is in use

Hello Sascha,

Quoted 6 lines · Sascha Hauer
Quoted 2 lines · Uwe Kleine-K?nig

Otherwise printch et al. and printk with earlyprintk and keep_bootcon becomes unfunctional when the clk framework disables all unused clocks.

Why don't you use the regular console? Letting the clock framework disable the clocks was pretty much intentional.

I don't question that disabling unused clocks is sensible. But usually if you enable DEBUG_LL you want to use it even after the clock framework disabled all (apparently) unused clocks. And in my case the regular console didn't work yet and so I relied on earlyprintk.
Even if the problem proved to be the result of my stupidity this patch asserts that earlyprintk just works as it should be for debug aids.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#3 lore raw

PATCH 1/1 ARM: imx35: don't disable the uart clock when DEBUG_LL is in use

Quoted 7 lines · Uwe Kleine-K?nig

Hello Sascha,

Quoted 4 lines · Sascha Hauer
Quoted 2 lines · Uwe Kleine-K?nig

Otherwise printch et al. and printk with earlyprintk and keep_bootcon becomes unfunctional when the clk framework disables all unused clocks.

Quoted 8 lines
Quoted 2 lines

Why don't you use the regular console? Letting the clock framework disable the clocks was pretty much intentional.

I don't question that disabling unused clocks is sensible. But usually if you enable DEBUG_LL you want to use it even after the clock framework disabled all (apparently) unused clocks. And in my case the regular console didn't work yet and so I relied on earlyprintk.
Even if the problem proved to be the result of my stupidity this patch asserts that earlyprintk just works as it should be for debug aids.

ping

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
maintainer
#4 lore raw

PATCH 1/1 ARM: imx35: don't disable the uart clock when DEBUG_LL is in use

Quoted 10 lines · Uwe Kleine-K?nig
Quoted 9 lines · Uwe Kleine-K?nig

Hello Sascha,

Quoted 6 lines · Sascha Hauer
Quoted 2 lines · Uwe Kleine-K?nig

Otherwise printch et al. and printk with earlyprintk and keep_bootcon becomes unfunctional when the clk framework disables all unused clocks.

Why don't you use the regular console? Letting the clock framework disable the clocks was pretty much intentional.

Quoted 7 lines
Quoted 6 lines

I don't question that disabling unused clocks is sensible. But usually if you enable DEBUG_LL you want to use it even after the clock framework disabled all (apparently) unused clocks. And in my case the regular console didn't work yet and so I relied on earlyprintk.
Even if the problem proved to be the result of my stupidity this patch asserts that earlyprintk just works as it should be for debug aids.

ping

Honestly, I don't think this is a good idea. You fixed one UART on one SoC, so ARRAY_SIZE(i.MX1, i.MX21, i.MX25, i.MX27, i.MX31, i.MX35, i.MX51, i.MX53, i.MX6) * NUM_UARTS remain broken for this usecase. IMO DEBUG_LL is to get some stuff out of an otherwise silent board, nothing more.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |