linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: sram: fix BUG in dpll code for !PM case
@ 2012-04-06 21:53 Grazvydas Ignotas
  2012-04-09 22:49 ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Grazvydas Ignotas @ 2012-04-06 21:53 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Tony Lindgren, Grazvydas Ignotas

_omap3_sram_configure_core_dpll is called when SDRC is reprogrammed,
which is done regardless of CONFIG_PM setting, so we always need it's
setup code too. Without this, we hit a BUG() on OMAP3 when kernel is
built without CONFIG_PM:

Reprogramming SDRC clock to 332000000 Hz
------------[ cut here ]------------
kernel BUG at arch/arm/plat-omap/sram.c:342!
Internal error: Oops - BUG: 0 [#1] ARM
...
[<c001c694>] (omap3_configure_core_dpll+0x68/0x6c) from [<c001b2dc>] (omap3_core_dpll_m2_set_rate+0x1)
[<c001b2dc>] (omap3_core_dpll_m2_set_rate+0x138/0x1b0) from [<c001a478>] (omap2_clk_set_rate+0x14/0x2)
[<c001a478>] (omap2_clk_set_rate+0x14/0x20) from [<c001c9dc>] (clk_set_rate+0x54/0x74)
[<c001c9dc>] (clk_set_rate+0x54/0x74) from [<c022b9c8>] (omap_sdrc_init+0x70/0x90)
[<c022b9c8>] (omap_sdrc_init+0x70/0x90) from [<c022f178>] (omap3pandora_init+0x11c/0x164)
[<c022f178>] (omap3pandora_init+0x11c/0x164) from [<c022849c>] (customize_machine+0x20/0x28)
[<c022849c>] (customize_machine+0x20/0x28) from [<c0225810>] (do_one_initcall+0xa0/0x16c)
[<c0225810>] (do_one_initcall+0xa0/0x16c) from [<c02259e0>] (kernel_init+0x104/0x1ac)
[<c02259e0>] (kernel_init+0x104/0x1ac) from [<c0009cec>] (kernel_thread_exit+0x0/0x8)

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
 arch/arm/plat-omap/sram.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index eec98af..f9a8c53 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -348,7 +348,6 @@ u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc,
 			sdrc_actim_ctrl_b_1, sdrc_mr_1);
 }
 
-#ifdef CONFIG_PM
 void omap3_sram_restore_context(void)
 {
 	omap_sram_ceil = omap_sram_base + omap_sram_size;
@@ -358,17 +357,18 @@ void omap3_sram_restore_context(void)
 			       omap3_sram_configure_core_dpll_sz);
 	omap_push_sram_idle();
 }
-#endif /* CONFIG_PM */
-
-#endif /* CONFIG_ARCH_OMAP3 */
 
 static inline int omap34xx_sram_init(void)
 {
-#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
 	omap3_sram_restore_context();
-#endif
 	return 0;
 }
+#else
+static inline int omap34xx_sram_init(void)
+{
+	return 0;
+}
+#endif /* CONFIG_ARCH_OMAP3 */
 
 static inline int am33xx_sram_init(void)
 {
-- 
1.7.0.4


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

* Re: [PATCH] ARM: OMAP: sram: fix BUG in dpll code for !PM case
  2012-04-06 21:53 [PATCH] ARM: OMAP: sram: fix BUG in dpll code for !PM case Grazvydas Ignotas
@ 2012-04-09 22:49 ` Tony Lindgren
  2012-04-17 17:22   ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2012-04-09 22:49 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap, linux-arm-kernel

* Grazvydas Ignotas <notasas@gmail.com> [120406 14:56]:
> _omap3_sram_configure_core_dpll is called when SDRC is reprogrammed,
> which is done regardless of CONFIG_PM setting, so we always need it's
> setup code too. Without this, we hit a BUG() on OMAP3 when kernel is
> built without CONFIG_PM:
> 
> Reprogramming SDRC clock to 332000000 Hz
> ------------[ cut here ]------------
> kernel BUG at arch/arm/plat-omap/sram.c:342!
> Internal error: Oops - BUG: 0 [#1] ARM
> ...
> [<c001c694>] (omap3_configure_core_dpll+0x68/0x6c) from [<c001b2dc>] (omap3_core_dpll_m2_set_rate+0x1)
> [<c001b2dc>] (omap3_core_dpll_m2_set_rate+0x138/0x1b0) from [<c001a478>] (omap2_clk_set_rate+0x14/0x2)
> [<c001a478>] (omap2_clk_set_rate+0x14/0x20) from [<c001c9dc>] (clk_set_rate+0x54/0x74)
> [<c001c9dc>] (clk_set_rate+0x54/0x74) from [<c022b9c8>] (omap_sdrc_init+0x70/0x90)
> [<c022b9c8>] (omap_sdrc_init+0x70/0x90) from [<c022f178>] (omap3pandora_init+0x11c/0x164)
> [<c022f178>] (omap3pandora_init+0x11c/0x164) from [<c022849c>] (customize_machine+0x20/0x28)
> [<c022849c>] (customize_machine+0x20/0x28) from [<c0225810>] (do_one_initcall+0xa0/0x16c)
> [<c0225810>] (do_one_initcall+0xa0/0x16c) from [<c02259e0>] (kernel_init+0x104/0x1ac)
> [<c02259e0>] (kernel_init+0x104/0x1ac) from [<c0009cec>] (kernel_thread_exit+0x0/0x8)

Looks like this was caused by the added ifdef CONFIG_PM from
commit 3231fc88 (OMAP3: PM: restore SRAM functions after off-mode).

Tony

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

* Re: [PATCH] ARM: OMAP: sram: fix BUG in dpll code for !PM case
  2012-04-09 22:49 ` Tony Lindgren
@ 2012-04-17 17:22   ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2012-04-17 17:22 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap, linux-arm-kernel

* Tony Lindgren <tony@atomide.com> [120409 15:52]:
> * Grazvydas Ignotas <notasas@gmail.com> [120406 14:56]:
> > _omap3_sram_configure_core_dpll is called when SDRC is reprogrammed,
> > which is done regardless of CONFIG_PM setting, so we always need it's
> > setup code too. Without this, we hit a BUG() on OMAP3 when kernel is
> > built without CONFIG_PM:
> > 
> > Reprogramming SDRC clock to 332000000 Hz
> > ------------[ cut here ]------------
> > kernel BUG at arch/arm/plat-omap/sram.c:342!
> > Internal error: Oops - BUG: 0 [#1] ARM
> > ...
> > [<c001c694>] (omap3_configure_core_dpll+0x68/0x6c) from [<c001b2dc>] (omap3_core_dpll_m2_set_rate+0x1)
> > [<c001b2dc>] (omap3_core_dpll_m2_set_rate+0x138/0x1b0) from [<c001a478>] (omap2_clk_set_rate+0x14/0x2)
> > [<c001a478>] (omap2_clk_set_rate+0x14/0x20) from [<c001c9dc>] (clk_set_rate+0x54/0x74)
> > [<c001c9dc>] (clk_set_rate+0x54/0x74) from [<c022b9c8>] (omap_sdrc_init+0x70/0x90)
> > [<c022b9c8>] (omap_sdrc_init+0x70/0x90) from [<c022f178>] (omap3pandora_init+0x11c/0x164)
> > [<c022f178>] (omap3pandora_init+0x11c/0x164) from [<c022849c>] (customize_machine+0x20/0x28)
> > [<c022849c>] (customize_machine+0x20/0x28) from [<c0225810>] (do_one_initcall+0xa0/0x16c)
> > [<c0225810>] (do_one_initcall+0xa0/0x16c) from [<c02259e0>] (kernel_init+0x104/0x1ac)
> > [<c02259e0>] (kernel_init+0x104/0x1ac) from [<c0009cec>] (kernel_thread_exit+0x0/0x8)
> 
> Looks like this was caused by the added ifdef CONFIG_PM from
> commit 3231fc88 (OMAP3: PM: restore SRAM functions after off-mode).

Applying this into fixes.

Tony

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

end of thread, other threads:[~2012-04-17 17:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-06 21:53 [PATCH] ARM: OMAP: sram: fix BUG in dpll code for !PM case Grazvydas Ignotas
2012-04-09 22:49 ` Tony Lindgren
2012-04-17 17:22   ` Tony Lindgren

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