Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: OMAP: Avoid sleeping during arch_reset

If we call clk_get() from arch_reset we get ugly messages before
reboot.

Signed-off-by: Tony Lindgren <tony@atomide.com>

+23 -7
+20
arch/arm/mach-omap2/clock.c
··· 36 36 37 37 static struct prcm_config *curr_prcm_set; 38 38 static u32 curr_perf_level = PRCM_FULL_SPEED; 39 + static struct clk *vclk; 40 + static struct clk *sclk; 39 41 40 42 /*------------------------------------------------------------------------- 41 43 * Omap2 specific clock functions ··· 986 984 sys->rate = sclk; 987 985 } 988 986 987 + /* 988 + * Set clocks for bypass mode for reboot to work. 989 + */ 990 + void omap2_clk_prepare_for_reboot(void) 991 + { 992 + u32 rate; 993 + 994 + if (vclk == NULL || sclk == NULL) 995 + return; 996 + 997 + rate = clk_get_rate(sclk); 998 + clk_set_rate(vclk, rate); 999 + } 1000 + 989 1001 #ifdef CONFIG_OMAP_RESET_CLOCKS 990 1002 static void __init omap2_disable_unused_clocks(void) 991 1003 { ··· 1095 1079 clk_enable(&omapctrl_ick); 1096 1080 if (cpu_is_omap2430()) 1097 1081 clk_enable(&sdrc_ick); 1082 + 1083 + /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ 1084 + vclk = clk_get(NULL, "virt_prcm_set"); 1085 + sclk = clk_get(NULL, "sys_ck"); 1098 1086 1099 1087 return 0; 1100 1088 }
+3 -7
arch/arm/mach-omap2/prcm.c
··· 19 19 20 20 #include "prcm-regs.h" 21 21 22 + extern void omap2_clk_prepare_for_reboot(void); 23 + 22 24 u32 omap_prcm_get_reset_sources(void) 23 25 { 24 26 return RM_RSTST_WKUP & 0x7f; ··· 30 28 /* Resets clock rates and reboots the system. Only called from system.h */ 31 29 void omap_prcm_arch_reset(char mode) 32 30 { 33 - u32 rate; 34 - struct clk *vclk, *sclk; 35 - 36 - vclk = clk_get(NULL, "virt_prcm_set"); 37 - sclk = clk_get(NULL, "sys_ck"); 38 - rate = clk_get_rate(sclk); 39 - clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */ 31 + omap2_clk_prepare_for_reboot(); 40 32 RM_RSTCTRL_WKUP |= 2; 41 33 }