Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2461bc0 authored by Amit Pundir's avatar Amit Pundir
Browse files

ANDROID: idle_notifier: Add generic idle notifiers



AOSP Change-ID: Idf29cda15be151f494ff245933c12462643388d5
moved x86_64 idle notifiers as generic so that they can
be used in interactive governor.

Upstream change 8e7a7ee9 ("x86/idle: Remove idle_notifier")
removed x86_64 idle notifiers altogether. This patch add
generic idle notifiers again.

Fixes: android-4.9 commit bfd2a547fc17 ("ANDROID: ARM: Call idle notifiers")
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 55ca9206
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -166,4 +166,11 @@ void cpuhp_report_idle_dead(void);
static inline void cpuhp_report_idle_dead(void) { }
#endif /* #ifdef CONFIG_HOTPLUG_CPU */

#define IDLE_START 1
#define IDLE_END 2

void idle_notifier_register(struct notifier_block *n);
void idle_notifier_unregister(struct notifier_block *n);
void idle_notifier_call_chain(unsigned long val);

#endif /* _LINUX_CPU_H_ */
+20 −0
Original line number Diff line number Diff line
@@ -1788,3 +1788,23 @@ void __init boot_cpu_state_init(void)
{
	per_cpu_ptr(&cpuhp_state, smp_processor_id())->state = CPUHP_ONLINE;
}

static ATOMIC_NOTIFIER_HEAD(idle_notifier);

void idle_notifier_register(struct notifier_block *n)
{
	atomic_notifier_chain_register(&idle_notifier, n);
}
EXPORT_SYMBOL_GPL(idle_notifier_register);

void idle_notifier_unregister(struct notifier_block *n)
{
	atomic_notifier_chain_unregister(&idle_notifier, n);
}
EXPORT_SYMBOL_GPL(idle_notifier_unregister);

void idle_notifier_call_chain(unsigned long val)
{
	atomic_notifier_call_chain(&idle_notifier, val, NULL);
}
EXPORT_SYMBOL_GPL(idle_notifier_call_chain);