From: Huisung Kang Date: Fri, 24 Jun 2011 07:04:18 +0000 (+0900) Subject: [CPUFREQ] S5PV210: Add reboot notifier to prevent system hang X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fe7f1bcbff917f22e121d4b2c045fb1de80cc450;p=linux-beck.git [CPUFREQ] S5PV210: Add reboot notifier to prevent system hang When system reboot, the CPUFREQ level should be 800MHz to prevent system lockup. Signed-off-by: Huisung Kang Signed-off-by: Jonghwan Choi Signed-off-by: Kukjin Kim Signed-off-by: Dave Jones --- diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index 155242cfc714..7c4bb070b904 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -590,6 +591,19 @@ static int s5pv210_cpufreq_notifier_event(struct notifier_block *this, return NOTIFY_DONE; } +static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *this, + unsigned long event, void *ptr) +{ + int ret; + + ret = cpufreq_driver_target(cpufreq_cpu_get(0), SLEEP_FREQ, + DISABLE_FURTHER_CPUFREQ); + if (ret < 0) + return NOTIFY_BAD; + + return NOTIFY_DONE; +} + static struct cpufreq_driver s5pv210_driver = { .flags = CPUFREQ_STICKY, .verify = s5pv210_verify_speed, @@ -607,6 +621,10 @@ static struct notifier_block s5pv210_cpufreq_notifier = { .notifier_call = s5pv210_cpufreq_notifier_event, }; +static struct notifier_block s5pv210_cpufreq_reboot_notifier = { + .notifier_call = s5pv210_cpufreq_reboot_notifier_event, +}; + static int __init s5pv210_cpufreq_init(void) { arm_regulator = regulator_get(NULL, "vddarm"); @@ -623,6 +641,7 @@ static int __init s5pv210_cpufreq_init(void) } register_pm_notifier(&s5pv210_cpufreq_notifier); + register_reboot_notifier(&s5pv210_cpufreq_reboot_notifier); return cpufreq_register_driver(&s5pv210_driver); }