From: Jianxin Pan Date: Mon, 15 Oct 2018 13:07:36 +0000 (+0800) Subject: interactive: disable idle notifier X-Git-Tag: khadas-vims-v0.9.6-release~1285^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73d8a197e2d87e02a2e222af476fe09b6f69dcb1;p=platform%2Fkernel%2Flinux-amlogic.git interactive: disable idle notifier PD#SWPL-569 Problem: Randomly encountered the phenomenon of kernel panic restart (add_timer_on) from [] (slack_timer_resched+0xa8/0xdc) (slack_timer_resched) from [] (cpufreq_interactive_start+0xac/0x234) (cpufreq_interactive_start) from [] (cpufreq_start_governor+0x68/0xa4) (cpufreq_start_governor) from [] (cpufreq_online+0x4f8/0x794) (cpufreq_online) from [] (cpuhp_cpufreq_online+0x18/0x20) (cpuhp_cpufreq_online) from [] (cpuhp_invoke_callback+0xa8/0x638) (cpuhp_invoke_callback) from [] (cpuhp_up_callbacks+0x34/0xe8) (cpuhp_up_callbacks) from [] (cpuhp_thread_fun+0x13c/0x14c) (cpuhp_thread_fun) from [] (smpboot_thread_fn+0x1a8/0x32c) (smpboot_thread_fn) from [] (kthread+0x124/0x140) (kthread) from [] (ret_from_fork+0x14/0x24) Solution: disable idle notifier for interactive Verify: verified by p212 Change-Id: I412dab961f04bea439d5a26564268289fc4b3940 Signed-off-by: Jianxin Pan --- diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index 0229989..d6a42cd 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -471,7 +471,7 @@ static void cpufreq_interactive_update(struct interactive_cpu *icpu) eval_target_freq(icpu); slack_timer_resched(icpu, smp_processor_id(), true); } - +#ifndef CONFIG_AMLOGIC_MODIFY static void cpufreq_interactive_idle_end(void) { struct interactive_cpu *icpu = &per_cpu(interactive_cpu, @@ -491,7 +491,7 @@ static void cpufreq_interactive_idle_end(void) up_read(&icpu->enable_sem); } - +#endif static void cpufreq_interactive_get_policy_info(struct cpufreq_policy *policy, unsigned int *pmax_freq, u64 *phvt, u64 *pfvt) @@ -1011,7 +1011,7 @@ static struct kobj_type interactive_tunables_ktype = { .default_attrs = interactive_attributes, .sysfs_ops = &governor_sysfs_ops, }; - +#ifndef CONFIG_AMLOGIC_MODIFY static int cpufreq_interactive_idle_notifier(struct notifier_block *nb, unsigned long val, void *data) { @@ -1024,7 +1024,7 @@ static int cpufreq_interactive_idle_notifier(struct notifier_block *nb, static struct notifier_block cpufreq_interactive_idle_nb = { .notifier_call = cpufreq_interactive_idle_notifier, }; - +#endif /* Interactive Governor callbacks */ struct interactive_governor { struct cpufreq_governor gov; @@ -1242,7 +1242,9 @@ int cpufreq_interactive_init(struct cpufreq_policy *policy) /* One time initialization for governor */ if (!interactive_gov.usage_count++) { +#ifndef CONFIG_AMLOGIC_MODIFY idle_notifier_register(&cpufreq_interactive_idle_nb); +#endif cpufreq_register_notifier(&cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER); } @@ -1276,7 +1278,9 @@ void cpufreq_interactive_exit(struct cpufreq_policy *policy) if (!--interactive_gov.usage_count) { cpufreq_unregister_notifier(&cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER); +#ifndef CONFIG_AMLOGIC_MODIFY idle_notifier_unregister(&cpufreq_interactive_idle_nb); +#endif } count = gov_attr_set_put(&tunables->attr_set, &ipolicy->tunables_hook);