From: Kevin Hilman Date: Wed, 24 Jun 2015 17:40:17 +0000 (-0700) Subject: Merge branch 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro... X-Git-Tag: firefly_0821_release~3680^2~4 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=dae04c1c00f74dd21cce9d85ce90ff50b26d4741;p=firefly-linux-kernel-4.4.55.git Merge branch 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro-android into linux-linaro-lsk-v3.10-android * 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro-android: sched: cpufreq: update power usage only if cpufreq_stat is enabled uid_cputime: Extends the cputime functionality to report power per uid sched: cpufreq: Adds a field cpu_power in the task_struct cpufreq_stats: Adds the fucntionality to load current values for each frequency for all the cores. android: drivers: workaround debugfs race in binder neigh: Better handling of transition to NUD_PROBE state New Build Breakage in branch: kernel-m-dev-tegra-flounder-3.10 @ 1960706 net/unix: sk_socket can disappear when state is unlocked selinux: enable genfscon labeling for sysfs and pstore files selinux: enable per-file labeling for debugfs files. ext4: don't save the error information if the block device is read-only suspend: Return error when pending wakeup source is found. proc: uid_cputime: fix show_uid_stat permission power: increment wakeup_count when save_wakeup_count failed. power: validate wakeup source before activating it. --- dae04c1c00f74dd21cce9d85ce90ff50b26d4741 diff --cc drivers/cpufreq/cpufreq_stats.c index 690af18f55a9,c441758e01a6..52b4d526dcff --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@@ -22,10 -22,9 +22,12 @@@ #include #include #include + #include + #include #include +#ifdef CONFIG_BL_SWITCHER +#include +#endif static spinlock_t cpufreq_stats_lock; @@@ -670,56 -796,9 +799,57 @@@ static void cpufreq_stats_cleanup(void cpufreq_stats_free_sysfs(cpu); } cpufreq_allstats_free(); + cpufreq_powerstats_free(); } +#ifdef CONFIG_BL_SWITCHER +static int cpufreq_stats_switcher_notifier(struct notifier_block *nfb, + unsigned long action, void *_arg) +{ + switch (action) { + case BL_NOTIFY_PRE_ENABLE: + case BL_NOTIFY_PRE_DISABLE: + cpufreq_stats_cleanup(); + break; + + case BL_NOTIFY_POST_ENABLE: + case BL_NOTIFY_POST_DISABLE: + cpufreq_stats_setup(); + break; + + default: + return NOTIFY_DONE; + } + + return NOTIFY_OK; +} + +static struct notifier_block switcher_notifier = { + .notifier_call = cpufreq_stats_switcher_notifier, +}; +#endif + +static int __init cpufreq_stats_init(void) +{ + int ret; + spin_lock_init(&cpufreq_stats_lock); + + ret = cpufreq_stats_setup(); +#ifdef CONFIG_BL_SWITCHER + if (!ret) + bL_switcher_register_notifier(&switcher_notifier); +#endif + return ret; +} + +static void __exit cpufreq_stats_exit(void) +{ +#ifdef CONFIG_BL_SWITCHER + bL_switcher_unregister_notifier(&switcher_notifier); +#endif + cpufreq_stats_cleanup(); +} + MODULE_AUTHOR("Zou Nan hai "); MODULE_DESCRIPTION("'cpufreq_stats' - A driver to export cpufreq stats " "through sysfs filesystem");