Commit fe7f1bcb authored by Huisung Kang's avatar Huisung Kang Committed by Dave Jones

[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: default avatarHuisung Kang <hs1218.kang@samsung.com>
Signed-off-by: default avatarJonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 74df8e69
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/reboot.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/suspend.h> #include <linux/suspend.h>
...@@ -590,6 +591,19 @@ static int s5pv210_cpufreq_notifier_event(struct notifier_block *this, ...@@ -590,6 +591,19 @@ static int s5pv210_cpufreq_notifier_event(struct notifier_block *this,
return NOTIFY_DONE; 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 = { static struct cpufreq_driver s5pv210_driver = {
.flags = CPUFREQ_STICKY, .flags = CPUFREQ_STICKY,
.verify = s5pv210_verify_speed, .verify = s5pv210_verify_speed,
...@@ -607,6 +621,10 @@ static struct notifier_block s5pv210_cpufreq_notifier = { ...@@ -607,6 +621,10 @@ static struct notifier_block s5pv210_cpufreq_notifier = {
.notifier_call = s5pv210_cpufreq_notifier_event, .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) static int __init s5pv210_cpufreq_init(void)
{ {
arm_regulator = regulator_get(NULL, "vddarm"); arm_regulator = regulator_get(NULL, "vddarm");
...@@ -623,6 +641,7 @@ static int __init s5pv210_cpufreq_init(void) ...@@ -623,6 +641,7 @@ static int __init s5pv210_cpufreq_init(void)
} }
register_pm_notifier(&s5pv210_cpufreq_notifier); register_pm_notifier(&s5pv210_cpufreq_notifier);
register_reboot_notifier(&s5pv210_cpufreq_reboot_notifier);
return cpufreq_register_driver(&s5pv210_driver); return cpufreq_register_driver(&s5pv210_driver);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment