From bd9d9d238f4b7802d32482dc3f5886e35e8c703c Mon Sep 17 00:00:00 2001 From: Jean-Pierre Rasquin Date: Sun, 9 Oct 2016 13:15:04 +0200 Subject: [PATCH 01/75] soc: qcom: msm_hotplug v2.4 v2.4 : - add runtime debug switch to dump cpu_up/down info to dmesg v2.3 : - back to using __cpuinit v2.2 : - add min/max big cores - rewrite big_updown - rewrite suspend/resume v2.11 : - fix & simplify least loaded big core calculation - simplify least loaded little core calculation and exclude cpu0 v2.1 : - simplified update_rate code - big cores unplug : choose the one with the least workload from 5-6-7 first, 4 last (used to set governor) - code review v2 : - respect msm_thermal core restrictions - hotplug big cores based on big core load instead of linking 50% of big cluster to cpu2 and cpu3 (little) - checks in sysfs interface to refuse invalid values (return EINVAL) ------------------------------------------------- SysFs interface (/sys/module/msm_hotplug) : msm_enabled : enable/disable hotplugging (rw, 0/1, defaults to 0) update_rate : delay between load calculations in ms (rw, 2-5000, defaults to 200) load_levels : show/update load levels for little cores (rw, format "x y z" x = 1-4 = core y = 0- (100*x) = up_threshold z = 0-((100*x)-1) = down_threshold) min_cpus_online : minimum LITTLE cores to keep up at all times (rw, 1-4, defaults to 3 for s810) max_cpus_online : maximum LITTLE cores allowed up at all times when screen on (rw, 1-4, defaults to 4 for s810) max_cpus_online_susp : maximum LITTLE cores allowed up at all times when screen off (rw, 1-4, defaults to 4 for s810) offline_load : minimal load to elect a LITTLE core for downing (rw, 0-100, defaults to 0, disabled when 0) min_cpus_online_big : minimum big cores to keep up at all times (rw, 0-4, defaults to 0 for s810) max_cpus_online_big : maximum big cores allowed up at all times when screen on (rw, 1-4, defaults to 4 for s810) offline_load_big : average load of all big cores to reach to remove a big core (rw, 0-100, defaults to 20) online_load_big : average load of all big cores to reach to add an additional big core (rw, 0-100, defaults to 80) kick_in_load_big : average load of all little cores to reach to add first big core (rw, 0-100, defaults to 70) fast_lane_load : average load of all running little cores to reach to bring up all big and LITTLE cores (rw, 0/70-100, defaults to 95, disabled when 0) big_core_up_delay : delay before brining up big cores in ms (rw, defaults to 0, disabled when 0) io_is_busy : consider io as load (rw, 0/1, defaults to 0) current_load : show current load (sum of all up cores' load) (ro) current_cores : show current core up count (ro, format "big.LITTLE") version : show current msm_hotplug version (ro) ------------------------------------------------- Credits for the msm_hotplug version I based this on to : - The Linux Foundation - Fluxi - Pranav Vashi - jollaman999 Signed-off-by: Jean-Pierre Rasquin --- drivers/cpufreq/cpufreq.c | 29 +- drivers/input/misc/fpc1020_tee.c | 25 + drivers/soc/qcom/Kconfig | 8 + drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/msm_hotplug.c | 1704 ++++++++++++++++++++++++++++ drivers/soc/qcom/msm_performance.c | 5 + drivers/thermal/msm_thermal.c | 7 + include/linux/msm_hotplug.h | 23 + include/linux/msm_thermal.h | 6 + kernel/cpu.c | 11 + 10 files changed, 1818 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/qcom/msm_hotplug.c create mode 100644 include/linux/msm_hotplug.h diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 2e6bc5bf4cb70..49a45b728016f 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -30,6 +30,11 @@ #include #include +/* HACK: Prevent big cluster turned off when changing governor settings. */ +#ifdef CONFIG_MSM_HOTPLUG +#include +#endif + /** * The "cpufreq driver" - the arch- or hardware-dependent low * level driver of CPUFreq support, and its spinlock. This lock @@ -417,10 +422,32 @@ static ssize_t show_##file_name \ return sprintf(buf, "%u\n", policy->object); \ } +/* HACK: Prevent big cluster turned off when changing governor settings. */ +#ifdef CONFIG_MSM_HOTPLUG +extern bool prevent_big_off; + +static void prevent_big_off_cancel(struct work_struct *prevent_big_off_cancel_work) +{ + prevent_big_off = false; +} +static DECLARE_DELAYED_WORK(prevent_big_off_cancel_work, prevent_big_off_cancel); + +static ssize_t show_scaling_min_freq +(struct cpufreq_policy *policy, char *buf) +{ + prevent_big_off = true; + cancel_delayed_work(&prevent_big_off_cancel_work); + schedule_delayed_work(&prevent_big_off_cancel_work, + msecs_to_jiffies(5000)); + return sprintf(buf, "%u\n", policy->min); +} +#else +show_one(scaling_min_freq, min); +#endif + show_one(cpuinfo_min_freq, cpuinfo.min_freq); show_one(cpuinfo_max_freq, cpuinfo.max_freq); show_one(cpuinfo_transition_latency, cpuinfo.transition_latency); -show_one(scaling_min_freq, min); show_one(scaling_max_freq, max); show_one(scaling_cur_freq, cur); diff --git a/drivers/input/misc/fpc1020_tee.c b/drivers/input/misc/fpc1020_tee.c index ba3caffc8cde4..08aaf58e643f4 100755 --- a/drivers/input/misc/fpc1020_tee.c +++ b/drivers/input/misc/fpc1020_tee.c @@ -48,6 +48,12 @@ #include #include +#ifdef CONFIG_MSM_HOTPLUG +#include +#include +#endif + + #ifdef CONFIG_FB #include #include @@ -60,6 +66,10 @@ #define FPC1020_RESET_HIGH2_US 1250 #define FPC_TTW_HOLD_TIME 1000 +#ifdef CONFIG_MSM_HOTPLUG +extern void msm_hotplug_resume_timeout(void); +#endif + /* Unused key value to avoid interfering with active keys */ #define KEY_FINGERPRINT 0x2ee @@ -962,6 +972,13 @@ static int fb_notifier_callback(struct notifier_block *self, unsigned long event return 0; } #endif +#ifdef CONFIG_MSM_HOTPLUG +static void __cpuinit msm_hotplug_resume_call(struct work_struct *msm_hotplug_resume_call_work) +{ + msm_hotplug_resume_timeout(); +} +static DECLARE_WORK(msm_hotplug_resume_call_work, msm_hotplug_resume_call); +#endif static irqreturn_t fpc1020_irq_handler(int irq, void *handle) { @@ -976,6 +993,14 @@ static irqreturn_t fpc1020_irq_handler(int irq, void *handle) wake_lock_timeout(&fpc1020->ttw_wl, msecs_to_jiffies(FPC_TTW_HOLD_TIME)); } */ +#ifdef CONFIG_MSM_HOTPLUG + if (msm_enabled && msm_hotplug_scr_suspended && + !msm_hotplug_fingerprint_called) { + msm_hotplug_fingerprint_called = true; + schedule_work(&msm_hotplug_resume_call_work); + } +#endif + wake_lock_timeout(&fpc1020->ttw_wl, msecs_to_jiffies(FPC_TTW_HOLD_TIME));//changhua add for KeyguardUpdateMonitor: fingerprint acquired, grabbing fp wakelock sysfs_notify(&fpc1020->dev->kobj, NULL, dev_attr_irq.attr.name); diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 604a79b066c27..a42df6820b21d 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -648,6 +648,14 @@ config KERNEL_TEXT_MPU_PROT all masters; Write access is only permited to the secure world. +config MSM_HOTPLUG + bool "MSM hotplug driver" + depends on HOTPLUG_CPU + default n + help + The MSM hotplug driver controls on-/offlining of additional cores based + on current cpu load. + source "drivers/soc/qcom/memshare/Kconfig" endif # ARCH_MSM diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index 82854daa5d776..23e136df9feb5 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -90,6 +90,7 @@ obj-$(CONFIG_MSM_SYSTEM_HEALTH_MONITOR) += system_health_monitor.o obj-$(CONFIG_MSM_RTB) += msm_rtb-hotplug.o obj-$(CONFIG_QCOM_EARLY_RANDOM) += early_random.o obj-$(CONFIG_MSM_PACMAN) += msm_pacman.o +obj-$(CONFIG_MSM_HOTPLUG) += msm_hotplug.o #VENDOR_EDIT obj-y += project_info.o obj-y += boot_mode.o diff --git a/drivers/soc/qcom/msm_hotplug.c b/drivers/soc/qcom/msm_hotplug.c new file mode 100644 index 0000000000000..e0476e3821fa9 --- /dev/null +++ b/drivers/soc/qcom/msm_hotplug.c @@ -0,0 +1,1704 @@ +/* + * MSM Hotplug Driver + * + * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014, Fluxi + * Copyright (c) 2013-2015, Pranav Vashi + * Copyright (c) 2016, jollaman999 / Adaptive for big.LITTLE + * Copyright (c) 2016, yank555.lu / hotplug big core based on load + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +/* ---------------------------------------------------------------------------------------------- + SysFs interface : /sys/module/msm_hotplug + ---------------------------------------------------------------------------------------------- + + msm_enabled : enable/disable hotplugging + (rw, 0/1, defaults to 0) + + update_rate : delay between load calculations in ms + (rw, 2-5000, defaults to 200) + + load_levels : show/update load levels for little cores + (rw, format "x y z" + x = 1-4 = core + y = 0- (100*x) = up_threshold + z = 0-((100*x)-1) = down_threshold) + + min_cpus_online : minimum LITTLE cores to keep up at all times + (rw, 1-4, defaults to 3 for s810) + + max_cpus_online : maximum LITTLE cores allowed up at all times when screen on + (rw, 1-4, defaults to 4 for s810) + + max_cpus_online_susp : maximum LITTLE cores allowed up at all times when screen off + (rw, 1-4, defaults to 4 for s810) + + offline_load : minimal load to elect a LITTLE core for downing + (rw, 0-100, defaults to 0, disabled when 0) + + min_cpus_online_big : minimum big cores to keep up at all times + (rw, 0-4, defaults to 0 for s810) + + max_cpus_online_big : maximum big cores allowed up at all times when screen on + (rw, 1-4, defaults to 4 for s810) + + offline_load_big : average load of all big cores to reach to remove a big core + (rw, 0-100, defaults to 20) + + online_load_big : average load of all big cores to reach to add an additional big core + (rw, 0-100, defaults to 80) + + kick_in_load_big : average load of all little cores to reach to add first big core + (rw, 0-100, defaults to 70) + + fast_lane_load : average load of all running little cores to reach to bring up all + big and LITTLE cores + (rw, 0/70-100, defaults to 95, disabled when 0) + + big_core_up_delay : delay before brining up big cores in ms + (rw, defaults to 0, disabled when 0) + + io_is_busy : consider io as load + (rw, 0/1, defaults to 0) + + current_load : show current load (sum of all up cores' load) + (ro) + + current_cores : show current core up count + (ro, format "big.LITTLE") + + debug : print debugging info to dmesg + (rw, 0/1, defaults to 0) + + version : show current msm_hotplug version + (ro) + + ---------------------------------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_THERMAL_MONITOR +#include +#endif + +// Change this value for your device +#define LITTLE_CORES 4 +#define BIG_CORES 4 + +#define MSM_HOTPLUG_VERSION "2.4" + +#define MSM_HOTPLUG "msm_hotplug" +#define HOTPLUG_ENABLED 0 +#define DEFAULT_UPDATE_RATE 200 +#define START_DELAY 20000 +#define DEFAULT_HISTORY_SIZE 10 +#define DEFAULT_DOWN_LOCK_DUR 1000 +#define DEFAULT_MIN_CPUS_ONLINE 2 +#define DEFAULT_MAX_CPUS_ONLINE LITTLE_CORES +#define DEFAULT_MAX_CPUS_ONLINE_SUSP 2 +#define DEFAULT_OFFLINE_LOAD 0 +#define DEFAULT_MIN_CPUS_ONLINE_BIG 1 +#define DEFAULT_MAX_CPUS_ONLINE_BIG BIG_CORES +#define DEFAULT_OFFLINE_LOAD_BIG 20 +#define DEFAULT_ONLINE_LOAD_BIG 80 +#define DEFAULT_KICK_IN_LOAD_BIG 70 +#define DEFAULT_FAST_LANE_LOAD 95 +#define DEFAULT_BIG_CORE_UP_DELAY 200 +#define DEFAULT_IO_IS_BUSY false + +// Use for msm_hotplug_resume_timeout +#define HOTPLUG_TIMEOUT 2000 + +unsigned int msm_enabled = HOTPLUG_ENABLED; + +struct notifier_block msm_hotplug_fb_notif; + +/* HACK: Prevent big cluster turned off when changing governor settings. */ +bool prevent_big_off = false; +EXPORT_SYMBOL(prevent_big_off); + +static bool timeout_enabled = false; +static s64 pre_time; +bool msm_hotplug_scr_suspended = false; +bool msm_hotplug_fingerprint_called = false; + +static void msm_hotplug_suspend(void); + +static unsigned int debug = 0; +module_param_named(debug_mask, debug, uint, 0644); + +#define dprintk(msg...) \ +do { \ + if (debug) \ + pr_info(msg); \ +} while (0) + +static struct cpu_hotplug { + unsigned int suspended; + unsigned int update_rate; + unsigned int max_cpus_online_susp; + unsigned int target_cpus; + unsigned int target_cpus_big; + unsigned int min_cpus_online; + unsigned int max_cpus_online; + unsigned int offline_load; + unsigned int min_cpus_online_big; + unsigned int max_cpus_online_big; + unsigned int offline_load_big; + unsigned int online_load_big; + unsigned int kick_in_load_big; + unsigned int down_lock_dur; + unsigned int fast_lane_load; + unsigned int big_core_up_delay; + struct mutex msm_hotplug_mutex; + struct notifier_block notif; +} hotplug = { + .update_rate = DEFAULT_UPDATE_RATE, + .min_cpus_online = DEFAULT_MIN_CPUS_ONLINE, + .max_cpus_online = DEFAULT_MAX_CPUS_ONLINE, + .offline_load = DEFAULT_OFFLINE_LOAD, + .min_cpus_online_big = DEFAULT_MIN_CPUS_ONLINE_BIG, + .max_cpus_online_big = DEFAULT_MAX_CPUS_ONLINE_BIG, + .offline_load_big = DEFAULT_OFFLINE_LOAD_BIG, + .online_load_big = DEFAULT_ONLINE_LOAD_BIG, + .kick_in_load_big = DEFAULT_KICK_IN_LOAD_BIG, + .suspended = 0, + .max_cpus_online_susp = DEFAULT_MAX_CPUS_ONLINE_SUSP, + .down_lock_dur = DEFAULT_DOWN_LOCK_DUR, + .fast_lane_load = DEFAULT_FAST_LANE_LOAD, + .big_core_up_delay = DEFAULT_BIG_CORE_UP_DELAY +}; + +static struct workqueue_struct *hotplug_wq; +static struct delayed_work hotplug_work; + +static bool big_core_up_ready_checked = false; +static s64 big_core_up_ready_time = 0; + +static struct cpu_stats { + unsigned int *load_hist; + unsigned int hist_size; + unsigned int hist_cnt; + unsigned int min_cpus; + unsigned int total_cpus; + unsigned int total_cpus_big; + unsigned int online_cpus; + unsigned int online_cpus_big; + unsigned int cur_avg_load; + unsigned int cur_avg_load_big; + unsigned int cur_max_load; + unsigned int cur_max_load_big; + struct mutex stats_mutex; +} stats = { + .hist_size = DEFAULT_HISTORY_SIZE, + .min_cpus = 1, + .total_cpus = LITTLE_CORES, + .total_cpus_big = BIG_CORES +}; + +struct down_lock { + unsigned int locked; + struct delayed_work lock_rem; +}; + +static DEFINE_PER_CPU(struct down_lock, lock_info); + +struct cpu_load_data { + u64 prev_cpu_idle; + u64 prev_cpu_wall; + unsigned int avg_load_maxfreq; + unsigned int cur_load_maxfreq; + unsigned int samples; + unsigned int window_size; + cpumask_var_t related_cpus; +}; + +static DEFINE_PER_CPU(struct cpu_load_data, cpuload); + +static bool io_is_busy = DEFAULT_IO_IS_BUSY; + +static bool debug_dmesg = false; + +static int num_online_little_cpus(void) +{ + int cpu; + unsigned int online_cpus = 0; + + for (cpu = 0; cpu < stats.total_cpus; cpu++) { + if (cpu_online(cpu)) + online_cpus++; + } + + return online_cpus; +} + +static int num_online_big_cpus(void) +{ + int cpu; + unsigned int online_cpus = 0; + + for (cpu = stats.total_cpus; cpu < stats.total_cpus + stats.total_cpus_big; cpu++) { + if (cpu_online(cpu)) + online_cpus++; + } + + return online_cpus; +} + +static int update_average_load(unsigned int cpu) +{ + int ret; + unsigned int idle_time, wall_time; + unsigned int cur_load, load_max_freq; + u64 cur_wall_time, cur_idle_time; + struct cpu_load_data *pcpu = &per_cpu(cpuload, cpu); + struct cpufreq_policy policy; + + ret = cpufreq_get_policy(&policy, cpu); + if (ret) + return -EINVAL; + + cur_idle_time = get_cpu_idle_time(cpu, &cur_wall_time, io_is_busy); + + wall_time = (unsigned int) (cur_wall_time - pcpu->prev_cpu_wall); + pcpu->prev_cpu_wall = cur_wall_time; + + idle_time = (unsigned int) (cur_idle_time - pcpu->prev_cpu_idle); + pcpu->prev_cpu_idle = cur_idle_time; + + if (unlikely(!wall_time || wall_time < idle_time)) + return 0; + + cur_load = 100 * (wall_time - idle_time) / wall_time; + + /* Calculate the scaled load across cpu */ + load_max_freq = (cur_load * policy.cur) / policy.max; + + if (!pcpu->avg_load_maxfreq) { + /* This is the first sample in this window */ + pcpu->avg_load_maxfreq = load_max_freq; + pcpu->window_size = wall_time; + } else { + /* + * The is already a sample available in this window. + * Compute weighted average with prev entry, so that + * we get the precise weighted load. + */ + pcpu->avg_load_maxfreq = + ((pcpu->avg_load_maxfreq * pcpu->window_size) + + (load_max_freq * wall_time)) / + (wall_time + pcpu->window_size); + + pcpu->window_size += wall_time; + } + + return 0; +} + +static unsigned int load_at_max_freq(void) +{ + int cpu; + unsigned int total_load = 0, max_load = 0; + struct cpu_load_data *pcpu; + + for (cpu = 0; cpu < stats.total_cpus; cpu++) { + if (!cpu_online(cpu)) + continue; + pcpu = &per_cpu(cpuload, cpu); + update_average_load(cpu); + total_load += pcpu->avg_load_maxfreq; + pcpu->cur_load_maxfreq = pcpu->avg_load_maxfreq; + max_load = max(max_load, pcpu->avg_load_maxfreq); + pcpu->avg_load_maxfreq = 0; + } + stats.cur_max_load = max_load; + + return total_load; +} + +static unsigned int load_at_max_freq_big(void) +{ + int cpu; + unsigned int total_load = 0, max_load = 0; + struct cpu_load_data *pcpu; + + for (cpu = stats.total_cpus; cpu < stats.total_cpus + stats.total_cpus_big; cpu++) { + if (!cpu_online(cpu)) + continue; + pcpu = &per_cpu(cpuload, cpu); + update_average_load(cpu); + total_load += pcpu->avg_load_maxfreq; + pcpu->cur_load_maxfreq = pcpu->avg_load_maxfreq; + max_load = max(max_load, pcpu->avg_load_maxfreq); + pcpu->avg_load_maxfreq = 0; + } + stats.cur_max_load_big = max_load; + + return total_load; +} + +static void update_load_stats(void) +{ + unsigned int i, j; + unsigned int load = 0; + + mutex_lock(&stats.stats_mutex); + stats.online_cpus = num_online_little_cpus(); + stats.online_cpus_big = num_online_big_cpus(); + stats.cur_avg_load_big = load_at_max_freq_big(); + + if (stats.hist_size > 1) { + stats.load_hist[stats.hist_cnt] = load_at_max_freq(); + } else { + stats.cur_avg_load = load_at_max_freq(); + mutex_unlock(&stats.stats_mutex); + return; + } + + for (i = 0, j = stats.hist_cnt; i < stats.hist_size; i++, j--) { + load += stats.load_hist[j]; + + if (j == 0) + j = stats.hist_size; + } + + if (++stats.hist_cnt == stats.hist_size) + stats.hist_cnt = 0; + + stats.cur_avg_load = load / stats.hist_size; + mutex_unlock(&stats.stats_mutex); +} + +struct loads_tbl { + unsigned int up_threshold; + unsigned int down_threshold; +}; + +#define LOAD_SCALE(u, d) \ +{ \ + .up_threshold = u, \ + .down_threshold = d, \ +} + +static struct loads_tbl loads[] = { + LOAD_SCALE(400, 0), + LOAD_SCALE(65, 0), + LOAD_SCALE(120, 50), + LOAD_SCALE(190, 100), + LOAD_SCALE(410, 170), + LOAD_SCALE(0, 0), +}; + +static void apply_down_lock(unsigned int cpu) +{ + struct down_lock *dl = &per_cpu(lock_info, cpu); + + dl->locked = 1; + queue_delayed_work_on(0, hotplug_wq, &dl->lock_rem, + msecs_to_jiffies(hotplug.down_lock_dur)); +} + +static void remove_down_lock(struct work_struct *work) +{ + struct down_lock *dl = container_of(work, struct down_lock, + lock_rem.work); + dl->locked = 0; +} + +static int check_down_lock(unsigned int cpu) +{ + struct down_lock *dl = &per_cpu(lock_info, cpu); + + return dl->locked; +} + +static int get_lowest_load_cpu(void) +{ + int cpu, lowest_cpu = 0; + unsigned int lowest_load = UINT_MAX; + unsigned int proj_load; + struct cpu_load_data *pcpu; + + // Skip cpu 0 + for (cpu = 1; cpu < stats.total_cpus; cpu++) { + if (!cpu_online(cpu)) + continue; + pcpu = &per_cpu(cpuload, cpu); + if (pcpu->cur_load_maxfreq < lowest_load) { + lowest_load = pcpu->cur_load_maxfreq; + lowest_cpu = cpu; + } + } + + proj_load = stats.cur_avg_load - lowest_load; + if (proj_load > loads[stats.online_cpus - 1].up_threshold) + return -EPERM; + + if (hotplug.offline_load && lowest_load >= hotplug.offline_load) + return -EPERM; + + // Skip cpu 0 + if (lowest_cpu == 0) + return -EPERM; + + return lowest_cpu; +} + +static int get_lowest_load_cpu_big(void) +{ + int cpu, lowest_cpu; + unsigned int lowest_load = UINT_MAX; + unsigned int proj_load; + struct cpu_load_data *pcpu; + + lowest_cpu = stats.total_cpus; + + // Skip first big core + for (cpu = stats.total_cpus + 1; cpu < stats.total_cpus + stats.total_cpus_big; cpu++) { + if (!cpu_online(cpu)) + continue; + pcpu = &per_cpu(cpuload, cpu); + if (pcpu->cur_load_maxfreq < lowest_load) { + lowest_load = pcpu->cur_load_maxfreq; + lowest_cpu = cpu; + } + } + + // Don't elect any cpu if the resulting load will trigger adding a core + // unless there is only one big core up + proj_load = stats.cur_avg_load_big - lowest_load; + if ((proj_load > (stats.online_cpus_big - 1) * hotplug.online_load_big) + && (stats.online_cpus_big - 1) != 0) + return -EPERM; + + return lowest_cpu; +} + +static void big_up(void) +{ + int cpu; + + if (!big_core_up_ready_checked && hotplug.big_core_up_delay != 0) { + big_core_up_ready_checked = true; + big_core_up_ready_time = ktime_to_ms(ktime_get()); + return; + } + + if (ktime_to_ms(ktime_get()) - big_core_up_ready_time > hotplug.big_core_up_delay + || hotplug.big_core_up_delay == 0) { + for (cpu = stats.total_cpus; cpu < stats.total_cpus + stats.total_cpus_big; cpu++) { + if (cpu_online(cpu)) + continue; + if (hotplug.target_cpus_big <= num_online_big_cpus()) + break; +#ifdef CONFIG_THERMAL_MONITOR + // Only up a cpu if thermal control allows it ! + if(!msm_thermal_deny_cpu_up(cpu)) { +#endif + cpu_up(cpu); + apply_down_lock(cpu); + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] brought up cpu%d\n", cpu); + } +#ifdef CONFIG_THERMAL_MONITOR + } else { + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] bringup of cpu%d denied by msm_thermal\n", cpu); + } + } +#endif + } + + big_core_up_ready_checked = false; + return; + } +} + +static void big_down(void) +{ + int cpu, lowest_cpu; + + for (cpu = 0; cpu < stats.total_cpus_big; cpu++) { + lowest_cpu = get_lowest_load_cpu_big(); + if (lowest_cpu >= stats.total_cpus + && lowest_cpu < stats.total_cpus + stats.total_cpus_big) { + /* HACK: Prevent big cluster turned off when changing governor settings. */ + if (prevent_big_off && lowest_cpu == stats.total_cpus) { + // Turn on first of big cores + if (!cpu_online(stats.total_cpus)) { +#ifdef CONFIG_THERMAL_MONITOR + // Only up a cpu if thermal control allows it ! + if(!msm_thermal_deny_cpu_up(stats.total_cpus)) { +#endif + cpu_up(stats.total_cpus); + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] brought up cpu%d\n", stats.total_cpus); + } +#ifdef CONFIG_THERMAL_MONITOR + } else { + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] bringup of cpu%d denied by msm_thermal\n", + stats.total_cpus); + } + } +#endif + } + continue; + } + + if (!cpu_online(lowest_cpu)) + continue; + if (check_down_lock(lowest_cpu)) + continue; + if (hotplug.target_cpus_big >= num_online_big_cpus()) + break; + cpu_down(lowest_cpu); + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] brought down cpu%d\n", lowest_cpu); + } + } + } +} + +static void big_updown(unsigned int fast_lane_req) +{ + unsigned int avg_load_little_cpus, avg_load_big_cpus; + + hotplug.target_cpus_big = stats.online_cpus_big; + + if (stats.online_cpus_big > 0) { + avg_load_little_cpus = 0; + avg_load_big_cpus = stats.cur_avg_load_big / stats.online_cpus_big; + } else { + // if no big core is up, use average of all little cores as load average for big kick in + avg_load_little_cpus = stats.cur_avg_load / stats.online_cpus; + avg_load_big_cpus = 0; + } + + if (fast_lane_req == 1) { + + // If fast lane has been requested, up everything we have + hotplug.target_cpus_big = hotplug.max_cpus_online_big; + + } else if ( // Target at least the min amount of cores up + stats.online_cpus_big < hotplug.min_cpus_online_big ) { + + hotplug.target_cpus_big = hotplug.min_cpus_online_big; + + } else if ( // Up first big core if all allowed little cores are up and kick_in load reached + ( stats.online_cpus_big == 0 + && stats.online_cpus >= hotplug.max_cpus_online + && avg_load_little_cpus >= hotplug.kick_in_load_big ) || + + // Up one more big core if average load is reached + // and we are allowed for more cores + ( stats.online_cpus_big != 0 + && avg_load_big_cpus >= hotplug.online_load_big + && stats.online_cpus_big < hotplug.max_cpus_online_big ) ) { + + hotplug.target_cpus_big++; + + } else if ( // Down one big core if average load is below threshold + // and we are allowed less cores + stats.online_cpus_big > hotplug.min_cpus_online_big + && avg_load_big_cpus <= hotplug.offline_load_big ) { + + hotplug.target_cpus_big--; + + } + + if (stats.online_cpus_big != hotplug.target_cpus_big) { + if (hotplug.target_cpus_big > stats.online_cpus_big) + big_up(); + else if (hotplug.target_cpus_big < stats.online_cpus_big) + big_down(); + } +} + +static void little_up(void) +{ + int cpu; + + // Skip cpu 0 + for (cpu = 1; cpu < stats.total_cpus; cpu++) { + if (cpu_online(cpu)) + continue; + if (hotplug.target_cpus <= num_online_little_cpus()) + break; +#ifdef CONFIG_THERMAL_MONITOR + // Only up a cpu if thermal control allows it ! + if(!msm_thermal_deny_cpu_up(cpu)) { +#endif + cpu_up(cpu); + apply_down_lock(cpu); + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] brought up cpu%d\n", cpu); + } +#ifdef CONFIG_THERMAL_MONITOR + } else { + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] bringup of cpu%d denied by msm_thermal\n", cpu); + } + } +#endif + } +} + +static void little_down(void) +{ + int cpu, lowest_cpu; + + // Skip cpu 0 + for (cpu = 1; cpu < stats.total_cpus; cpu++) { + lowest_cpu = get_lowest_load_cpu(); + if (!cpu_online(lowest_cpu)) + continue; + if (lowest_cpu > 0 && lowest_cpu <= stats.total_cpus) { + if (check_down_lock(lowest_cpu)) + break; + cpu_down(lowest_cpu); + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] brought down cpu%d\n", lowest_cpu); + } + } + if (hotplug.target_cpus >= num_online_little_cpus()) + break; + } +} + +static void online_cpu(unsigned int target) +{ + unsigned int online_little; + + online_little = num_online_little_cpus(); + + /* + * Do not online more CPUs if max_cpus_online reached + * and cancel online task if target already achieved. + */ + if (target <= online_little || + online_little >= hotplug.max_cpus_online) + return; + + hotplug.target_cpus = target; + little_up(); +} + +static void offline_cpu(unsigned int target) +{ + unsigned int online_little; + + online_little = num_online_little_cpus(); + + /* + * Do not offline more CPUs if min_cpus_online reached + * and cancel offline task if target already achieved. + */ + if (target >= online_little || + online_little <= hotplug.min_cpus_online) + return; + + hotplug.target_cpus = target; + little_down(); +} + +static void reschedule_hotplug_work(void) +{ + queue_delayed_work_on(0, hotplug_wq, &hotplug_work, + msecs_to_jiffies(hotplug.update_rate)); +} + +static void __cpuinit msm_hotplug_work(struct work_struct *work) +{ + unsigned int i, target = 0, online_little; + + if (!msm_enabled) + return; + + if (hotplug.suspended) { + dprintk("%s: suspended.\n", MSM_HOTPLUG); + return; + } + + /* HACK: Prevent big cluster turned off when changing governor settings. */ + // Turn on first of big cores + if (prevent_big_off) { + if (!cpu_online(stats.total_cpus)) { +#ifdef CONFIG_THERMAL_MONITOR + // Only up a cpu if thermal control allows it ! + if(!msm_thermal_deny_cpu_up(stats.total_cpus)) { +#endif + cpu_up(stats.total_cpus); + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] brought up cpu%d\n", stats.total_cpus); + } +#ifdef CONFIG_THERMAL_MONITOR + } else { + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] bringup of cpu%d denied by msm_thermal\n", + stats.total_cpus); + } + } +#endif + } + } + + if (timeout_enabled) { + if (ktime_to_ms(ktime_get()) - pre_time > HOTPLUG_TIMEOUT) { + if (msm_hotplug_scr_suspended) { + msm_hotplug_suspend(); + return; + } + + timeout_enabled = false; + msm_hotplug_fingerprint_called = false; + } + goto reschedule; + } + + update_load_stats(); + + online_little = num_online_little_cpus(); + + if (stats.cur_max_load >= (hotplug.fast_lane_load * online_little) + && hotplug.fast_lane_load != 0) { + /* Enter the fast lane (disabled when 0) + this should always be kept high, so only when a big load drops + we rush into full power */ + online_cpu(hotplug.max_cpus_online); + big_updown(1); + goto reschedule; + } + + big_updown(0); + + /* If number of cpus locked, break out early */ + if (hotplug.min_cpus_online == stats.total_cpus) { + if (stats.online_cpus != hotplug.min_cpus_online) + online_cpu(hotplug.min_cpus_online); + goto reschedule; + } else if (hotplug.max_cpus_online == stats.min_cpus) { + if (stats.online_cpus != hotplug.max_cpus_online) + offline_cpu(hotplug.max_cpus_online); + goto reschedule; + } + + for (i = stats.min_cpus; loads[i].up_threshold; i++) { + if (stats.cur_avg_load <= loads[i].up_threshold + && stats.cur_avg_load > loads[i].down_threshold) { + target = i; + break; + } + } + + if (target > hotplug.max_cpus_online) + target = hotplug.max_cpus_online; + else if (target < hotplug.min_cpus_online) + target = hotplug.min_cpus_online; + + if (stats.online_cpus != target) { + if (target > stats.online_cpus) + online_cpu(target); + else if (target < stats.online_cpus) + offline_cpu(target); + } + +reschedule: + + dprintk("%s: cur_avg_load: %3u online_cpus: %u target: %u\n", MSM_HOTPLUG, + stats.cur_avg_load, stats.online_cpus, target); + reschedule_hotplug_work(); +} + +static void __cpuinit msm_hotplug_suspend(void) +{ + int online_cpus, online_cpus_big; + + mutex_lock(&hotplug.msm_hotplug_mutex); + hotplug.suspended = 1; + mutex_unlock(&hotplug.msm_hotplug_mutex); + + /* Flush hotplug workqueue */ + if (timeout_enabled) { + timeout_enabled = false; + msm_hotplug_fingerprint_called = false; + } else { + flush_workqueue(hotplug_wq); + cancel_delayed_work_sync(&hotplug_work); + } + + // Suspend to max allowed little cores + online_cpus = num_online_cpus(); + hotplug.target_cpus = hotplug.max_cpus_online_susp; + if (online_cpus != hotplug.target_cpus) { + if (hotplug.target_cpus > online_cpus) + little_up(); + else if (hotplug.target_cpus < online_cpus) + little_down(); + } + + // Suspend all big cores + online_cpus_big = num_online_big_cpus(); + hotplug.target_cpus_big = 0; + if (online_cpus_big != hotplug.target_cpus_big) { + if (hotplug.target_cpus_big > online_cpus_big) + big_up(); + else if (hotplug.target_cpus_big < online_cpus_big) + big_down(); + } + + pr_info("%s: suspended.\n", MSM_HOTPLUG); + + return; +} + +static void __cpuinit msm_hotplug_resume(void) +{ + int required_reschedule = 0, required_wakeup = 0, online_cpus, online_cpus_big; + + if (hotplug.suspended) { + mutex_lock(&hotplug.msm_hotplug_mutex); + hotplug.suspended = 0; + mutex_unlock(&hotplug.msm_hotplug_mutex); + required_wakeup = 1; + /* Initiate hotplug work if it was cancelled */ + required_reschedule = 1; + INIT_DELAYED_WORK(&hotplug_work, msm_hotplug_work); + } + + if (required_wakeup) { + + // Resume little cores, as many as max allowed + online_cpus = num_online_cpus(); + hotplug.target_cpus = hotplug.max_cpus_online; + if (online_cpus != hotplug.target_cpus) { + if (hotplug.target_cpus > online_cpus) + little_up(); + else if (hotplug.target_cpus < online_cpus) + little_down(); + } + + // Resume big cores, as many as max allowed + online_cpus_big = num_online_big_cpus(); + hotplug.target_cpus_big = hotplug.max_cpus_online_big; + if (online_cpus_big != hotplug.target_cpus_big) { + if (hotplug.target_cpus_big > online_cpus_big) + big_up(); + else if (hotplug.target_cpus_big < online_cpus_big) + big_down(); + } + + } + + /* Resume hotplug workqueue if required */ + if (required_reschedule) + reschedule_hotplug_work(); + + pr_info("%s: resumed.\n", MSM_HOTPLUG); + + return; +} + +void __cpuinit msm_hotplug_resume_timeout(void) +{ + if (timeout_enabled || !hotplug.suspended) + return; + + timeout_enabled = true; + pre_time = ktime_to_ms(ktime_get()); + msm_hotplug_resume(); +} +EXPORT_SYMBOL(msm_hotplug_resume_timeout); + +static int __cpuinit msm_hotplug_start(int start_immediately) +{ + int cpu, ret = 0; + struct down_lock *dl; + + hotplug_wq = + alloc_workqueue("msm_hotplug_wq", WQ_HIGHPRI | WQ_FREEZABLE, 0); + if (!hotplug_wq) { + pr_err("%s: Failed to allocate hotplug workqueue\n", + MSM_HOTPLUG); + ret = -ENOMEM; + goto err_out; + } + + stats.load_hist = kmalloc(sizeof(stats.hist_size), GFP_KERNEL); + if (!stats.load_hist) { + pr_err("%s: Failed to allocate memory\n", MSM_HOTPLUG); + ret = -ENOMEM; + goto err_dev; + } + + mutex_init(&stats.stats_mutex); + mutex_init(&hotplug.msm_hotplug_mutex); + + INIT_DELAYED_WORK(&hotplug_work, msm_hotplug_work); + for_each_possible_cpu(cpu) { + dl = &per_cpu(lock_info, cpu); + INIT_DELAYED_WORK(&dl->lock_rem, remove_down_lock); + } + + /* Fire up all CPUs */ + for_each_cpu_not(cpu, cpu_online_mask) { + if (cpu == 0) + continue; +#ifdef CONFIG_THERMAL_MONITOR + // Only up a cpu if thermal control allows it ! + if(!msm_thermal_deny_cpu_up(cpu)) { +#endif + cpu_up(cpu); + apply_down_lock(cpu); + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] brought up cpu%d\n", cpu); + } +#ifdef CONFIG_THERMAL_MONITOR + } else { + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] bringup of cpu%d denied by msm_thermal\n", cpu); + } + } +#endif + } + + if (start_immediately) + queue_delayed_work_on(0, hotplug_wq, &hotplug_work, 0); + else + queue_delayed_work_on(0, hotplug_wq, &hotplug_work, START_DELAY); + + if (!msm_hotplug_scr_suspended) + msm_hotplug_resume(); + return ret; +err_dev: + destroy_workqueue(hotplug_wq); +err_out: + msm_enabled = 0; + return ret; +} + +static void __cpuinit msm_hotplug_stop(void) +{ + int cpu; + struct down_lock *dl; + + flush_workqueue(hotplug_wq); + for_each_possible_cpu(cpu) { + dl = &per_cpu(lock_info, cpu); + cancel_delayed_work_sync(&dl->lock_rem); + } + cancel_delayed_work_sync(&hotplug_work); + + mutex_destroy(&hotplug.msm_hotplug_mutex); + mutex_destroy(&stats.stats_mutex); + kfree(stats.load_hist); + + hotplug.notif.notifier_call = NULL; + + destroy_workqueue(hotplug_wq); + + /* Fire up all CPUs */ + for_each_cpu_not(cpu, cpu_online_mask) { + if (cpu == 0) + continue; +#ifdef CONFIG_THERMAL_MONITOR + // Only up a cpu if thermal control allows it ! + if(!msm_thermal_deny_cpu_up(cpu)) { +#endif + cpu_up(cpu); + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] brought up cpu%d\n", cpu); + } +#ifdef CONFIG_THERMAL_MONITOR + } else { + if (unlikely(debug_dmesg)) { + pr_info("[msm_hotplug] bringup of cpu%d denied by msm_thermal\n", cpu); + } + } +#endif + } +} + +/************************** sysfs interface ************************/ + +static ssize_t show_enable_hotplug(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", msm_enabled); +} + +static ssize_t __cpuinit store_enable_hotplug(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 0 || val > 1) + return -EINVAL; + + if (val == msm_enabled) + return count; + + msm_enabled = val; + + if (msm_enabled) + + msm_hotplug_start(1); + + else + msm_hotplug_stop(); + + return count; +} + +static ssize_t show_update_rate(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.update_rate); +} + +static ssize_t store_update_rate(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + // load calculations : max. 500 per second / min. 1 every 5 second + if (val < 2 || val > 5000) + return -EINVAL; + + hotplug.update_rate = val; + + return count; +} + +static ssize_t show_load_levels(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + int i, len = 0; + + if (!buf) + return -EINVAL; + + // only little cores + for (i = 1; loads[i].up_threshold; i++) { + len += sprintf(buf + len, "%u ", i); + len += sprintf(buf + len, "%u ", loads[i].up_threshold); + len += sprintf(buf + len, "%u\n", loads[i].down_threshold); + } + + return len; +} + +static ssize_t store_load_levels(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val[3]; + + ret = sscanf(buf, "%u %u %u", &val[0], &val[1], &val[2]); + if (ret != ARRAY_SIZE(val)) + return -EINVAL; + + // only little cores + if (val[0] < 1 || val[0] > stats.total_cpus || val[2] > val[1]) + return -EINVAL; + + loads[val[0]].up_threshold = val[1]; + loads[val[0]].down_threshold = val[2]; + + return count; +} + +static ssize_t show_min_cpus_online(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.min_cpus_online); +} + +static ssize_t store_min_cpus_online(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 1 || val > stats.total_cpus) + return -EINVAL; + + if (hotplug.max_cpus_online < val) + hotplug.max_cpus_online = val; + + hotplug.min_cpus_online = val; + + return count; +} + +static ssize_t show_max_cpus_online(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n",hotplug.max_cpus_online); +} + +static ssize_t store_max_cpus_online(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 1 || val > stats.total_cpus) + return -EINVAL; + + if (hotplug.min_cpus_online > val) + hotplug.min_cpus_online = val; + + hotplug.max_cpus_online = val; + + return count; +} + +static ssize_t show_max_cpus_online_susp(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n",hotplug.max_cpus_online_susp); +} + +static ssize_t store_max_cpus_online_susp(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 1 || val > stats.total_cpus) + return -EINVAL; + + hotplug.max_cpus_online_susp = val; + + return count; +} + +static ssize_t show_offline_load(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.offline_load); +} + +static ssize_t store_offline_load(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 0 || val > 100) + return -EINVAL; + + hotplug.offline_load = val; + + return count; +} + +static ssize_t show_min_cpus_online_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.min_cpus_online_big); +} + +static ssize_t store_min_cpus_online_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val > stats.total_cpus_big) + return -EINVAL; + + if (hotplug.max_cpus_online_big < val) + hotplug.max_cpus_online_big = val; + + hotplug.min_cpus_online_big = val; + + return count; +} + +static ssize_t show_max_cpus_online_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n",hotplug.max_cpus_online_big); +} + +static ssize_t store_max_cpus_online_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 1 || val > stats.total_cpus_big) + return -EINVAL; + + if (hotplug.min_cpus_online_big > val) + hotplug.min_cpus_online_big = val; + + hotplug.max_cpus_online_big = val; + + return count; +} + +static ssize_t show_offline_load_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.offline_load_big); +} + +static ssize_t store_offline_load_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 0 || val > 100) + return -EINVAL; + + hotplug.offline_load_big = val; + + return count; +} + +static ssize_t show_online_load_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.online_load_big); +} + +static ssize_t store_online_load_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 0 || val > 100) + return -EINVAL; + + hotplug.online_load_big = val; + + return count; +} + +static ssize_t show_kick_in_load_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.kick_in_load_big); +} + +static ssize_t store_kick_in_load_big(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 0 || val > 100) + return -EINVAL; + + hotplug.kick_in_load_big = val; + + return count; +} + +static ssize_t show_fast_lane_load(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.fast_lane_load); +} + +static ssize_t store_fast_lane_load(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val != 0 || val < 70 || val > 100) + return -EINVAL; + + hotplug.fast_lane_load = val; + + return count; +} + +static ssize_t show_big_core_up_delay(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", hotplug.big_core_up_delay); +} + +static ssize_t store_big_core_up_delay(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + hotplug.big_core_up_delay = val; + + return count; +} + +static ssize_t show_io_is_busy(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", io_is_busy); +} + +static ssize_t store_io_is_busy(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 0 || val > 1) + return -EINVAL; + + io_is_busy = val != 0 ? true : false; + + return count; +} + +static ssize_t show_current_load(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", stats.cur_avg_load); +} + +static ssize_t show_current_cores(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "big.LITTLE : %u.%u\n", num_online_big_cpus(), num_online_little_cpus()); +} + +static ssize_t show_debug(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%u\n", debug_dmesg ? 1 : 0); +} + +static ssize_t store_debug(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + const char *buf, size_t count) +{ + int ret; + unsigned int val; + + ret = sscanf(buf, "%u", &val); + if (ret != 1) + return -EINVAL; + + if (val < 0 || val > 1) + return -EINVAL; + + debug_dmesg = val != 0 ? true : false; + + return count; +} + +static ssize_t show_version(struct device *dev, + struct device_attribute *msm_hotplug_attrs, + char *buf) +{ + return sprintf(buf, "%s\n", MSM_HOTPLUG_VERSION); +} + +static DEVICE_ATTR(msm_enabled, (S_IWUGO|S_IRUGO), show_enable_hotplug, store_enable_hotplug); +static DEVICE_ATTR(update_rate, (S_IWUGO|S_IRUGO), show_update_rate, store_update_rate); +static DEVICE_ATTR(load_levels, (S_IWUGO|S_IRUGO), show_load_levels, store_load_levels); +static DEVICE_ATTR(min_cpus_online, (S_IWUGO|S_IRUGO), show_min_cpus_online, + store_min_cpus_online); +static DEVICE_ATTR(max_cpus_online, (S_IWUGO|S_IRUGO), show_max_cpus_online, + store_max_cpus_online); +static DEVICE_ATTR(max_cpus_online_susp, (S_IWUGO|S_IRUGO), show_max_cpus_online_susp, + store_max_cpus_online_susp); +static DEVICE_ATTR(offline_load, (S_IWUGO|S_IRUGO), show_offline_load, store_offline_load); +static DEVICE_ATTR(min_cpus_online_big, (S_IWUGO|S_IRUGO), show_min_cpus_online_big, + store_min_cpus_online_big); +static DEVICE_ATTR(max_cpus_online_big, (S_IWUGO|S_IRUGO), show_max_cpus_online_big, + store_max_cpus_online_big); +static DEVICE_ATTR(offline_load_big, (S_IWUGO|S_IRUGO), show_offline_load_big, + store_offline_load_big); +static DEVICE_ATTR(online_load_big, (S_IWUGO|S_IRUGO), show_online_load_big, + store_online_load_big); +static DEVICE_ATTR(kick_in_load_big, (S_IWUGO|S_IRUGO), show_kick_in_load_big, + store_kick_in_load_big); +static DEVICE_ATTR(fast_lane_load, (S_IWUGO|S_IRUGO), show_fast_lane_load, + store_fast_lane_load); +static DEVICE_ATTR(big_core_up_delay, (S_IWUGO|S_IRUGO), show_big_core_up_delay, + store_big_core_up_delay); +static DEVICE_ATTR(io_is_busy, (S_IWUGO|S_IRUGO), show_io_is_busy, store_io_is_busy); +static DEVICE_ATTR(current_load, S_IRUGO, show_current_load, NULL); +static DEVICE_ATTR(current_cores, S_IRUGO, show_current_cores, NULL); +static DEVICE_ATTR(debug, (S_IWUGO|S_IRUGO), show_debug, store_debug); +static DEVICE_ATTR(version, S_IRUGO, show_version, NULL); + +static struct attribute *msm_hotplug_attrs[] = { + &dev_attr_msm_enabled.attr, + &dev_attr_update_rate.attr, + &dev_attr_load_levels.attr, + &dev_attr_min_cpus_online.attr, + &dev_attr_max_cpus_online.attr, + &dev_attr_max_cpus_online_susp.attr, + &dev_attr_offline_load.attr, + &dev_attr_min_cpus_online_big.attr, + &dev_attr_max_cpus_online_big.attr, + &dev_attr_offline_load_big.attr, + &dev_attr_online_load_big.attr, + &dev_attr_kick_in_load_big.attr, + &dev_attr_fast_lane_load.attr, + &dev_attr_big_core_up_delay.attr, + &dev_attr_io_is_busy.attr, + &dev_attr_current_load.attr, + &dev_attr_current_cores.attr, + &dev_attr_debug.attr, + &dev_attr_version.attr, + NULL, +}; + +static struct attribute_group attr_group = { + .attrs = msm_hotplug_attrs, +}; + +/************************** sysfs end ************************/ + +static int __cpuinit msm_hotplug_probe(struct platform_device *pdev) +{ + int ret = 0; + struct kobject *module_kobj; + + module_kobj = kset_find_obj(module_kset, MSM_HOTPLUG); + if (!module_kobj) { + pr_err("%s: Cannot find kobject for module\n", MSM_HOTPLUG); + goto err_dev; + } + + ret = sysfs_create_group(module_kobj, &attr_group); + if (ret) { + pr_err("%s: Failed to create sysfs: %d\n", MSM_HOTPLUG, ret); + goto err_dev; + } + + if (msm_enabled) { + ret = msm_hotplug_start(0); + if (ret != 0) + goto err_dev; + } + + return ret; +err_dev: + module_kobj = NULL; + return ret; +} + +static struct platform_device msm_hotplug_device = { + .name = MSM_HOTPLUG, + .id = -1, +}; + +static int __cpuinit msm_hotplug_remove(struct platform_device *pdev) +{ + if (msm_enabled) + msm_hotplug_stop(); + + return 0; +} + +static struct platform_driver msm_hotplug_driver = { + .probe = msm_hotplug_probe, + .remove = msm_hotplug_remove, + .driver = { + .name = MSM_HOTPLUG, + .owner = THIS_MODULE, + }, +}; + +static int __cpuinit msm_hotplug_fb_notifier_callback(struct notifier_block *self, + unsigned long event, void *data) +{ + struct fb_event *evdata = data; + int *blank; + + if (!msm_enabled) + return 0; + + if (event == FB_EVENT_BLANK) { + blank = evdata->data; + + switch (*blank) { + case FB_BLANK_UNBLANK: + msm_hotplug_scr_suspended = false; + msm_hotplug_resume(); + break; + case FB_BLANK_POWERDOWN: + prevent_big_off = false; + msm_hotplug_scr_suspended = true; + msm_hotplug_suspend(); + break; + } + } + + return 0; +} + +struct notifier_block msm_hotplug_fb_notif = { + .notifier_call = msm_hotplug_fb_notifier_callback, +}; + +static int __init msm_hotplug_init(void) +{ + int ret = false; + + if (stats.total_cpus + stats.total_cpus_big != NR_CPUS) { + pr_info("%s: Little cores and big cores are not match with this device: %d\n", + MSM_HOTPLUG, ret); + return -EPERM; + } + + ret = fb_register_client(&msm_hotplug_fb_notif); + if (ret) { + pr_info("%s: FB register failed: %d\n", MSM_HOTPLUG, ret); + return ret; + } + + ret = platform_driver_register(&msm_hotplug_driver); + if (ret) { + pr_info("%s: Driver register failed: %d\n", MSM_HOTPLUG, ret); + return ret; + } + + ret = platform_device_register(&msm_hotplug_device); + if (ret) { + pr_info("%s: Device register failed: %d\n", MSM_HOTPLUG, ret); + return ret; + } + + pr_info("%s: Device init\n", MSM_HOTPLUG); + + return ret; +} + +static void __exit msm_hotplug_exit(void) +{ + platform_device_unregister(&msm_hotplug_device); + platform_driver_unregister(&msm_hotplug_driver); + fb_unregister_client(&msm_hotplug_fb_notif); +} + +late_initcall(msm_hotplug_init); +module_exit(msm_hotplug_exit); + +MODULE_AUTHOR("yank555.lu "); +MODULE_DESCRIPTION("MSM Hotplug Driver for big.LITTLE"); +MODULE_LICENSE("GPLv2"); diff --git a/drivers/soc/qcom/msm_performance.c b/drivers/soc/qcom/msm_performance.c index 1ed360073171a..32a648df310be 100644 --- a/drivers/soc/qcom/msm_performance.c +++ b/drivers/soc/qcom/msm_performance.c @@ -171,6 +171,7 @@ device_param_cb(num_clusters, ¶m_ops_num_clusters, NULL, 0644); static int set_max_cpus(const char *buf, const struct kernel_param *kp) { +#if 0 unsigned int i, ntokens = 0; const char *cp = buf; int val; @@ -201,6 +202,7 @@ static int set_max_cpus(const char *buf, const struct kernel_param *kp) } schedule_delayed_work(&evaluate_hotplug_work, 0); +#endif return 0; } @@ -1005,6 +1007,7 @@ device_param_cb(iowait_ceiling_pct, ¶m_ops_iowait_ceiling_pct, NULL, 0644); static int set_workload_detect(const char *buf, const struct kernel_param *kp) { +#if 0 unsigned int val, i; struct cluster *i_cl; unsigned long flags; @@ -1046,6 +1049,8 @@ static int set_workload_detect(const char *buf, const struct kernel_param *kp) } wake_up_process(notify_thread); +#endif + return 0; } diff --git a/drivers/thermal/msm_thermal.c b/drivers/thermal/msm_thermal.c index f67b80b4d6736..55d76b96b3cc7 100644 --- a/drivers/thermal/msm_thermal.c +++ b/drivers/thermal/msm_thermal.c @@ -2579,6 +2579,13 @@ static __ref int do_hotplug(void *data) return ret; } + +#ifdef CONFIG_MSM_HOTPLUG +int msm_thermal_deny_cpu_up(uint32_t cpu) { + return cpus_offlined & BIT(cpu); +} +#endif + #else static void __ref do_core_control(long temp) { diff --git a/include/linux/msm_hotplug.h b/include/linux/msm_hotplug.h new file mode 100644 index 0000000000000..a5b6c2074a7df --- /dev/null +++ b/include/linux/msm_hotplug.h @@ -0,0 +1,23 @@ +/* + * MSM Hotplug Driver + * + * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014, Fluxi + * Copyright (c) 2013-2015, Pranav Vashi + * Copyright (c) 2015, jollaman999 / Adaptive for big and little. + * Copyright (c) 2016, yank555.lu / hotplug big core based on load + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef _LINUX_MSM_HOTPLUG_H +#define _LINUX_MSM_HOTPLUG_H + +extern unsigned int msm_enabled; +extern bool msm_hotplug_scr_suspended; +extern bool msm_hotplug_fingerprint_called; + +#endif /* _LINUX_MSM_HOTPLUG_H */ diff --git a/include/linux/msm_thermal.h b/include/linux/msm_thermal.h index cee918c843028..eb99cd718ee39 100644 --- a/include/linux/msm_thermal.h +++ b/include/linux/msm_thermal.h @@ -332,4 +332,10 @@ static inline void devmgr_unregister_mitigation_client( } #endif +#ifdef CONFIG_SMP +#ifdef CONFIG_MSM_HOTPLUG +int msm_thermal_deny_cpu_up(uint32_t cpu); +#endif +#endif + #endif /*__MSM_THERMAL_H*/ diff --git a/kernel/cpu.c b/kernel/cpu.c index 79214cb8ddbe3..2c505f7009040 100755 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -24,6 +24,10 @@ #include "smpboot.h" +#ifdef CONFIG_MSM_HOTPLUG +#include +#endif + #ifdef CONFIG_SMP /* Serializes the updates to cpu_online_mask, cpu_present_mask */ static DEFINE_MUTEX(cpu_add_remove_lock); @@ -449,6 +453,13 @@ int __cpuinit cpu_up(unsigned int cpu) pg_data_t *pgdat; #endif +#ifdef CONFIG_MSM_HOTPLUG + if (msm_hotplug_scr_suspended && msm_enabled) { + if (cpu >= 4 && !msm_hotplug_fingerprint_called) + return 0; + } +#endif + if (!cpu_possible(cpu)) { printk(KERN_ERR "can't online cpu %d because it is not " "configured as may-hotadd at boot time\n", cpu); From 797d85201296447a481da9f2cd851de2952abf3f Mon Sep 17 00:00:00 2001 From: benschhold Date: Sun, 13 Nov 2016 18:24:50 +0100 Subject: [PATCH 02/75] defconfig: msm hotplug --- arch/arm64/configs/cm_oneplus2_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index be2f84d2500d1..cbc12f5ca60f1 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -584,3 +584,4 @@ CONFIG_CRYPTO_AES_ARM64_CE_BLK=y CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y CONFIG_CRYPTO_CRC32_ARM64=y CONFIG_QMI_ENCDEC=y +CONFIG_MSM_HOTPLUG=y From 34806bf4c031046df0d10e413df718c1666785ff Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Thu, 25 Jun 2015 15:01:02 -0700 Subject: [PATCH 03/75] compiler-gcc: integrate the various compiler-gcc[345].h files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit cb984d101b30eb7478d32df56a0023e4603cba7f upstream. As gcc major version numbers are going to advance rather rapidly in the future, there's no real value in separate files for each compiler version. Deduplicate some of the macros #defined in each file too. Neaten comments using normal kernel commenting style. Signed-off-by: Joe Perches Cc: Andi Kleen Cc: Michal Marek Cc: Segher Boessenkool Cc: Sasha Levin Cc: Anton Blanchard Cc: Alan Modra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [ philm: backport to 3.10-stable ] Signed-off-by: Philip Müller Signed-off-by: Willy Tarreau --- include/linux/compiler-gcc.h | 114 ++++++++++++++++++++++++++++++++-- include/linux/compiler-gcc3.h | 23 ------- include/linux/compiler-gcc4.h | 88 -------------------------- include/linux/compiler-gcc5.h | 66 -------------------- 4 files changed, 110 insertions(+), 181 deletions(-) delete mode 100644 include/linux/compiler-gcc3.h delete mode 100644 include/linux/compiler-gcc4.h delete mode 100644 include/linux/compiler-gcc5.h diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 02ae99e8e6d38..65856c3599b4a 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -100,10 +100,116 @@ #define __maybe_unused __attribute__((unused)) #define __always_unused __attribute__((unused)) -#define __gcc_header(x) #x -#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) -#define gcc_header(x) _gcc_header(x) -#include gcc_header(__GNUC__) +/* gcc version specific checks */ + +#if GCC_VERSION < 30200 +# error Sorry, your compiler is too old - please upgrade it. +#endif + +#if GCC_VERSION < 30300 +# define __used __attribute__((__unused__)) +#else +# define __used __attribute__((__used__)) +#endif + +#ifdef CONFIG_GCOV_KERNEL +# if GCC_VERSION < 30400 +# error "GCOV profiling support for gcc versions below 3.4 not included" +# endif /* __GNUC_MINOR__ */ +#endif /* CONFIG_GCOV_KERNEL */ + +#if GCC_VERSION >= 30400 +#define __must_check __attribute__((warn_unused_result)) +#endif + +#if GCC_VERSION >= 40000 + +/* GCC 4.1.[01] miscompiles __weak */ +#ifdef __KERNEL__ +# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 +# error Your version of gcc miscompiles the __weak directive +# endif +#endif + +#define __used __attribute__((__used__)) +#define __compiler_offsetof(a, b) \ + __builtin_offsetof(a, b) + +#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 +# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) +#endif + +#if GCC_VERSION >= 40300 +/* Mark functions as cold. gcc will assume any path leading to a call + * to them will be unlikely. This means a lot of manual unlikely()s + * are unnecessary now for any paths leading to the usual suspects + * like BUG(), printk(), panic() etc. [but let's keep them for now for + * older compilers] + * + * Early snapshots of gcc 4.3 don't support this and we can't detect this + * in the preprocessor, but we can live with this because they're unreleased. + * Maketime probing would be overkill here. + * + * gcc also has a __attribute__((__hot__)) to move hot functions into + * a special section, but I don't see any sense in this right now in + * the kernel context + */ +#define __cold __attribute__((__cold__)) + +#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) + +#ifndef __CHECKER__ +# define __compiletime_warning(message) __attribute__((warning(message))) +# define __compiletime_error(message) __attribute__((error(message))) +#endif /* __CHECKER__ */ +#endif /* GCC_VERSION >= 40300 */ + +#if GCC_VERSION >= 40500 +/* + * Mark a position in code as unreachable. This can be used to + * suppress control flow warnings after asm blocks that transfer + * control elsewhere. + * + * Early snapshots of gcc 4.5 don't support this and we can't detect + * this in the preprocessor, but we can live with this because they're + * unreleased. Really, we need to have autoconf for the kernel. + */ +#define unreachable() __builtin_unreachable() + +/* Mark a function definition as prohibited from being cloned. */ +#define __noclone __attribute__((__noclone__)) + +#endif /* GCC_VERSION >= 40500 */ + +#if GCC_VERSION >= 40600 +/* + * Tell the optimizer that something else uses this function or variable. + */ +#define __visible __attribute__((externally_visible)) +#endif + +/* + * GCC 'asm goto' miscompiles certain code sequences: + * + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 + * + * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. + * + * (asm goto is automatically volatile - the naming reflects this.) + */ +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) + +#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP +#if GCC_VERSION >= 40400 +#define __HAVE_BUILTIN_BSWAP32__ +#define __HAVE_BUILTIN_BSWAP64__ +#endif +#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) +#define __HAVE_BUILTIN_BSWAP16__ +#endif +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ + +#endif /* gcc version >= 40000 specific checks */ #if !defined(__noclone) #define __noclone /* not needed */ diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h deleted file mode 100644 index 7d89febe4d793..0000000000000 --- a/include/linux/compiler-gcc3.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __LINUX_COMPILER_H -#error "Please don't include directly, include instead." -#endif - -#if GCC_VERSION < 30200 -# error Sorry, your compiler is too old - please upgrade it. -#endif - -#if GCC_VERSION >= 30300 -# define __used __attribute__((__used__)) -#else -# define __used __attribute__((__unused__)) -#endif - -#if GCC_VERSION >= 30400 -#define __must_check __attribute__((warn_unused_result)) -#endif - -#ifdef CONFIG_GCOV_KERNEL -# if GCC_VERSION < 30400 -# error "GCOV profiling support for gcc versions below 3.4 not included" -# endif /* __GNUC_MINOR__ */ -#endif /* CONFIG_GCOV_KERNEL */ diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h deleted file mode 100644 index 2507fd2a1eb4f..0000000000000 --- a/include/linux/compiler-gcc4.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef __LINUX_COMPILER_H -#error "Please don't include directly, include instead." -#endif - -/* GCC 4.1.[01] miscompiles __weak */ -#ifdef __KERNEL__ -# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 -# error Your version of gcc miscompiles the __weak directive -# endif -#endif - -#define __used __attribute__((__used__)) -#define __must_check __attribute__((warn_unused_result)) -#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) - -#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 -# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) -#endif - -#if GCC_VERSION >= 40300 -/* Mark functions as cold. gcc will assume any path leading to a call - to them will be unlikely. This means a lot of manual unlikely()s - are unnecessary now for any paths leading to the usual suspects - like BUG(), printk(), panic() etc. [but let's keep them for now for - older compilers] - - Early snapshots of gcc 4.3 don't support this and we can't detect this - in the preprocessor, but we can live with this because they're unreleased. - Maketime probing would be overkill here. - - gcc also has a __attribute__((__hot__)) to move hot functions into - a special section, but I don't see any sense in this right now in - the kernel context */ -#define __cold __attribute__((__cold__)) - -#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) - -#ifndef __CHECKER__ -# define __compiletime_warning(message) __attribute__((warning(message))) -# define __compiletime_error(message) __attribute__((error(message))) -#endif /* __CHECKER__ */ -#endif /* GCC_VERSION >= 40300 */ - -#if GCC_VERSION >= 40500 -/* - * Mark a position in code as unreachable. This can be used to - * suppress control flow warnings after asm blocks that transfer - * control elsewhere. - * - * Early snapshots of gcc 4.5 don't support this and we can't detect - * this in the preprocessor, but we can live with this because they're - * unreleased. Really, we need to have autoconf for the kernel. - */ -#define unreachable() __builtin_unreachable() - -/* Mark a function definition as prohibited from being cloned. */ -#define __noclone __attribute__((__noclone__)) - -#endif /* GCC_VERSION >= 40500 */ - -#if GCC_VERSION >= 40600 -/* - * Tell the optimizer that something else uses this function or variable. - */ -#define __visible __attribute__((externally_visible)) -#endif - -/* - * GCC 'asm goto' miscompiles certain code sequences: - * - * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 - * - * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. - * Fixed in GCC 4.8.2 and later versions. - * - * (asm goto is automatically volatile - the naming reflects this.) - */ -#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) - -#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -#if GCC_VERSION >= 40400 -#define __HAVE_BUILTIN_BSWAP32__ -#define __HAVE_BUILTIN_BSWAP64__ -#endif -#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) -#define __HAVE_BUILTIN_BSWAP16__ -#endif -#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h deleted file mode 100644 index cdd1cc202d51e..0000000000000 --- a/include/linux/compiler-gcc5.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef __LINUX_COMPILER_H -#error "Please don't include directly, include instead." -#endif - -#define __used __attribute__((__used__)) -#define __must_check __attribute__((warn_unused_result)) -#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) - -/* Mark functions as cold. gcc will assume any path leading to a call - to them will be unlikely. This means a lot of manual unlikely()s - are unnecessary now for any paths leading to the usual suspects - like BUG(), printk(), panic() etc. [but let's keep them for now for - older compilers] - - Early snapshots of gcc 4.3 don't support this and we can't detect this - in the preprocessor, but we can live with this because they're unreleased. - Maketime probing would be overkill here. - - gcc also has a __attribute__((__hot__)) to move hot functions into - a special section, but I don't see any sense in this right now in - the kernel context */ -#define __cold __attribute__((__cold__)) - -#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) - -#ifndef __CHECKER__ -# define __compiletime_warning(message) __attribute__((warning(message))) -# define __compiletime_error(message) __attribute__((error(message))) -#endif /* __CHECKER__ */ - -/* - * Mark a position in code as unreachable. This can be used to - * suppress control flow warnings after asm blocks that transfer - * control elsewhere. - * - * Early snapshots of gcc 4.5 don't support this and we can't detect - * this in the preprocessor, but we can live with this because they're - * unreleased. Really, we need to have autoconf for the kernel. - */ -#define unreachable() __builtin_unreachable() - -/* Mark a function definition as prohibited from being cloned. */ -#define __noclone __attribute__((__noclone__)) - -/* - * Tell the optimizer that something else uses this function or variable. - */ -#define __visible __attribute__((externally_visible)) - -/* - * GCC 'asm goto' miscompiles certain code sequences: - * - * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 - * - * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. - * Fixed in GCC 4.8.2 and later versions. - * - * (asm goto is automatically volatile - the naming reflects this.) - */ -#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) - -#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -#define __HAVE_BUILTIN_BSWAP32__ -#define __HAVE_BUILTIN_BSWAP64__ -#define __HAVE_BUILTIN_BSWAP16__ -#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ From 4491f9e1af8d91a82013c1847fca68f2cf04a3d4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 4 Mar 2016 15:59:42 +0100 Subject: [PATCH 04/75] sched/cputime: Fix steal time accounting vs. CPU hotplug commit e9532e69b8d1d1284e8ecf8d2586de34aec61244 upstream. On CPU hotplug the steal time accounting can keep a stale rq->prev_steal_time value over CPU down and up. So after the CPU comes up again the delta calculation in steal_account_process_tick() wreckages itself due to the unsigned math: u64 steal = paravirt_steal_clock(smp_processor_id()); steal -= this_rq()->prev_steal_time; So if steal is smaller than rq->prev_steal_time we end up with an insane large value which then gets added to rq->prev_steal_time, resulting in a permanent wreckage of the accounting. As a consequence the per CPU stats in /proc/stat become stale. Nice trick to tell the world how idle the system is (100%) while the CPU is 100% busy running tasks. Though we prefer realistic numbers. None of the accounting values which use a previous value to account for fractions is reset at CPU hotplug time. update_rq_clock_task() has a sanity check for prev_irq_time and prev_steal_time_rq, but that sanity check solely deals with clock warps and limits the /proc/stat visible wreckage. The prev_time values are still wrong. Solution is simple: Reset rq->prev_*_time when the CPU is plugged in again. Signed-off-by: Thomas Gleixner Acked-by: Rik van Riel Cc: Cc: Frederic Weisbecker Cc: Glauber Costa Cc: Linus Torvalds Cc: Peter Zijlstra Fixes: commit 095c0aa83e52 "sched: adjust scheduler cpu power for stolen time" Fixes: commit aa483808516c "sched: Remove irq time from available CPU power" Fixes: commit e6e6685accfa "KVM guest: Steal time accounting" Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1603041539490.3686@nanos Signed-off-by: Ingo Molnar Signed-off-by: Willy Tarreau --- kernel/sched/core.c | 1 + kernel/sched/sched.h | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 6d9bea75e6ba0..32f3e87bf3c14 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7303,6 +7303,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) set_window_start(rq); raw_spin_unlock_irqrestore(&rq->lock, flags); rq->calc_load_update = calc_load_update; + account_reset_rq(rq); break; case CPU_ONLINE: diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 495316180c98f..bde547591ed3e 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1730,3 +1730,16 @@ static inline u64 irq_time_read(int cpu) } #endif /* CONFIG_64BIT */ #endif /* CONFIG_IRQ_TIME_ACCOUNTING */ + +static inline void account_reset_rq(struct rq *rq) +{ +#ifdef CONFIG_IRQ_TIME_ACCOUNTING + rq->prev_irq_time = 0; +#endif +#ifdef CONFIG_PARAVIRT + rq->prev_steal_time = 0; +#endif +#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING + rq->prev_steal_time_rq = 0; +#endif +} From 27f1bc3d91e78ec6dfaa9c655f9980d0e7fd5f94 Mon Sep 17 00:00:00 2001 From: benschhold Date: Sun, 13 Nov 2016 19:27:08 +0100 Subject: [PATCH 05/75] Revert "soc: qcom: msm_hotplug v2.3" This reverts commit 91fe8d2cf0a4f811a193b8f11f2dcabf57bd8481. --- drivers/soc/qcom/msm_hotplug.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/soc/qcom/msm_hotplug.c b/drivers/soc/qcom/msm_hotplug.c index e0476e3821fa9..793da34a3b3d6 100644 --- a/drivers/soc/qcom/msm_hotplug.c +++ b/drivers/soc/qcom/msm_hotplug.c @@ -730,7 +730,7 @@ static void reschedule_hotplug_work(void) msecs_to_jiffies(hotplug.update_rate)); } -static void __cpuinit msm_hotplug_work(struct work_struct *work) +static void msm_hotplug_work(struct work_struct *work) { unsigned int i, target = 0, online_little; @@ -832,7 +832,7 @@ static void __cpuinit msm_hotplug_work(struct work_struct *work) reschedule_hotplug_work(); } -static void __cpuinit msm_hotplug_suspend(void) +static void msm_hotplug_suspend(void) { int online_cpus, online_cpus_big; @@ -874,7 +874,7 @@ static void __cpuinit msm_hotplug_suspend(void) return; } -static void __cpuinit msm_hotplug_resume(void) +static void msm_hotplug_resume(void) { int required_reschedule = 0, required_wakeup = 0, online_cpus, online_cpus_big; @@ -921,7 +921,7 @@ static void __cpuinit msm_hotplug_resume(void) return; } -void __cpuinit msm_hotplug_resume_timeout(void) +void msm_hotplug_resume_timeout(void) { if (timeout_enabled || !hotplug.suspended) return; @@ -932,7 +932,7 @@ void __cpuinit msm_hotplug_resume_timeout(void) } EXPORT_SYMBOL(msm_hotplug_resume_timeout); -static int __cpuinit msm_hotplug_start(int start_immediately) +static int msm_hotplug_start(int start_immediately) { int cpu, ret = 0; struct down_lock *dl; @@ -999,7 +999,7 @@ static int __cpuinit msm_hotplug_start(int start_immediately) return ret; } -static void __cpuinit msm_hotplug_stop(void) +static void msm_hotplug_stop(void) { int cpu; struct down_lock *dl; @@ -1050,7 +1050,7 @@ static ssize_t show_enable_hotplug(struct device *dev, return sprintf(buf, "%u\n", msm_enabled); } -static ssize_t __cpuinit store_enable_hotplug(struct device *dev, +static ssize_t store_enable_hotplug(struct device *dev, struct device_attribute *msm_hotplug_attrs, const char *buf, size_t count) { @@ -1573,7 +1573,7 @@ static struct attribute_group attr_group = { /************************** sysfs end ************************/ -static int __cpuinit msm_hotplug_probe(struct platform_device *pdev) +static int msm_hotplug_probe(struct platform_device *pdev) { int ret = 0; struct kobject *module_kobj; @@ -1607,7 +1607,7 @@ static struct platform_device msm_hotplug_device = { .id = -1, }; -static int __cpuinit msm_hotplug_remove(struct platform_device *pdev) +static int msm_hotplug_remove(struct platform_device *pdev) { if (msm_enabled) msm_hotplug_stop(); @@ -1624,7 +1624,7 @@ static struct platform_driver msm_hotplug_driver = { }, }; -static int __cpuinit msm_hotplug_fb_notifier_callback(struct notifier_block *self, +static int msm_hotplug_fb_notifier_callback(struct notifier_block *self, unsigned long event, void *data) { struct fb_event *evdata = data; From 840e646dad49e808d17435130ced06224918822b Mon Sep 17 00:00:00 2001 From: jollaman999 Date: Sun, 7 Aug 2016 10:23:49 +0200 Subject: [PATCH 06/75] Get rid of __cpuinit - squashed (jollaman999) Remove one of miss removed __cpuinitdata kbuild: drop cpuinit/cpuexit checks in modpost With the removal of cpuinit/cpuexit we no longer need to do section mismatch checks on these sections. Drop it from modpost. Signed-off-by: Dennis Rassmann cpuinit: turn __cpuinit into nops now that there's no users left, turn __cpuinit into a nop for now, to avoid breaking any in-flight code. In a few releases we can just drop it entirely. Signed-off-by: Arjan van de Ven Signed-off-by: Dennis Rassmann Get rid of __cpuinit This commit is the result of find . -name '*.c' | xargs sed -i 's/ __cpuinit / /g' find . -name '*.c' | xargs sed -i 's/ __cpuexit / /g' find . -name '*.c' | xargs sed -i 's/ __cpuinitdata / /g' find . -name '*.c' | xargs sed -i 's/ __cpuinit$//g' find ./arch/ -name '*.h' | xargs sed -i 's/ __cpuinit//g' find . -name '*.c' | xargs sed -i 's/^__cpuinit //g' find . -name '*.c' | xargs sed -i 's/^__cpuinitdata //g' find . -name '*.c' | xargs sed -i 's/\*__cpuinit /\*/g' find . -name '*.c' | xargs sed -i 's/ __cpuinitconst / /g' find . -name '*.h' | xargs sed -i 's/ __cpuinit / /g' find . -name '*.h' | xargs sed -i 's/ __cpuinitdata / /g' git add . git reset include/linux/init.h git checkout -- include/linux/init.h Change-Id: Idf1210c65a0a3936b96d10c8aeae63f1f6809c45 Signed-off-by: mydongistiny --- arch/alpha/kernel/smp.c | 10 +-- arch/alpha/kernel/traps.c | 4 +- arch/arc/include/asm/irq.h | 2 +- arch/arc/kernel/irq.c | 2 +- arch/arc/kernel/setup.c | 8 +- arch/arc/kernel/smp.c | 4 +- arch/arc/kernel/time.c | 6 +- arch/arc/mm/cache_arc700.c | 4 +- arch/arc/mm/tlb.c | 4 +- arch/arm/common/mcpm_platsmp.c | 4 +- arch/arm/kernel/hw_breakpoint.c | 4 +- arch/arm/kernel/perf_event_cpu.c | 4 +- arch/arm/kernel/psci_smp.c | 2 +- arch/arm/kernel/smp.c | 18 ++-- arch/arm/kernel/smp_twd.c | 6 +- arch/arm/lib/delay.c | 2 +- arch/arm/mach-exynos/platsmp.c | 4 +- arch/arm/mach-highbank/platsmp.c | 2 +- arch/arm/mach-imx/platsmp.c | 2 +- arch/arm/mach-msm/platsmp.c | 28 +++--- arch/arm/mach-msm/timer.c | 2 +- arch/arm/mach-mvebu/platsmp.c | 4 +- arch/arm/mach-omap2/omap-mpuss-lowpower.c | 2 +- arch/arm/mach-omap2/omap-smp.c | 4 +- arch/arm/mach-omap2/omap-wakeupgen.c | 2 +- arch/arm/mach-prima2/platsmp.c | 4 +- arch/arm/mach-shmobile/smp-emev2.c | 2 +- arch/arm/mach-shmobile/smp-r8a7779.c | 2 +- arch/arm/mach-shmobile/smp-sh73a0.c | 2 +- arch/arm/mach-socfpga/platsmp.c | 2 +- arch/arm/mach-spear/generic.h | 2 +- arch/arm/mach-spear/platsmp.c | 4 +- arch/arm/mach-tegra/platsmp.c | 4 +- arch/arm/mach-tegra/pm.c | 2 +- arch/arm/mach-ux500/platsmp.c | 4 +- arch/arm/mach-zynq/common.h | 2 +- arch/arm/mach-zynq/platsmp.c | 6 +- arch/arm/plat-versatile/platsmp.c | 6 +- arch/arm64/kernel/debug-monitors.c | 6 +- arch/arm64/kernel/hw_breakpoint.c | 4 +- arch/arm64/kernel/perf_event.c | 4 +- arch/arm64/kernel/smp.c | 6 +- arch/blackfin/kernel/perf_event.c | 2 +- arch/blackfin/kernel/setup.c | 4 +- arch/blackfin/mach-bf561/smp.c | 6 +- arch/blackfin/mach-common/cache-c.c | 4 +- arch/blackfin/mach-common/ints-priority.c | 2 +- arch/blackfin/mach-common/smp.c | 12 +-- arch/cris/arch-v32/kernel/smp.c | 2 +- arch/frv/kernel/setup.c | 2 +- arch/hexagon/kernel/setup.c | 2 +- arch/hexagon/kernel/smp.c | 4 +- arch/ia64/kernel/acpi.c | 4 +- arch/ia64/kernel/err_inject.c | 8 +- arch/ia64/kernel/mca.c | 12 +-- arch/ia64/kernel/numa.c | 4 +- arch/ia64/kernel/palinfo.c | 4 +- arch/ia64/kernel/salinfo.c | 4 +- arch/ia64/kernel/setup.c | 10 +-- arch/ia64/kernel/smpboot.c | 8 +- arch/ia64/kernel/topology.c | 16 ++-- arch/ia64/mm/contig.c | 2 +- arch/ia64/mm/discontig.c | 2 +- arch/ia64/mm/numa.c | 2 +- arch/ia64/sn/kernel/setup.c | 8 +- arch/ia64/xen/hypervisor.c | 2 +- arch/m32r/kernel/smpboot.c | 2 +- arch/metag/kernel/perf/perf_event.c | 4 +- arch/metag/kernel/smp.c | 16 ++-- arch/metag/kernel/traps.c | 2 +- arch/mips/ath79/setup.c | 2 +- arch/mips/cavium-octeon/octeon-irq.c | 12 +-- arch/mips/cavium-octeon/smp.c | 6 +- arch/mips/include/asm/uasm.h | 4 +- arch/mips/kernel/cevt-bcm1480.c | 2 +- arch/mips/kernel/cevt-gic.c | 2 +- arch/mips/kernel/cevt-r4k.c | 2 +- arch/mips/kernel/cevt-sb1250.c | 2 +- arch/mips/kernel/cevt-smtc.c | 2 +- arch/mips/kernel/cpu-probe.c | 14 +-- arch/mips/kernel/smp-bmips.c | 6 +- arch/mips/kernel/smp-mt.c | 6 +- arch/mips/kernel/smp-up.c | 6 +- arch/mips/kernel/smp.c | 6 +- arch/mips/kernel/smtc.c | 2 +- arch/mips/kernel/spram.c | 14 +-- arch/mips/kernel/sync-r4k.c | 12 +-- arch/mips/kernel/traps.c | 10 +-- arch/mips/kernel/watch.c | 2 +- arch/mips/lantiq/irq.c | 2 +- arch/mips/lib/uncached.c | 2 +- arch/mips/mm/c-octeon.c | 6 +- arch/mips/mm/c-r3k.c | 8 +- arch/mips/mm/c-r4k.c | 34 +++---- arch/mips/mm/c-tx39.c | 2 +- arch/mips/mm/cache.c | 2 +- arch/mips/mm/page.c | 20 ++--- arch/mips/mm/sc-ip22.c | 2 +- arch/mips/mm/sc-mips.c | 2 +- arch/mips/mm/sc-r5k.c | 2 +- arch/mips/mm/sc-rm7k.c | 12 +-- arch/mips/mm/tlb-r3k.c | 2 +- arch/mips/mm/tlb-r4k.c | 4 +- arch/mips/mm/tlb-r8k.c | 4 +- arch/mips/mm/tlbex.c | 90 +++++++++---------- arch/mips/mti-malta/malta-smtc.c | 6 +- arch/mips/mti-malta/malta-time.c | 2 +- arch/mips/mti-sead3/sead3-time.c | 2 +- arch/mips/netlogic/common/smp.c | 4 +- arch/mips/netlogic/common/time.c | 2 +- arch/mips/netlogic/xlr/wakeup.c | 2 +- arch/mips/pci/pci-ip27.c | 2 +- arch/mips/pmcs-msp71xx/msp_smtc.c | 6 +- arch/mips/pmcs-msp71xx/msp_time.c | 2 +- arch/mips/pnx833x/common/interrupts.c | 2 +- arch/mips/powertv/time.c | 2 +- arch/mips/ralink/irq.c | 2 +- arch/mips/sgi-ip27/ip27-init.c | 4 +- arch/mips/sgi-ip27/ip27-smp.c | 6 +- arch/mips/sgi-ip27/ip27-timer.c | 6 +- arch/mips/sgi-ip27/ip27-xtalk.c | 6 +- arch/mips/sibyte/bcm1480/smp.c | 8 +- arch/mips/sibyte/sb1250/smp.c | 8 +- arch/openrisc/kernel/setup.c | 2 +- arch/parisc/kernel/firmware.c | 12 +-- arch/parisc/kernel/hardware.c | 2 +- arch/parisc/kernel/processor.c | 6 +- arch/parisc/kernel/smp.c | 6 +- arch/powerpc/include/asm/rtas.h | 4 +- arch/powerpc/include/asm/vdso.h | 2 +- arch/powerpc/kernel/cacheinfo.c | 30 +++---- arch/powerpc/kernel/rtas.c | 4 +- arch/powerpc/kernel/smp.c | 4 +- arch/powerpc/kernel/sysfs.c | 6 +- arch/powerpc/kernel/time.c | 2 +- arch/powerpc/kernel/vdso.c | 2 +- arch/powerpc/mm/44x_mmu.c | 6 +- arch/powerpc/mm/hash_utils_64.c | 2 +- arch/powerpc/mm/mmu_context_nohash.c | 4 +- arch/powerpc/mm/numa.c | 6 +- arch/powerpc/mm/tlb_nohash.c | 2 +- arch/powerpc/perf/core-book3s.c | 4 +- arch/powerpc/platforms/44x/currituck.c | 4 +- arch/powerpc/platforms/44x/iss4xx.c | 4 +- arch/powerpc/platforms/85xx/smp.c | 6 +- arch/powerpc/platforms/powermac/smp.c | 2 +- arch/powerpc/platforms/powernv/smp.c | 2 +- arch/s390/kernel/cache.c | 10 +-- arch/s390/kernel/perf_cpum_cf.c | 2 +- arch/s390/kernel/processor.c | 2 +- arch/s390/kernel/smp.c | 14 +-- arch/s390/kernel/sysinfo.c | 2 +- arch/s390/kernel/vtime.c | 4 +- arch/s390/mm/fault.c | 2 +- arch/score/mm/tlb-score.c | 2 +- arch/sh/kernel/cpu/init.c | 18 ++-- arch/sh/kernel/cpu/sh2/probe.c | 2 +- arch/sh/kernel/cpu/sh2a/probe.c | 2 +- arch/sh/kernel/cpu/sh3/probe.c | 2 +- arch/sh/kernel/cpu/sh4/probe.c | 2 +- arch/sh/kernel/cpu/sh4a/smp-shx3.c | 6 +- arch/sh/kernel/cpu/sh5/probe.c | 2 +- arch/sh/kernel/perf_event.c | 4 +- arch/sh/kernel/process.c | 2 +- arch/sh/kernel/setup.c | 2 +- arch/sh/kernel/smp.c | 8 +- arch/sh/kernel/traps_32.c | 2 +- arch/sh/kernel/traps_64.c | 2 +- arch/sh/mm/tlb-sh5.c | 2 +- arch/sparc/kernel/ds.c | 4 +- arch/sparc/kernel/entry.h | 2 +- arch/sparc/kernel/irq_64.c | 4 +- arch/sparc/kernel/leon_smp.c | 10 +-- arch/sparc/kernel/mdesc.c | 26 +++--- arch/sparc/kernel/smp_32.c | 20 ++--- arch/sparc/kernel/smp_64.c | 8 +- arch/sparc/kernel/sun4d_smp.c | 6 +- arch/sparc/kernel/sun4m_smp.c | 6 +- arch/sparc/kernel/sysfs.c | 4 +- arch/sparc/mm/init_64.c | 2 +- arch/sparc/mm/srmmu.c | 12 +-- arch/tile/kernel/irq.c | 2 +- arch/tile/kernel/messaging.c | 2 +- arch/tile/kernel/setup.c | 12 +-- arch/tile/kernel/smpboot.c | 6 +- arch/tile/kernel/time.c | 2 +- arch/x86/include/asm/cpu.h | 2 +- arch/x86/include/asm/microcode.h | 4 +- arch/x86/include/asm/microcode_intel.h | 4 +- arch/x86/include/asm/mmconfig.h | 4 +- arch/x86/include/asm/mpspec.h | 2 +- arch/x86/include/asm/numa.h | 6 +- arch/x86/include/asm/prom.h | 2 +- arch/x86/include/asm/smp.h | 2 +- arch/x86/kernel/acpi/boot.c | 6 +- arch/x86/kernel/apic/apic.c | 28 +++--- arch/x86/kernel/apic/apic_numachip.c | 2 +- arch/x86/kernel/apic/es7000_32.c | 2 +- arch/x86/kernel/apic/numaq_32.c | 2 +- arch/x86/kernel/apic/x2apic_cluster.c | 2 +- arch/x86/kernel/apic/x2apic_uv_x.c | 12 +-- arch/x86/kernel/cpu/amd.c | 32 +++---- arch/x86/kernel/cpu/centaur.c | 26 +++--- arch/x86/kernel/cpu/common.c | 56 ++++++------ arch/x86/kernel/cpu/cyrix.c | 40 ++++----- arch/x86/kernel/cpu/hypervisor.c | 2 +- arch/x86/kernel/cpu/intel.c | 30 +++---- arch/x86/kernel/cpu/intel_cacheinfo.c | 52 +++++------ arch/x86/kernel/cpu/mcheck/mce.c | 22 ++--- arch/x86/kernel/cpu/mcheck/mce_amd.c | 10 +-- arch/x86/kernel/cpu/mcheck/therm_throt.c | 8 +- arch/x86/kernel/cpu/perf_event.c | 2 +- arch/x86/kernel/cpu/perf_event_amd_ibs.c | 2 +- arch/x86/kernel/cpu/perf_event_amd_uncore.c | 24 ++--- arch/x86/kernel/cpu/perf_event_intel_uncore.c | 18 ++-- arch/x86/kernel/cpu/rdrand.c | 2 +- arch/x86/kernel/cpu/scattered.c | 4 +- arch/x86/kernel/cpu/topology.c | 2 +- arch/x86/kernel/cpu/transmeta.c | 6 +- arch/x86/kernel/cpu/umc.c | 2 +- arch/x86/kernel/cpu/vmware.c | 2 +- arch/x86/kernel/cpuid.c | 4 +- arch/x86/kernel/devicetree.c | 2 +- arch/x86/kernel/i387.c | 6 +- arch/x86/kernel/irq_32.c | 2 +- arch/x86/kernel/kvm.c | 8 +- arch/x86/kernel/kvmclock.c | 2 +- arch/x86/kernel/microcode_core.c | 2 +- arch/x86/kernel/microcode_core_early.c | 6 +- arch/x86/kernel/microcode_intel_early.c | 24 ++--- arch/x86/kernel/mmconf-fam10h_64.c | 12 +-- arch/x86/kernel/msr.c | 4 +- arch/x86/kernel/process.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/smpboot.c | 28 +++--- arch/x86/kernel/tboot.c | 4 +- arch/x86/kernel/tsc.c | 4 +- arch/x86/kernel/tsc_sync.c | 18 ++-- arch/x86/kernel/vsyscall_64.c | 6 +- arch/x86/kernel/x86_init.c | 4 +- arch/x86/kernel/xsave.c | 4 +- arch/x86/mm/numa.c | 12 +-- arch/x86/mm/numa_emulation.c | 10 +-- arch/x86/mm/setup_nx.c | 2 +- arch/x86/pci/amd_bus.c | 6 +- arch/x86/platform/ce4100/ce4100.c | 2 +- arch/x86/platform/mrst/mrst.c | 4 +- arch/x86/xen/enlighten.c | 4 +- arch/x86/xen/setup.c | 6 +- arch/x86/xen/smp.c | 12 +-- arch/x86/xen/spinlock.c | 2 +- arch/x86/xen/xen-ops.h | 2 +- arch/xtensa/kernel/time.c | 2 +- block/blk-iopoll.c | 4 +- block/blk-softirq.c | 4 +- drivers/acpi/processor_core.c | 8 +- drivers/acpi/processor_driver.c | 4 +- drivers/acpi/processor_idle.c | 4 +- drivers/base/cpu.c | 4 +- drivers/base/topology.c | 8 +- drivers/clocksource/arm_arch_timer.c | 8 +- drivers/clocksource/exynos_mct.c | 4 +- drivers/clocksource/metag_generic.c | 6 +- drivers/clocksource/time-armada-370-xp.c | 4 +- drivers/clocksource/timer-marco.c | 4 +- drivers/cpufreq/cpufreq_persistent_stats.c | 2 +- drivers/hwmon/coretemp.c | 32 +++---- drivers/hwmon/via-cputemp.c | 6 +- drivers/irqchip/irq-gic.c | 6 +- drivers/oprofile/timer_int.c | 2 +- drivers/xen/xen-acpi-cpuhotplug.c | 2 +- include/linux/cpu.h | 4 +- include/linux/init.h | 12 +-- include/linux/perf_event.h | 2 +- init/calibrate.c | 10 +-- kernel/cpu.c | 6 +- kernel/events/core.c | 4 +- kernel/fork.c | 2 +- kernel/hrtimer.c | 6 +- kernel/printk.c | 6 +- kernel/profile.c | 2 +- kernel/rcutorture.c | 6 +- kernel/rcutree.c | 6 +- kernel/rcutree.h | 4 +- kernel/rcutree_plugin.h | 6 +- kernel/relay.c | 2 +- kernel/sched/core.c | 12 +-- kernel/sched/fair.c | 2 +- kernel/smp.c | 2 +- kernel/smpboot.c | 2 +- kernel/softirq.c | 4 +- kernel/time/tick-sched.c | 2 +- kernel/timer.c | 10 +-- kernel/workqueue.c | 4 +- lib/earlycpio.c | 2 +- lib/percpu_counter.c | 2 +- mm/memcontrol.c | 2 +- mm/page-writeback.c | 4 +- mm/slab.c | 10 +-- mm/slub.c | 4 +- mm/vmstat.c | 6 +- net/core/flow.c | 4 +- net/iucv/iucv.c | 2 +- scripts/mod/modpost.c | 51 +++-------- 304 files changed, 992 insertions(+), 1023 deletions(-) diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 7b60834fb4b2f..53b18a620e1c2 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -116,7 +116,7 @@ wait_boot_cpu_to_stop(int cpuid) /* * Where secondaries begin a life of C. */ -void __cpuinit +void smp_callin(void) { int cpuid = hard_smp_processor_id(); @@ -194,7 +194,7 @@ wait_for_txrdy (unsigned long cpumask) * Send a message to a secondary's console. "START" is one such * interesting message. ;-) */ -static void __cpuinit +static void send_secondary_console_msg(char *str, int cpuid) { struct percpu_struct *cpu; @@ -285,7 +285,7 @@ recv_secondary_console_msg(void) /* * Convince the console to have a secondary cpu begin execution. */ -static int __cpuinit +static int secondary_cpu_start(int cpuid, struct task_struct *idle) { struct percpu_struct *cpu; @@ -356,7 +356,7 @@ secondary_cpu_start(int cpuid, struct task_struct *idle) /* * Bring one cpu online. */ -static int __cpuinit +static int smp_boot_one_cpu(int cpuid, struct task_struct *idle) { unsigned long timeout; @@ -472,7 +472,7 @@ smp_prepare_boot_cpu(void) { } -int __cpuinit +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { smp_boot_one_cpu(cpu, tidle); diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index affccb959a9e8..be1fba334bd07 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c @@ -32,7 +32,7 @@ static int opDEC_fix; -static void __cpuinit +static void opDEC_check(void) { __asm__ __volatile__ ( @@ -1059,7 +1059,7 @@ do_entUnaUser(void __user * va, unsigned long opcode, return; } -void __cpuinit +void trap_init(void) { /* Tell PAL-code what global pointer we want in the kernel. */ diff --git a/arch/arc/include/asm/irq.h b/arch/arc/include/asm/irq.h index 57898a17eb821..c0a72105ee0b0 100644 --- a/arch/arc/include/asm/irq.h +++ b/arch/arc/include/asm/irq.h @@ -21,6 +21,6 @@ extern void __init arc_init_IRQ(void); extern int __init get_hw_config_num_irq(void); -void __cpuinit arc_local_timer_setup(unsigned int cpu); +void arc_local_timer_setup(unsigned int cpu); #endif diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c index a199471ce01e1..6a9f1bdb36fcf 100644 --- a/arch/arc/kernel/irq.c +++ b/arch/arc/kernel/irq.c @@ -27,7 +27,7 @@ * -Disable all IRQs (on CPU side) * -Optionally, setup the High priority Interrupts as Level 2 IRQs */ -void __cpuinit arc_init_IRQ(void) +void arc_init_IRQ(void) { int level_mask = 0; diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 2d7786b69a8a3..eee808381dfe5 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -38,7 +38,7 @@ struct task_struct *_current_task[NR_CPUS]; /* For stack switching */ struct cpuinfo_arc cpuinfo_arc700[NR_CPUS]; -void __cpuinit read_arc_build_cfg_regs(void) +void read_arc_build_cfg_regs(void) { struct bcr_perip uncached_space; struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; @@ -234,7 +234,7 @@ char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) return buf; } -void __cpuinit arc_chk_ccms(void) +void arc_chk_ccms(void) { #if defined(CONFIG_ARC_HAS_DCCM) || defined(CONFIG_ARC_HAS_ICCM) struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; @@ -269,7 +269,7 @@ void __cpuinit arc_chk_ccms(void) * hardware has dedicated regs which need to be saved/restored on ctx-sw * (Single Precision uses core regs), thus kernel is kind of oblivious to it */ -void __cpuinit arc_chk_fpu(void) +void arc_chk_fpu(void) { struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; @@ -290,7 +290,7 @@ void __cpuinit arc_chk_fpu(void) * such as only for boot CPU etc */ -void __cpuinit setup_processor(void) +void setup_processor(void) { char str[512]; int cpu_id = smp_processor_id(); diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c index 5c7fd603d216c..bca3052c956da 100644 --- a/arch/arc/kernel/smp.c +++ b/arch/arc/kernel/smp.c @@ -117,7 +117,7 @@ const char *arc_platform_smp_cpuinfo(void) * Called from asm stub in head.S * "current"/R25 already setup by low level boot code */ -void __cpuinit start_kernel_secondary(void) +void start_kernel_secondary(void) { struct mm_struct *mm = &init_mm; unsigned int cpu = smp_processor_id(); @@ -154,7 +154,7 @@ void __cpuinit start_kernel_secondary(void) * * Essential requirements being where to run from (PC) and stack (SP) */ -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) +int __cpu_up(unsigned int cpu, struct task_struct *idle) { unsigned long wait_till; diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c index 09f4309aa2c03..c8bb48476c296 100644 --- a/arch/arc/kernel/time.c +++ b/arch/arc/kernel/time.c @@ -50,7 +50,7 @@ #ifdef CONFIG_ARC_HAS_RTSC -int __cpuinit arc_counter_setup(void) +int arc_counter_setup(void) { /* RTSC insn taps into cpu clk, needs no setup */ @@ -105,7 +105,7 @@ static bool is_usable_as_clocksource(void) /* * set 32bit TIMER1 to keep counting monotonically and wraparound */ -int __cpuinit arc_counter_setup(void) +int arc_counter_setup(void) { write_aux_reg(ARC_REG_TIMER1_LIMIT, ARC_TIMER_MAX); write_aux_reg(ARC_REG_TIMER1_CNT, 0); @@ -212,7 +212,7 @@ static struct irqaction arc_timer_irq = { * Setup the local event timer for @cpu * N.B. weak so that some exotic ARC SoCs can completely override it */ -void __attribute__((weak)) __cpuinit arc_local_timer_setup(unsigned int cpu) +void __attribute__((weak)) arc_local_timer_setup(unsigned int cpu) { struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c index aedce1905441c..eebbd7bf14986 100644 --- a/arch/arc/mm/cache_arc700.c +++ b/arch/arc/mm/cache_arc700.c @@ -100,7 +100,7 @@ char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len) * the cpuinfo structure for later use. * No Validation done here, simply read/convert the BCRs */ -void __cpuinit read_decode_cache_bcr(void) +void read_decode_cache_bcr(void) { struct bcr_cache ibcr, dbcr; struct cpuinfo_arc_cache *p_ic, *p_dc; @@ -132,7 +132,7 @@ void __cpuinit read_decode_cache_bcr(void) * 3. Enable the Caches, setup default flush mode for D-Cache * 3. Calculate the SHMLBA used by user space */ -void __cpuinit arc_cache_init(void) +void arc_cache_init(void) { unsigned int temp; unsigned int cpu = smp_processor_id(); diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index fe1c5a073afe4..43abf8dbc07fa 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c @@ -464,7 +464,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr_unaligned, * the cpuinfo structure for later use. * No Validation is done here, simply read/convert the BCRs */ -void __cpuinit read_decode_mmu_bcr(void) +void read_decode_mmu_bcr(void) { unsigned int tmp; struct bcr_mmu_1_2 *mmu2; /* encoded MMU2 attr */ @@ -510,7 +510,7 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len) return buf; } -void __cpuinit arc_mmu_init(void) +void arc_mmu_init(void) { char str[256]; struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu; diff --git a/arch/arm/common/mcpm_platsmp.c b/arch/arm/common/mcpm_platsmp.c index 3caed0db69861..79892a52234a6 100644 --- a/arch/arm/common/mcpm_platsmp.c +++ b/arch/arm/common/mcpm_platsmp.c @@ -23,7 +23,7 @@ static void __init simple_smp_init_cpus(void) { } -static int __cpuinit mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle) { unsigned int mpidr, pcpu, pcluster, ret; extern void secondary_startup(void); @@ -44,7 +44,7 @@ static int __cpuinit mcpm_boot_secondary(unsigned int cpu, struct task_struct *i return 0; } -static void __cpuinit mcpm_secondary_init(unsigned int cpu) +static void mcpm_secondary_init(unsigned int cpu) { mcpm_cpu_powered_up(); } diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index 9ba3123367882..d9da408921e0a 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c @@ -1042,7 +1042,7 @@ static void reset_ctrl_regs(void *unused) cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu)); } -static int __cpuinit dbg_reset_notify(struct notifier_block *self, +static int dbg_reset_notify(struct notifier_block *self, unsigned long action, void *cpu) { if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE) @@ -1051,7 +1051,7 @@ static int __cpuinit dbg_reset_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata dbg_reset_nb = { +static struct notifier_block dbg_reset_nb = { .notifier_call = dbg_reset_notify, }; diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c index 34b363c09202b..e4479c7903aa7 100644 --- a/arch/arm/kernel/perf_event_cpu.c +++ b/arch/arm/kernel/perf_event_cpu.c @@ -257,7 +257,7 @@ static void armpmu_hotplug_disable(void *parm_pmu) * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading * junk values out of them. */ -static int __cpuinit cpu_pmu_notify(struct notifier_block *b, +static int cpu_pmu_notify(struct notifier_block *b, unsigned long action, void *hcpu) { int irq; @@ -317,7 +317,7 @@ static int __cpuinit cpu_pmu_notify(struct notifier_block *b, return ret; } -static struct notifier_block __cpuinitdata cpu_pmu_hotplug_notifier = { +static struct notifier_block cpu_pmu_hotplug_notifier = { .notifier_call = cpu_pmu_notify, }; diff --git a/arch/arm/kernel/psci_smp.c b/arch/arm/kernel/psci_smp.c index fc1dbd2582552..da343ee426499 100644 --- a/arch/arm/kernel/psci_smp.c +++ b/arch/arm/kernel/psci_smp.c @@ -47,7 +47,7 @@ extern void secondary_startup(void); -static int __cpuinit psci_boot_secondary(unsigned int cpu, +static int psci_boot_secondary(unsigned int cpu, struct task_struct *idle) { if (psci_ops.cpu_on) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index a471f654463bb..e242f129537fd 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -57,7 +57,7 @@ struct secondary_data secondary_data; * control for which core is the next to come out of the secondary * boot "holding pen" */ -volatile int __cpuinitdata pen_release = -1; +volatile int pen_release = -1; enum ipi_msg_type { IPI_WAKEUP, @@ -79,7 +79,7 @@ void __init smp_set_ops(struct smp_operations *ops) smp_ops = *ops; }; -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) +int __cpu_up(unsigned int cpu, struct task_struct *idle) { int ret; @@ -126,7 +126,7 @@ void __init smp_init_cpus(void) smp_ops.smp_init_cpus(); } -int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) +int boot_secondary(unsigned int cpu, struct task_struct *idle) { if (smp_ops.smp_boot_secondary) return smp_ops.smp_boot_secondary(cpu, idle); @@ -158,7 +158,7 @@ static int platform_cpu_disable(unsigned int cpu) /* * __cpu_disable runs on the processor to be shutdown. */ -int __cpuinit __cpu_disable(void) +int __cpu_disable(void) { unsigned int cpu = smp_processor_id(); int ret; @@ -204,7 +204,7 @@ static DECLARE_COMPLETION(cpu_died); * called on the thread which is asking for a CPU to be shutdown - * waits until shutdown has completed, or it is timed out. */ -void __cpuinit __cpu_die(unsigned int cpu) +void __cpu_die(unsigned int cpu) { if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) { pr_err("CPU%u: cpu didn't die\n", cpu); @@ -294,7 +294,7 @@ void __ref cpu_die(void) * Called by both boot and secondaries to move global data into * per-processor storage. */ -static void __cpuinit smp_store_cpu_info(unsigned int cpuid) +static void smp_store_cpu_info(unsigned int cpuid) { struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); @@ -310,7 +310,7 @@ static void percpu_timer_setup(void); * This is the secondary CPU boot entry. We're using this CPUs * idle thread stack, but a set of temporary page tables. */ -asmlinkage void __cpuinit secondary_start_kernel(void) +asmlinkage void secondary_start_kernel(void) { struct mm_struct *mm = &init_mm; unsigned int cpu; @@ -522,7 +522,7 @@ static void broadcast_timer_set_mode(enum clock_event_mode mode, { } -static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt) +static void broadcast_timer_setup(struct clock_event_device *evt) { evt->name = "dummy_timer"; evt->features = CLOCK_EVT_FEAT_ONESHOT | @@ -551,7 +551,7 @@ int local_timer_register(struct local_timer_ops *ops) } #endif -static void __cpuinit percpu_timer_setup(void) +static void percpu_timer_setup(void) { unsigned int cpu = smp_processor_id(); struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index f6fd1d4398c6f..25956204ef23e 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -187,7 +187,7 @@ core_initcall(twd_cpufreq_init); #endif -static void __cpuinit twd_calibrate_rate(void) +static void twd_calibrate_rate(void) { unsigned long count; u64 waitjiffies; @@ -265,7 +265,7 @@ static void twd_get_clock(struct device_node *np) /* * Setup the local clock events for a CPU. */ -static int __cpuinit twd_timer_setup(struct clock_event_device *clk) +static int twd_timer_setup(struct clock_event_device *clk) { struct clock_event_device **this_cpu_clk; int cpu = smp_processor_id(); @@ -308,7 +308,7 @@ static int __cpuinit twd_timer_setup(struct clock_event_device *clk) return 0; } -static struct local_timer_ops twd_lt_ops __cpuinitdata = { +static struct local_timer_ops twd_lt_ops = { .setup = twd_timer_setup, .stop = twd_timer_stop, }; diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index 64dbfa57204ae..5306de3501339 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c @@ -86,7 +86,7 @@ void __init register_current_timer_delay(const struct delay_timer *timer) } } -unsigned long __cpuinit calibrate_delay_is_known(void) +unsigned long calibrate_delay_is_known(void) { delay_calibrated = true; return lpj_fine; diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index a0e8ff7758a4c..01442f1ee16d1 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -73,7 +73,7 @@ static void __iomem *scu_base_addr(void) static DEFINE_SPINLOCK(boot_lock); -static void __cpuinit exynos_secondary_init(unsigned int cpu) +static void exynos_secondary_init(unsigned int cpu) { /* * let the primary processor know we're out of the @@ -88,7 +88,7 @@ static void __cpuinit exynos_secondary_init(unsigned int cpu) spin_unlock(&boot_lock); } -static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) { unsigned long timeout; unsigned long phys_cpu = cpu_logical_map(cpu); diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c index a984573e0d023..32d75cf55cbc7 100644 --- a/arch/arm/mach-highbank/platsmp.c +++ b/arch/arm/mach-highbank/platsmp.c @@ -24,7 +24,7 @@ extern void secondary_startup(void); -static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int highbank_boot_secondary(unsigned int cpu, struct task_struct *idle) { highbank_set_cpu_jump(cpu, secondary_startup); arch_send_wakeup_ipi_mask(cpumask_of(cpu)); diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c index c6e1ab5448822..1f24c1fdfea4e 100644 --- a/arch/arm/mach-imx/platsmp.c +++ b/arch/arm/mach-imx/platsmp.c @@ -53,7 +53,7 @@ void imx_scu_standby_enable(void) writel_relaxed(val, scu_base); } -static int __cpuinit imx_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle) { imx_set_cpu_jump(cpu, v7_secondary_startup); imx_enable_cpu(cpu, true); diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c index f4f29e4f40045..ba758992e862b 100644 --- a/arch/arm/mach-msm/platsmp.c +++ b/arch/arm/mach-msm/platsmp.c @@ -42,7 +42,7 @@ * observers, irrespective of whether they're taking part in coherency * or not. This is necessary for the hotplug code to work reliably. */ -void __cpuinit write_pen_release(int val) +void write_pen_release(int val) { pen_release = val; smp_wmb(); @@ -52,7 +52,7 @@ void __cpuinit write_pen_release(int val) static DEFINE_SPINLOCK(boot_lock); -void __cpuinit msm_secondary_init(unsigned int cpu) +void msm_secondary_init(unsigned int cpu) { WARN_ON(msm_platform_secondary_init(cpu)); @@ -69,7 +69,7 @@ void __cpuinit msm_secondary_init(unsigned int cpu) spin_unlock(&boot_lock); } -static int __cpuinit release_secondary_sim(unsigned long base, unsigned int cpu) +static int release_secondary_sim(unsigned long base, unsigned int cpu) { void *base_ptr = ioremap_nocache(base + (cpu * 0x10000), SZ_4K); if (!base_ptr) @@ -83,7 +83,7 @@ static int __cpuinit release_secondary_sim(unsigned long base, unsigned int cpu) return 0; } -static int __cpuinit scorpion_release_secondary(void) +static int scorpion_release_secondary(void) { void *base_ptr = ioremap_nocache(0x00902000, SZ_4K*2); if (!base_ptr) @@ -99,7 +99,7 @@ static int __cpuinit scorpion_release_secondary(void) return 0; } -static int __cpuinit msm8960_release_secondary(unsigned long base, +static int msm8960_release_secondary(unsigned long base, unsigned int cpu) { void *base_ptr = ioremap_nocache(base + (cpu * 0x10000), SZ_4K); @@ -129,7 +129,7 @@ static int __cpuinit msm8960_release_secondary(unsigned long base, return 0; } -static int __cpuinit msm8974_release_secondary(unsigned long base, +static int msm8974_release_secondary(unsigned long base, unsigned int cpu) { void *base_ptr = ioremap_nocache(base + (cpu * 0x10000), SZ_4K); @@ -156,7 +156,7 @@ static int __cpuinit msm8974_release_secondary(unsigned long base, return 0; } -static int __cpuinit arm_release_secondary(unsigned long base, unsigned int cpu) +static int arm_release_secondary(unsigned long base, unsigned int cpu) { void *base_ptr = ioremap_nocache(base + (cpu * 0x10000), SZ_4K); if (!base_ptr) @@ -191,7 +191,7 @@ static int __cpuinit arm_release_secondary(unsigned long base, unsigned int cpu) return 0; } -static int __cpuinit release_from_pen(unsigned int cpu) +static int release_from_pen(unsigned int cpu) { unsigned long timeout; @@ -241,7 +241,7 @@ static int __cpuinit release_from_pen(unsigned int cpu) DEFINE_PER_CPU(int, cold_boot_done); -int __cpuinit scorpion_boot_secondary(unsigned int cpu, +int scorpion_boot_secondary(unsigned int cpu, struct task_struct *idle) { pr_debug("Starting secondary CPU %d\n", cpu); @@ -253,7 +253,7 @@ int __cpuinit scorpion_boot_secondary(unsigned int cpu, return release_from_pen(cpu); } -int __cpuinit msm8960_boot_secondary(unsigned int cpu, struct task_struct *idle) +int msm8960_boot_secondary(unsigned int cpu, struct task_struct *idle) { pr_debug("Starting secondary CPU %d\n", cpu); @@ -264,7 +264,7 @@ int __cpuinit msm8960_boot_secondary(unsigned int cpu, struct task_struct *idle) return release_from_pen(cpu); } -int __cpuinit msm8974_boot_secondary(unsigned int cpu, struct task_struct *idle) +int msm8974_boot_secondary(unsigned int cpu, struct task_struct *idle) { pr_debug("Starting secondary CPU %d\n", cpu); @@ -279,7 +279,7 @@ int __cpuinit msm8974_boot_secondary(unsigned int cpu, struct task_struct *idle) return release_from_pen(cpu); } -static int __cpuinit msm8916_boot_secondary(unsigned int cpu, +static int msm8916_boot_secondary(unsigned int cpu, struct task_struct *idle) { pr_debug("Starting secondary CPU %d\n", cpu); @@ -295,7 +295,7 @@ static int __cpuinit msm8916_boot_secondary(unsigned int cpu, return release_from_pen(cpu); } -static int __cpuinit msm8936_boot_secondary(unsigned int cpu, +static int msm8936_boot_secondary(unsigned int cpu, struct task_struct *idle) { int ret = 0; @@ -317,7 +317,7 @@ static int __cpuinit msm8936_boot_secondary(unsigned int cpu, return release_from_pen(cpu); } -int __cpuinit arm_boot_secondary(unsigned int cpu, struct task_struct *idle) +int arm_boot_secondary(unsigned int cpu, struct task_struct *idle) { pr_debug("Starting secondary CPU %d\n", cpu); diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index d749417c473d6..23d74cc68b952 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c @@ -889,7 +889,7 @@ static void __init msm_sched_clock_init(void) } #ifdef CONFIG_LOCAL_TIMERS -int __cpuinit local_timer_setup(struct clock_event_device *evt) +int local_timer_setup(struct clock_event_device *evt) { static DEFINE_PER_CPU(bool, first_boot) = true; struct msm_clock *clock = &msm_clocks[msm_global_timer]; diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c index 875ea748391ca..703f9ccf435f5 100644 --- a/arch/arm/mach-mvebu/platsmp.c +++ b/arch/arm/mach-mvebu/platsmp.c @@ -71,12 +71,12 @@ void __init set_secondary_cpus_clock(void) } } -static void __cpuinit armada_xp_secondary_init(unsigned int cpu) +static void armada_xp_secondary_init(unsigned int cpu) { armada_xp_mpic_smp_cpu_init(); } -static int __cpuinit armada_xp_boot_secondary(unsigned int cpu, +static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle) { pr_info("Booting CPU %d\n", cpu); diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c index e80327b6c81f6..1576ed36021d5 100644 --- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c +++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c @@ -254,7 +254,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state) * @cpu : CPU ID * @power_state: CPU low power state. */ -int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state) +int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state) { struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu); unsigned int cpu_state = 0; diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 2a551f997aea5..818812bed623a 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c @@ -51,7 +51,7 @@ void __iomem *omap4_get_scu_base(void) return scu_base; } -static void __cpuinit omap4_secondary_init(unsigned int cpu) +static void omap4_secondary_init(unsigned int cpu) { /* * Configure ACTRL and enable NS SMP bit access on CPU1 on HS device. @@ -72,7 +72,7 @@ static void __cpuinit omap4_secondary_init(unsigned int cpu) spin_unlock(&boot_lock); } -static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) { static struct clockdomain *cpu1_clkdm; static bool booted; diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c index f8bb3b9b6a762..ed4b7d3bd5da5 100644 --- a/arch/arm/mach-omap2/omap-wakeupgen.c +++ b/arch/arm/mach-omap2/omap-wakeupgen.c @@ -323,7 +323,7 @@ static void irq_save_secure_context(void) #endif #ifdef CONFIG_HOTPLUG_CPU -static int __cpuinit irq_cpu_hotplug_notify(struct notifier_block *self, +static int irq_cpu_hotplug_notify(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned int)hcpu; diff --git a/arch/arm/mach-prima2/platsmp.c b/arch/arm/mach-prima2/platsmp.c index 1c3de7bed8413..3dbcb1ab6e37e 100644 --- a/arch/arm/mach-prima2/platsmp.c +++ b/arch/arm/mach-prima2/platsmp.c @@ -44,7 +44,7 @@ void __init sirfsoc_map_scu(void) scu_base = (void __iomem *)SIRFSOC_VA(base); } -static void __cpuinit sirfsoc_secondary_init(unsigned int cpu) +static void sirfsoc_secondary_init(unsigned int cpu) { /* * let the primary processor know we're out of the @@ -65,7 +65,7 @@ static struct of_device_id rsc_ids[] = { {}, }; -static int __cpuinit sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) { unsigned long timeout; struct device_node *np; diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c index e38691b4d0ddc..ee58c718752d1 100644 --- a/arch/arm/mach-shmobile/smp-emev2.c +++ b/arch/arm/mach-shmobile/smp-emev2.c @@ -30,7 +30,7 @@ #define EMEV2_SCU_BASE 0x1e000000 -static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int emev2_boot_secondary(unsigned int cpu, struct task_struct *idle) { arch_send_wakeup_ipi_mask(cpumask_of(cpu_logical_map(cpu))); return 0; diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index a853bf182ed5e..77ee71ab2f1d2 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c @@ -81,7 +81,7 @@ static int r8a7779_platform_cpu_kill(unsigned int cpu) return ret ? ret : 1; } -static int __cpuinit r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) { struct r8a7779_pm_ch *ch = NULL; int ret = -EIO; diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c index 496592b6c7639..91584799e7056 100644 --- a/arch/arm/mach-shmobile/smp-sh73a0.c +++ b/arch/arm/mach-shmobile/smp-sh73a0.c @@ -48,7 +48,7 @@ void __init sh73a0_register_twd(void) } #endif -static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle) { cpu = cpu_logical_map(cpu); diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c index b51ce8c7929dc..5356a72bc8ce9 100644 --- a/arch/arm/mach-socfpga/platsmp.c +++ b/arch/arm/mach-socfpga/platsmp.c @@ -29,7 +29,7 @@ #include "core.h" -static int __cpuinit socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle) { int trampoline_size = &secondary_trampoline_end - &secondary_trampoline; diff --git a/arch/arm/mach-spear/generic.h b/arch/arm/mach-spear/generic.h index 904f2c907b46d..a99d90a4d09c5 100644 --- a/arch/arm/mach-spear/generic.h +++ b/arch/arm/mach-spear/generic.h @@ -37,7 +37,7 @@ void __init spear13xx_l2x0_init(void); void spear_restart(enum reboot_mode, const char *); void spear13xx_secondary_startup(void); -void __cpuinit spear13xx_cpu_die(unsigned int cpu); +void spear13xx_cpu_die(unsigned int cpu); extern struct smp_operations spear13xx_smp_ops; diff --git a/arch/arm/mach-spear/platsmp.c b/arch/arm/mach-spear/platsmp.c index 9c4c722c954e0..5c4a19887b2bb 100644 --- a/arch/arm/mach-spear/platsmp.c +++ b/arch/arm/mach-spear/platsmp.c @@ -24,7 +24,7 @@ static DEFINE_SPINLOCK(boot_lock); static void __iomem *scu_base = IOMEM(VA_SCU_BASE); -static void __cpuinit spear13xx_secondary_init(unsigned int cpu) +static void spear13xx_secondary_init(unsigned int cpu) { /* * let the primary processor know we're out of the @@ -40,7 +40,7 @@ static void __cpuinit spear13xx_secondary_init(unsigned int cpu) spin_unlock(&boot_lock); } -static int __cpuinit spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) { unsigned long timeout; diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c index fad4226ef710d..8aa84b50a4bba 100644 --- a/arch/arm/mach-tegra/platsmp.c +++ b/arch/arm/mach-tegra/platsmp.c @@ -35,7 +35,7 @@ static cpumask_t tegra_cpu_init_mask; -static void __cpuinit tegra_secondary_init(unsigned int cpu) +static void tegra_secondary_init(unsigned int cpu) { cpumask_set_cpu(cpu, &tegra_cpu_init_mask); } @@ -144,7 +144,7 @@ static int tegra114_boot_secondary(unsigned int cpu, struct task_struct *idle) return tegra_pmc_cpu_power_on(cpu); } -static int __cpuinit tegra_boot_secondary(unsigned int cpu, +static int tegra_boot_secondary(unsigned int cpu, struct task_struct *idle) { if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20) diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index e7594fa85066a..9718125a68a5b 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -175,7 +175,7 @@ static const char *lp_state[TEGRA_MAX_SUSPEND_MODE] = { [TEGRA_SUSPEND_LP0] = "LP0", }; -static int __cpuinit tegra_suspend_enter(suspend_state_t state) +static int tegra_suspend_enter(suspend_state_t state) { enum tegra_suspend_mode mode = tegra_pmc_get_suspend_mode(); diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index 14d90469392f1..1f296e796a4fe 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c @@ -54,7 +54,7 @@ static void __iomem *scu_base_addr(void) static DEFINE_SPINLOCK(boot_lock); -static void __cpuinit ux500_secondary_init(unsigned int cpu) +static void ux500_secondary_init(unsigned int cpu) { /* * let the primary processor know we're out of the @@ -69,7 +69,7 @@ static void __cpuinit ux500_secondary_init(unsigned int cpu) spin_unlock(&boot_lock); } -static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *idle) +static int ux500_boot_secondary(unsigned int cpu, struct task_struct *idle) { unsigned long timeout; diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h index fbbd0e21c404d..3040d219570f2 100644 --- a/arch/arm/mach-zynq/common.h +++ b/arch/arm/mach-zynq/common.h @@ -27,7 +27,7 @@ extern void secondary_startup(void); extern char zynq_secondary_trampoline; extern char zynq_secondary_trampoline_jump; extern char zynq_secondary_trampoline_end; -extern int __cpuinit zynq_cpun_start(u32 address, int cpu); +extern int zynq_cpun_start(u32 address, int cpu); extern struct smp_operations zynq_smp_ops __initdata; #endif diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index 5fc167e076199..6bc2270b35704 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -30,11 +30,11 @@ /* * Store number of cores in the system * Because of scu_get_core_count() must be in __init section and can't - * be called from zynq_cpun_start() because it is in __cpuinit section. + * be called from zynq_cpun_start() because it is in section. */ static int ncores; -int __cpuinit zynq_cpun_start(u32 address, int cpu) +int zynq_cpun_start(u32 address, int cpu) { u32 trampoline_code_size = &zynq_secondary_trampoline_end - &zynq_secondary_trampoline; @@ -92,7 +92,7 @@ int __cpuinit zynq_cpun_start(u32 address, int cpu) } EXPORT_SYMBOL(zynq_cpun_start); -static int __cpuinit zynq_boot_secondary(unsigned int cpu, +static int zynq_boot_secondary(unsigned int cpu, struct task_struct *idle) { return zynq_cpun_start(virt_to_phys(secondary_startup), cpu); diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c index 1e1b2d7697488..39895d892c3be 100644 --- a/arch/arm/plat-versatile/platsmp.c +++ b/arch/arm/plat-versatile/platsmp.c @@ -23,7 +23,7 @@ * observers, irrespective of whether they're taking part in coherency * or not. This is necessary for the hotplug code to work reliably. */ -static void __cpuinit write_pen_release(int val) +static void write_pen_release(int val) { pen_release = val; smp_wmb(); @@ -33,7 +33,7 @@ static void __cpuinit write_pen_release(int val) static DEFINE_SPINLOCK(boot_lock); -void __cpuinit versatile_secondary_init(unsigned int cpu) +void versatile_secondary_init(unsigned int cpu) { /* * let the primary processor know we're out of the @@ -48,7 +48,7 @@ void __cpuinit versatile_secondary_init(unsigned int cpu) spin_unlock(&boot_lock); } -int __cpuinit versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) +int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) { unsigned long timeout; diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 219a2cbba5478..e80b977cf950e 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -139,7 +139,7 @@ static void clear_os_lock(void *unused) asm volatile("msr oslar_el1, %0" : : "r" (0)); } -static int __cpuinit os_lock_notify(struct notifier_block *self, +static int os_lock_notify(struct notifier_block *self, unsigned long action, void *data) { int cpu = (unsigned long)data; @@ -148,11 +148,11 @@ static int __cpuinit os_lock_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata os_lock_nb = { +static struct notifier_block os_lock_nb = { .notifier_call = os_lock_notify, }; -static int __cpuinit debug_monitors_init(void) +static int debug_monitors_init(void) { cpu_notifier_register_begin(); diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index de7b854438d79..db3b6fd716bc6 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -880,7 +880,7 @@ static void hw_breakpoint_reset(void *unused) } } -static int __cpuinit hw_breakpoint_reset_notify(struct notifier_block *self, +static int hw_breakpoint_reset_notify(struct notifier_block *self, unsigned long action, void *hcpu) { @@ -890,7 +890,7 @@ static int __cpuinit hw_breakpoint_reset_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata hw_breakpoint_reset_nb = { +static struct notifier_block hw_breakpoint_reset_nb = { .notifier_call = hw_breakpoint_reset_notify, }; diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 21f3b11136bed..fc77c1e4c656e 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -1519,8 +1519,8 @@ static void armpmu_hotplug_disable(void *parm_pmu) * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading * junk values out of them. */ -static int __cpuinit cpu_pmu_notify(struct notifier_block *b, - unsigned long action, void *hcpu) +static int cpu_pmu_notify(struct notifier_block *b, + unsigned long action, void *hcpu) { int irq; struct pmu *pmu; diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 73ad727ccd566..9c7c1545fd494 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -74,7 +74,7 @@ enum ipi_msg_type { * Boot a secondary CPU, and assign it the specified idle task. * This also gives us the initial stack to use for this CPU. */ -static int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) +static int boot_secondary(unsigned int cpu, struct task_struct *idle) { if (cpu_ops[cpu]->cpu_boot) return cpu_ops[cpu]->cpu_boot(cpu); @@ -84,7 +84,7 @@ static int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) static DECLARE_COMPLETION(cpu_running); -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) +int __cpu_up(unsigned int cpu, struct task_struct *idle) { int ret; @@ -129,7 +129,7 @@ static void smp_store_cpu_info(unsigned int cpuid) * This is the secondary CPU boot entry. We're using this CPUs * idle thread stack, but a set of temporary page tables. */ -asmlinkage void __cpuinit secondary_start_kernel(void) +asmlinkage void secondary_start_kernel(void) { struct mm_struct *mm = &init_mm; unsigned int cpu = smp_processor_id(); diff --git a/arch/blackfin/kernel/perf_event.c b/arch/blackfin/kernel/perf_event.c index e47d19ae3e063..974e55496db30 100644 --- a/arch/blackfin/kernel/perf_event.c +++ b/arch/blackfin/kernel/perf_event.c @@ -468,7 +468,7 @@ static void bfin_pmu_setup(int cpu) memset(cpuhw, 0, sizeof(struct cpu_hw_events)); } -static int __cpuinit +static int bfin_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (long)hcpu; diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 107b306b06f10..19ad0637e8ff0 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c @@ -99,7 +99,7 @@ void __init generate_cplb_tables(void) } #endif -void __cpuinit bfin_setup_caches(unsigned int cpu) +void bfin_setup_caches(unsigned int cpu) { #ifdef CONFIG_BFIN_ICACHE bfin_icache_init(icplb_tbl[cpu]); @@ -165,7 +165,7 @@ void __cpuinit bfin_setup_caches(unsigned int cpu) #endif } -void __cpuinit bfin_setup_cpudata(unsigned int cpu) +void bfin_setup_cpudata(unsigned int cpu) { struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu); diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c index ab1c617b9cfc9..7748b84f1e541 100644 --- a/arch/blackfin/mach-bf561/smp.c +++ b/arch/blackfin/mach-bf561/smp.c @@ -48,7 +48,7 @@ int __init setup_profiling_timer(unsigned int multiplier) /* not supported */ return -EINVAL; } -void __cpuinit platform_secondary_init(unsigned int cpu) +void platform_secondary_init(unsigned int cpu) { /* Clone setup for peripheral interrupt sources from CoreA. */ bfin_write_SICB_IMASK0(bfin_read_SIC_IMASK0()); @@ -74,7 +74,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) spin_unlock(&boot_lock); } -int __cpuinit platform_boot_secondary(unsigned int cpu, struct task_struct *idle) +int platform_boot_secondary(unsigned int cpu, struct task_struct *idle) { unsigned long timeout; @@ -155,7 +155,7 @@ void platform_clear_ipi(unsigned int cpu, int irq) * Setup core B's local core timer. * In SMP, core timer is used for clock event device. */ -void __cpuinit bfin_local_timer_setup(void) +void bfin_local_timer_setup(void) { #if defined(CONFIG_TICKSOURCE_CORETMR) struct irq_data *data = irq_get_irq_data(IRQ_CORETMR); diff --git a/arch/blackfin/mach-common/cache-c.c b/arch/blackfin/mach-common/cache-c.c index a60a24f5035d3..0e1e451fd7d81 100644 --- a/arch/blackfin/mach-common/cache-c.c +++ b/arch/blackfin/mach-common/cache-c.c @@ -52,7 +52,7 @@ bfin_cache_init(struct cplb_entry *cplb_tbl, unsigned long cplb_addr, } #ifdef CONFIG_BFIN_ICACHE -void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl) +void bfin_icache_init(struct cplb_entry *icplb_tbl) { bfin_cache_init(icplb_tbl, ICPLB_ADDR0, ICPLB_DATA0, IMEM_CONTROL, (IMC | ENICPLB)); @@ -60,7 +60,7 @@ void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl) #endif #ifdef CONFIG_BFIN_DCACHE -void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl) +void bfin_dcache_init(struct cplb_entry *dcplb_tbl) { /* * Anomaly notes: diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 6c0c6816a51a1..d143fd8d2bc50 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c @@ -1281,7 +1281,7 @@ static struct irq_chip bfin_gpio_irqchip = { .irq_set_wake = bfin_gpio_set_wake, }; -void __cpuinit init_exception_vectors(void) +void init_exception_vectors(void) { /* cannot program in software: * evt0 - emulation (jtag) diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c index 1bc2ce6f3c947..55d4cfb40faaa 100644 --- a/arch/blackfin/mach-common/smp.c +++ b/arch/blackfin/mach-common/smp.c @@ -46,7 +46,7 @@ struct corelock_slot corelock __attribute__ ((__section__(".l2.bss"))); unsigned long blackfin_iflush_l1_entry[NR_CPUS]; #endif -struct blackfin_initial_pda __cpuinitdata initial_pda_coreb; +struct blackfin_initial_pda initial_pda_coreb; enum ipi_message_type { BFIN_IPI_TIMER, @@ -249,7 +249,7 @@ void smp_send_stop(void) return; } -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) +int __cpu_up(unsigned int cpu, struct task_struct *idle) { int ret; @@ -262,7 +262,7 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) return ret; } -static void __cpuinit setup_secondary(unsigned int cpu) +static void setup_secondary(unsigned int cpu) { unsigned long ilat; @@ -280,7 +280,7 @@ static void __cpuinit setup_secondary(unsigned int cpu) IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW; } -void __cpuinit secondary_start_kernel(void) +void secondary_start_kernel(void) { unsigned int cpu = smp_processor_id(); struct mm_struct *mm = &init_mm; @@ -404,7 +404,7 @@ EXPORT_SYMBOL(resync_core_dcache); #endif #ifdef CONFIG_HOTPLUG_CPU -int __cpuexit __cpu_disable(void) +int __cpu_disable(void) { unsigned int cpu = smp_processor_id(); @@ -417,7 +417,7 @@ int __cpuexit __cpu_disable(void) static DECLARE_COMPLETION(cpu_killed); -int __cpuexit __cpu_die(unsigned int cpu) +int __cpu_die(unsigned int cpu) { return wait_for_completion_timeout(&cpu_killed, 5000); } diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c index cdd12028de0c5..fe8e6039db2a0 100644 --- a/arch/cris/arch-v32/kernel/smp.c +++ b/arch/cris/arch-v32/kernel/smp.c @@ -197,7 +197,7 @@ int setup_profiling_timer(unsigned int multiplier) */ unsigned long cache_decay_ticks = 1; -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { smp_boot_one_cpu(cpu, tidle); return cpu_online(cpu) ? 0 : -ENOSYS; diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c index a5136474c6fd6..f908aab9f3b91 100644 --- a/arch/frv/kernel/setup.c +++ b/arch/frv/kernel/setup.c @@ -709,7 +709,7 @@ static void __init reserve_dma_coherent(void) /* * calibrate the delay loop */ -void __cpuinit calibrate_delay(void) +void calibrate_delay(void) { loops_per_jiffy = __delay_loops_MHz * (1000000 / HZ); diff --git a/arch/hexagon/kernel/setup.c b/arch/hexagon/kernel/setup.c index bfe13311d70d5..29d1f1b000165 100644 --- a/arch/hexagon/kernel/setup.c +++ b/arch/hexagon/kernel/setup.c @@ -41,7 +41,7 @@ static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; int on_simulator; -void __cpuinit calibrate_delay(void) +void calibrate_delay(void) { loops_per_jiffy = thread_freq_mhz * 1000000 / HZ; } diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c index 0e364ca431981..9faaa940452b9 100644 --- a/arch/hexagon/kernel/smp.c +++ b/arch/hexagon/kernel/smp.c @@ -146,7 +146,7 @@ void __init smp_prepare_boot_cpu(void) * to point to current thread info */ -void __cpuinit start_secondary(void) +void start_secondary(void) { unsigned int cpu; unsigned long thread_ptr; @@ -194,7 +194,7 @@ void __cpuinit start_secondary(void) * maintains control until "cpu_online(cpu)" is set. */ -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) +int __cpu_up(unsigned int cpu, struct task_struct *idle) { struct thread_info *thread = (struct thread_info *)idle->stack; void *stack_start; diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 335eb07480fe9..5eb71d22c3d59 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -807,7 +807,7 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) * ACPI based hotplug CPU support */ #ifdef CONFIG_ACPI_HOTPLUG_CPU -static __cpuinit +static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) { #ifdef CONFIG_ACPI_NUMA @@ -882,7 +882,7 @@ __init void prefill_possible_map(void) set_cpu_possible(i, true); } -static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) +static int _acpi_map_lsapic(acpi_handle handle, int *pcpu) { struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *obj; diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c index 2d67317a1ec20..4dc334c71dbd6 100644 --- a/arch/ia64/kernel/err_inject.c +++ b/arch/ia64/kernel/err_inject.c @@ -225,17 +225,17 @@ static struct attribute_group err_inject_attr_group = { .name = "err_inject" }; /* Add/Remove err_inject interface for CPU device */ -static int __cpuinit err_inject_add_dev(struct device * sys_dev) +static int err_inject_add_dev(struct device * sys_dev) { return sysfs_create_group(&sys_dev->kobj, &err_inject_attr_group); } -static int __cpuinit err_inject_remove_dev(struct device * sys_dev) +static int err_inject_remove_dev(struct device * sys_dev) { sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group); return 0; } -static int __cpuinit err_inject_cpu_callback(struct notifier_block *nfb, +static int err_inject_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -256,7 +256,7 @@ static int __cpuinit err_inject_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata err_inject_cpu_notifier = +static struct notifier_block err_inject_cpu_notifier = { .notifier_call = err_inject_cpu_callback, }; diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index d7396dbb07bb4..b8edfa75a83f9 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -631,7 +631,7 @@ ia64_mca_register_cpev (int cpev) * Outputs * None */ -void __cpuinit +void ia64_mca_cmc_vector_setup (void) { cmcv_reg_t cmcv; @@ -1814,7 +1814,7 @@ static struct irqaction mca_cpep_irqaction = { * format most of the fields. */ -static void __cpuinit +static void format_mca_init_stack(void *mca_data, unsigned long offset, const char *type, int cpu) { @@ -1844,7 +1844,7 @@ static void * __init_refok mca_bootmem(void) } /* Do per-CPU MCA-related initialization. */ -void __cpuinit +void ia64_mca_cpu_init(void *cpu_data) { void *pal_vaddr; @@ -1896,7 +1896,7 @@ ia64_mca_cpu_init(void *cpu_data) PAGE_KERNEL)); } -static void __cpuinit ia64_mca_cmc_vector_adjust(void *dummy) +static void ia64_mca_cmc_vector_adjust(void *dummy) { unsigned long flags; @@ -1906,7 +1906,7 @@ static void __cpuinit ia64_mca_cmc_vector_adjust(void *dummy) local_irq_restore(flags); } -static int __cpuinit mca_cpu_callback(struct notifier_block *nfb, +static int mca_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { @@ -1922,7 +1922,7 @@ static int __cpuinit mca_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block mca_cpu_notifier __cpuinitdata = { +static struct notifier_block mca_cpu_notifier = { .notifier_call = mca_cpu_callback }; diff --git a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c index c93420c97409d..d288cde936066 100644 --- a/arch/ia64/kernel/numa.c +++ b/arch/ia64/kernel/numa.c @@ -30,7 +30,7 @@ EXPORT_SYMBOL(cpu_to_node_map); cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; EXPORT_SYMBOL(node_to_cpu_mask); -void __cpuinit map_cpu_to_node(int cpu, int nid) +void map_cpu_to_node(int cpu, int nid) { int oldnid; if (nid < 0) { /* just initialize by zero */ @@ -51,7 +51,7 @@ void __cpuinit map_cpu_to_node(int cpu, int nid) return; } -void __cpuinit unmap_cpu_from_node(int cpu, int nid) +void unmap_cpu_from_node(int cpu, int nid) { WARN_ON(!cpu_isset(cpu, node_to_cpu_mask[nid])); WARN_ON(cpu_to_node_map[cpu] != nid); diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index 2b3c2d79256f9..ab333284f4b2e 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c @@ -932,7 +932,7 @@ static const struct file_operations proc_palinfo_fops = { .release = single_release, }; -static void __cpuinit +static void create_palinfo_proc_entries(unsigned int cpu) { pal_func_cpu_u_t f; @@ -962,7 +962,7 @@ remove_palinfo_proc_entries(unsigned int hcpu) remove_proc_subtree(cpustr, palinfo_dir); } -static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb, +static int palinfo_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int hotcpu = (unsigned long)hcpu; diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index 4bc580af67b39..960a396f59296 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c @@ -568,7 +568,7 @@ static const struct file_operations salinfo_data_fops = { .llseek = default_llseek, }; -static int __cpuinit +static int salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) { unsigned int i, cpu = (unsigned long)hcpu; @@ -609,7 +609,7 @@ salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu return NOTIFY_OK; } -static struct notifier_block salinfo_cpu_notifier __cpuinitdata = +static struct notifier_block salinfo_cpu_notifier = { .notifier_call = salinfo_cpu_callback, .priority = 0, diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 13bfdd22afc8e..fff7d768c669f 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -748,7 +748,7 @@ const struct seq_operations cpuinfo_op = { #define MAX_BRANDS 8 static char brandname[MAX_BRANDS][128]; -static char * __cpuinit +static char * get_model_name(__u8 family, __u8 model) { static int overflow; @@ -778,7 +778,7 @@ get_model_name(__u8 family, __u8 model) return "Unknown"; } -static void __cpuinit +static void identify_cpu (struct cpuinfo_ia64 *c) { union { @@ -850,7 +850,7 @@ identify_cpu (struct cpuinfo_ia64 *c) * 2. the minimum of the i-cache stride sizes for "flush_icache_range()". * 3. the minimum of the cache stride sizes for "clflush_cache_range()". */ -static void __cpuinit +static void get_cache_info(void) { unsigned long line_size, max = 1; @@ -915,10 +915,10 @@ get_cache_info(void) * cpu_init() initializes state that is per-CPU. This function acts * as a 'CPU state barrier', nothing should get across. */ -void __cpuinit +void cpu_init (void) { - extern void __cpuinit ia64_mmu_init (void *); + extern void ia64_mmu_init (void *); static unsigned long max_num_phys_stacked = IA64_NUM_PHYS_STACK_REG; unsigned long num_phys_stacked; pal_vm_info_2_u_t vmi; diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 8d87168d218df..547a48d78bd7f 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c @@ -351,7 +351,7 @@ static inline void smp_setup_percpu_timer(void) { } -static void __cpuinit +static void smp_callin (void) { int cpuid, phys_id, itc_master; @@ -442,7 +442,7 @@ smp_callin (void) /* * Activate a secondary processor. head.S calls this. */ -int __cpuinit +int start_secondary (void *unused) { /* Early console may use I/O ports */ @@ -459,7 +459,7 @@ start_secondary (void *unused) return 0; } -static int __cpuinit +static int do_boot_cpu (int sapicid, int cpu, struct task_struct *idle) { int timeout; @@ -728,7 +728,7 @@ static inline void set_cpu_sibling_map(int cpu) } } -int __cpuinit +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { int ret; diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index dc00b2c1b42ab..33980354ee466 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c @@ -139,7 +139,7 @@ static struct cpu_cache_info all_cpu_cache_info[NR_CPUS] __cpuinitdata; #define LEAF_KOBJECT_PTR(x,y) (&all_cpu_cache_info[x].cache_leaves[y]) #ifdef CONFIG_SMP -static void __cpuinit cache_shared_cpu_map_setup( unsigned int cpu, +static void cache_shared_cpu_map_setup( unsigned int cpu, struct cache_info * this_leaf) { pal_cache_shared_info_t csi; @@ -174,7 +174,7 @@ static void __cpuinit cache_shared_cpu_map_setup( unsigned int cpu, &csi) == PAL_STATUS_SUCCESS); } #else -static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, +static void cache_shared_cpu_map_setup(unsigned int cpu, struct cache_info * this_leaf) { cpu_set(cpu, this_leaf->shared_cpu_map); @@ -298,7 +298,7 @@ static struct kobj_type cache_ktype_percpu_entry = { .sysfs_ops = &cache_sysfs_ops, }; -static void __cpuinit cpu_cache_sysfs_exit(unsigned int cpu) +static void cpu_cache_sysfs_exit(unsigned int cpu) { kfree(all_cpu_cache_info[cpu].cache_leaves); all_cpu_cache_info[cpu].cache_leaves = NULL; @@ -307,7 +307,7 @@ static void __cpuinit cpu_cache_sysfs_exit(unsigned int cpu) return; } -static int __cpuinit cpu_cache_sysfs_init(unsigned int cpu) +static int cpu_cache_sysfs_init(unsigned int cpu) { unsigned long i, levels, unique_caches; pal_cache_config_info_t cci; @@ -351,7 +351,7 @@ static int __cpuinit cpu_cache_sysfs_init(unsigned int cpu) } /* Add cache interface for CPU device */ -static int __cpuinit cache_add_dev(struct device * sys_dev) +static int cache_add_dev(struct device * sys_dev) { unsigned int cpu = sys_dev->id; unsigned long i, j; @@ -401,7 +401,7 @@ static int __cpuinit cache_add_dev(struct device * sys_dev) } /* Remove cache interface for CPU device */ -static int __cpuinit cache_remove_dev(struct device * sys_dev) +static int cache_remove_dev(struct device * sys_dev) { unsigned int cpu = sys_dev->id; unsigned long i; @@ -425,7 +425,7 @@ static int __cpuinit cache_remove_dev(struct device * sys_dev) * When a cpu is hot-plugged, do a check and initiate * cache kobject if necessary */ -static int __cpuinit cache_cpu_callback(struct notifier_block *nfb, +static int cache_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -445,7 +445,7 @@ static int __cpuinit cache_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata cache_cpu_notifier = +static struct notifier_block cache_cpu_notifier = { .notifier_call = cache_cpu_callback }; diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index 67c59ebec899c..41d83fe5ee4de 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c @@ -156,7 +156,7 @@ static void *cpu_data; * * Allocate and setup per-cpu data areas. */ -void * __cpuinit +void * per_cpu_init (void) { static bool first_time = true; diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index ae4db4bd6d97d..7253d83650bf8 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c @@ -593,7 +593,7 @@ void __init find_memory(void) * find_pernode_space() does most of this already, we just need to set * local_per_cpu_offset */ -void __cpuinit *per_cpu_init(void) +void *per_cpu_init(void) { int cpu; static int first_time = 1; diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c index 4248492b9321b..ea21d4cad540e 100644 --- a/arch/ia64/mm/numa.c +++ b/arch/ia64/mm/numa.c @@ -86,7 +86,7 @@ int __meminit __early_pfn_to_nid(unsigned long pfn) return -1; } -void __cpuinit numa_clear_node(int cpu) +void numa_clear_node(int cpu) { unmap_cpu_from_node(cpu, NUMA_NO_NODE); } diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index f82e7b462b7b1..53b01b8e2f197 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c @@ -192,7 +192,7 @@ void __init early_sn_setup(void) } extern int platform_intr_list[]; -static int __cpuinitdata shub_1_1_found; +static int shub_1_1_found; /* * sn_check_for_wars @@ -200,7 +200,7 @@ static int __cpuinitdata shub_1_1_found; * Set flag for enabling shub specific wars */ -static inline int __cpuinit is_shub_1_1(int nasid) +static inline int is_shub_1_1(int nasid) { unsigned long id; int rev; @@ -212,7 +212,7 @@ static inline int __cpuinit is_shub_1_1(int nasid) return rev <= 2; } -static void __cpuinit sn_check_for_wars(void) +static void sn_check_for_wars(void) { int cnode; @@ -558,7 +558,7 @@ static void __init sn_init_pdas(char **cmdline_p) * Also sets up a few fields in the nodepda. Also known as * platform_cpu_init() by the ia64 machvec code. */ -void __cpuinit sn_cpu_init(void) +void sn_cpu_init(void) { int cpuid; int cpuphyid; diff --git a/arch/ia64/xen/hypervisor.c b/arch/ia64/xen/hypervisor.c index 52172eee85913..fab62528a80b4 100644 --- a/arch/ia64/xen/hypervisor.c +++ b/arch/ia64/xen/hypervisor.c @@ -74,7 +74,7 @@ void __init xen_setup_vcpu_info_placement(void) xen_vcpu_setup(cpu); } -void __cpuinit +void xen_cpu_init(void) { xen_smp_intr_init(); diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index 0ac558adc6055..bb21f4f631700 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c @@ -343,7 +343,7 @@ static void __init do_boot_cpu(int phys_id) } } -int __cpuinit __cpu_up(unsigned int cpu_id, struct task_struct *tidle) +int __cpu_up(unsigned int cpu_id, struct task_struct *tidle) { int timeout; diff --git a/arch/metag/kernel/perf/perf_event.c b/arch/metag/kernel/perf/perf_event.c index 366569425c52a..49ae6ff4bac69 100644 --- a/arch/metag/kernel/perf/perf_event.c +++ b/arch/metag/kernel/perf/perf_event.c @@ -813,7 +813,7 @@ static struct metag_pmu _metag_pmu = { }; /* PMU CPU hotplug notifier */ -static int __cpuinit metag_pmu_cpu_notify(struct notifier_block *b, +static int metag_pmu_cpu_notify(struct notifier_block *b, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned int)hcpu; @@ -828,7 +828,7 @@ static int __cpuinit metag_pmu_cpu_notify(struct notifier_block *b, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata metag_pmu_notifier = { +static struct notifier_block metag_pmu_notifier = { .notifier_call = metag_pmu_cpu_notify, }; diff --git a/arch/metag/kernel/smp.c b/arch/metag/kernel/smp.c index f443ec9a7cbef..6f9d5ac915c76 100644 --- a/arch/metag/kernel/smp.c +++ b/arch/metag/kernel/smp.c @@ -65,7 +65,7 @@ static DEFINE_SPINLOCK(boot_lock); /* * "thread" is assumed to be a valid Meta hardware thread ID. */ -int __cpuinit boot_secondary(unsigned int thread, struct task_struct *idle) +int boot_secondary(unsigned int thread, struct task_struct *idle) { u32 val; @@ -115,7 +115,7 @@ int __cpuinit boot_secondary(unsigned int thread, struct task_struct *idle) * If the cache partition has changed, prints a message to the log describing * those changes. */ -static __cpuinit void describe_cachepart_change(unsigned int thread, +static void describe_cachepart_change(unsigned int thread, const char *label, unsigned int sz, unsigned int old, @@ -167,7 +167,7 @@ static __cpuinit void describe_cachepart_change(unsigned int thread, * Ensures that coherency is enabled and that the threads share the same cache * partitions. */ -static __cpuinit void setup_smp_cache(unsigned int thread) +static void setup_smp_cache(unsigned int thread) { unsigned int this_thread, lflags; unsigned int dcsz, dcpart_this, dcpart_old, dcpart_new; @@ -212,7 +212,7 @@ static __cpuinit void setup_smp_cache(unsigned int thread) icpart_old, icpart_new); } -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) +int __cpu_up(unsigned int cpu, struct task_struct *idle) { unsigned int thread = cpu_2_hwthread_id[cpu]; int ret; @@ -273,7 +273,7 @@ static DECLARE_COMPLETION(cpu_killed); /* * __cpu_disable runs on the processor to be shutdown. */ -int __cpuexit __cpu_disable(void) +int __cpu_disable(void) { unsigned int cpu = smp_processor_id(); struct task_struct *p; @@ -310,7 +310,7 @@ int __cpuexit __cpu_disable(void) * called on the thread which is asking for a CPU to be shutdown - * waits until shutdown has completed, or it is timed out. */ -void __cpuexit __cpu_die(unsigned int cpu) +void __cpu_die(unsigned int cpu) { if (!wait_for_completion_timeout(&cpu_killed, msecs_to_jiffies(1))) pr_err("CPU%u: unable to kill\n", cpu); @@ -322,7 +322,7 @@ void __cpuexit __cpu_die(unsigned int cpu) * Note that we do not return from this function. If this cpu is * brought online again it will need to run secondary_startup(). */ -void __cpuexit cpu_die(void) +void cpu_die(void) { local_irq_disable(); idle_task_exit(); @@ -337,7 +337,7 @@ void __cpuexit cpu_die(void) * Called by both boot and secondaries to move global data into * per-processor storage. */ -void __cpuinit smp_store_cpu_info(unsigned int cpuid) +void smp_store_cpu_info(unsigned int cpuid) { struct cpuinfo_metag *cpu_info = &per_cpu(cpu_data, cpuid); diff --git a/arch/metag/kernel/traps.c b/arch/metag/kernel/traps.c index 2ceeaae5b1992..a645da359a3f4 100644 --- a/arch/metag/kernel/traps.c +++ b/arch/metag/kernel/traps.c @@ -811,7 +811,7 @@ static void set_trigger_mask(unsigned int mask) } #endif -void __cpuinit per_cpu_trap_init(unsigned long cpu) +void per_cpu_trap_init(unsigned long cpu) { TBIRES int_context; unsigned int thread = cpu_2_hwthread_id[cpu]; diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c index 8be4e856b8b89..80f4ecd42b0dc 100644 --- a/arch/mips/ath79/setup.c +++ b/arch/mips/ath79/setup.c @@ -182,7 +182,7 @@ const char *get_system_type(void) return ath79_sys_type; } -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { return CP0_LEGACY_COMPARE_IRQ; } diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index 45c1a6caa2066..5e3da374caab1 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c @@ -1095,7 +1095,7 @@ static void octeon_irq_ip3_ciu(void) static bool octeon_irq_use_ip4; -static void __cpuinit octeon_irq_local_enable_ip4(void *arg) +static void octeon_irq_local_enable_ip4(void *arg) { set_c0_status(STATUSF_IP4); } @@ -1110,21 +1110,21 @@ static void (*octeon_irq_ip2)(void); static void (*octeon_irq_ip3)(void); static void (*octeon_irq_ip4)(void); -void __cpuinitdata (*octeon_irq_setup_secondary)(void); +void (*octeon_irq_setup_secondary)(void); -void __cpuinit octeon_irq_set_ip4_handler(octeon_irq_ip4_handler_t h) +void octeon_irq_set_ip4_handler(octeon_irq_ip4_handler_t h) { octeon_irq_ip4 = h; octeon_irq_use_ip4 = true; on_each_cpu(octeon_irq_local_enable_ip4, NULL, 1); } -static void __cpuinit octeon_irq_percpu_enable(void) +static void octeon_irq_percpu_enable(void) { irq_cpu_online(); } -static void __cpuinit octeon_irq_init_ciu_percpu(void) +static void octeon_irq_init_ciu_percpu(void) { int coreid = cvmx_get_core_num(); @@ -1167,7 +1167,7 @@ static void octeon_irq_init_ciu2_percpu(void) cvmx_read_csr(CVMX_CIU2_SUM_PPX_IP2(coreid)); } -static void __cpuinit octeon_irq_setup_secondary_ciu(void) +static void octeon_irq_setup_secondary_ciu(void) { octeon_irq_init_ciu_percpu(); octeon_irq_percpu_enable(); diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c index 295137dfdc37c..138cc80c59281 100644 --- a/arch/mips/cavium-octeon/smp.c +++ b/arch/mips/cavium-octeon/smp.c @@ -173,7 +173,7 @@ static void octeon_boot_secondary(int cpu, struct task_struct *idle) * After we've done initial boot, this function is called to allow the * board code to clean up state, if needed */ -static void __cpuinit octeon_init_secondary(void) +static void octeon_init_secondary(void) { unsigned int sr; @@ -375,7 +375,7 @@ static int octeon_update_boot_vector(unsigned int cpu) return 0; } -static int __cpuinit octeon_cpu_callback(struct notifier_block *nfb, +static int octeon_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -394,7 +394,7 @@ static int __cpuinit octeon_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static int __cpuinit register_cavium_notifier(void) +static int register_cavium_notifier(void) { hotcpu_notifier(octeon_cpu_callback, 0); return 0; diff --git a/arch/mips/include/asm/uasm.h b/arch/mips/include/asm/uasm.h index 370d967725c28..dc4436e7132f5 100644 --- a/arch/mips/include/asm/uasm.h +++ b/arch/mips/include/asm/uasm.h @@ -17,8 +17,8 @@ #define __uasminitdata #define UASM_EXPORT_SYMBOL(sym) EXPORT_SYMBOL(sym) #else -#define __uasminit __cpuinit -#define __uasminitdata __cpuinitdata +#define __uasminit +#define __uasminitdatadata #define UASM_EXPORT_SYMBOL(sym) #endif diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c index 15f618b40cf6c..7976457184b18 100644 --- a/arch/mips/kernel/cevt-bcm1480.c +++ b/arch/mips/kernel/cevt-bcm1480.c @@ -109,7 +109,7 @@ static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent); static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction); static DEFINE_PER_CPU(char [18], sibyte_hpt_name); -void __cpuinit sb1480_clockevent_init(void) +void sb1480_clockevent_init(void) { unsigned int cpu = smp_processor_id(); unsigned int irq = K_BCM1480_INT_TIMER_0 + cpu; diff --git a/arch/mips/kernel/cevt-gic.c b/arch/mips/kernel/cevt-gic.c index 730eaf92c0189..594cbbf16d627 100644 --- a/arch/mips/kernel/cevt-gic.c +++ b/arch/mips/kernel/cevt-gic.c @@ -59,7 +59,7 @@ void gic_event_handler(struct clock_event_device *dev) { } -int __cpuinit gic_clockevent_init(void) +int gic_clockevent_init(void) { unsigned int cpu = smp_processor_id(); struct clock_event_device *cd; diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index 02033eaf88254..50d3f5a8d6bb1 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c @@ -171,7 +171,7 @@ int c0_compare_int_usable(void) } #ifndef CONFIG_MIPS_MT_SMTC -int __cpuinit r4k_clockevent_init(void) +int r4k_clockevent_init(void) { unsigned int cpu = smp_processor_id(); struct clock_event_device *cd; diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c index 200f2778bf366..5ea6d6b1de150 100644 --- a/arch/mips/kernel/cevt-sb1250.c +++ b/arch/mips/kernel/cevt-sb1250.c @@ -107,7 +107,7 @@ static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent); static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction); static DEFINE_PER_CPU(char [18], sibyte_hpt_name); -void __cpuinit sb1250_clockevent_init(void) +void sb1250_clockevent_init(void) { unsigned int cpu = smp_processor_id(); unsigned int irq = K_INT_TIMER_0 + cpu; diff --git a/arch/mips/kernel/cevt-smtc.c b/arch/mips/kernel/cevt-smtc.c index 9de5ed7ef1a36..b6cf0a60d8968 100644 --- a/arch/mips/kernel/cevt-smtc.c +++ b/arch/mips/kernel/cevt-smtc.c @@ -248,7 +248,7 @@ irqreturn_t c0_compare_interrupt(int irq, void *dev_id) } -int __cpuinit smtc_clockevent_init(void) +int smtc_clockevent_init(void) { uint64_t mips_freq = mips_hpt_frequency; unsigned int cpu = smp_processor_id(); diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index c6568bf4b1b05..d866a45b551f2 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -27,7 +27,7 @@ #include #include -static int __cpuinitdata mips_fpu_disabled; +static int mips_fpu_disabled; static int __init fpu_disable(char *s) { @@ -39,7 +39,7 @@ static int __init fpu_disable(char *s) __setup("nofpu", fpu_disable); -int __cpuinitdata mips_dsp_disabled; +int mips_dsp_disabled; static int __init dsp_disable(char *s) { @@ -134,7 +134,7 @@ static inline void cpu_probe_vmbits(struct cpuinfo_mips *c) #endif } -static void __cpuinit set_isa(struct cpuinfo_mips *c, unsigned int isa) +static void set_isa(struct cpuinfo_mips *c, unsigned int isa) { switch (isa) { case MIPS_CPU_ISA_M64R2: @@ -162,7 +162,7 @@ static void __cpuinit set_isa(struct cpuinfo_mips *c, unsigned int isa) } } -static char unknown_isa[] __cpuinitdata = KERN_ERR \ +static char unknown_isa[] = KERN_ERR \ "Unsupported ISA type, c0.config0: %d."; static inline unsigned int decode_config0(struct cpuinfo_mips *c) @@ -296,7 +296,7 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c) return config4 & MIPS_CONF_M; } -static void __cpuinit decode_configs(struct cpuinfo_mips *c) +static void decode_configs(struct cpuinfo_mips *c) { int ok; @@ -970,7 +970,7 @@ EXPORT_SYMBOL(__ua_limit); const char *__cpu_name[NR_CPUS]; const char *__elf_platform; -__cpuinit void cpu_probe(void) +void cpu_probe(void) { struct cpuinfo_mips *c = ¤t_cpu_data; unsigned int cpu = smp_processor_id(); @@ -1055,7 +1055,7 @@ __cpuinit void cpu_probe(void) #endif } -__cpuinit void cpu_report(void) +void cpu_report(void) { struct cpuinfo_mips *c = ¤t_cpu_data; diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index 8e393b8443f7a..20c637fdae892 100644 --- a/arch/mips/kernel/smp-bmips.c +++ b/arch/mips/kernel/smp-bmips.c @@ -381,7 +381,7 @@ struct plat_smp_ops bmips_smp_ops = { * UP BMIPS systems as well. ***********************************************************************/ -static void __cpuinit bmips_wr_vec(unsigned long dst, char *start, char *end) +static void bmips_wr_vec(unsigned long dst, char *start, char *end) { memcpy((void *)dst, start, end - start); dma_cache_wback((unsigned long)start, end - start); @@ -389,7 +389,7 @@ static void __cpuinit bmips_wr_vec(unsigned long dst, char *start, char *end) instruction_hazard(); } -static inline void __cpuinit bmips_nmi_handler_setup(void) +static inline void bmips_nmi_handler_setup(void) { bmips_wr_vec(BMIPS_NMI_RESET_VEC, &bmips_reset_nmi_vec, &bmips_reset_nmi_vec_end); @@ -397,7 +397,7 @@ static inline void __cpuinit bmips_nmi_handler_setup(void) &bmips_smp_int_vec_end); } -void __cpuinit bmips_ebase_setup(void) +void bmips_ebase_setup(void) { unsigned long new_ebase = ebase; void __iomem __maybe_unused *cbr; diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c index 3e5164c11caca..57a3f7a2b370c 100644 --- a/arch/mips/kernel/smp-mt.c +++ b/arch/mips/kernel/smp-mt.c @@ -149,7 +149,7 @@ static void vsmp_send_ipi_mask(const struct cpumask *mask, unsigned int action) vsmp_send_ipi_single(i, action); } -static void __cpuinit vsmp_init_secondary(void) +static void vsmp_init_secondary(void) { #ifdef CONFIG_IRQ_GIC /* This is Malta specific: IPI,performance and timer interrupts */ @@ -162,7 +162,7 @@ static void __cpuinit vsmp_init_secondary(void) STATUSF_IP6 | STATUSF_IP7); } -static void __cpuinit vsmp_smp_finish(void) +static void vsmp_smp_finish(void) { /* CDFIXME: remove this? */ write_c0_compare(read_c0_count() + (8* mips_hpt_frequency/HZ)); @@ -188,7 +188,7 @@ static void vsmp_cpus_done(void) * (unsigned long)idle->thread_info the gp * assumes a 1:1 mapping of TC => VPE */ -static void __cpuinit vsmp_boot_secondary(int cpu, struct task_struct *idle) +static void vsmp_boot_secondary(int cpu, struct task_struct *idle) { struct thread_info *gp = task_thread_info(idle); dvpe(); diff --git a/arch/mips/kernel/smp-up.c b/arch/mips/kernel/smp-up.c index 00500fea27507..7fde3e4d978f9 100644 --- a/arch/mips/kernel/smp-up.c +++ b/arch/mips/kernel/smp-up.c @@ -28,11 +28,11 @@ static inline void up_send_ipi_mask(const struct cpumask *mask, * After we've done initial boot, this function is called to allow the * board code to clean up state, if needed */ -static void __cpuinit up_init_secondary(void) +static void up_init_secondary(void) { } -static void __cpuinit up_smp_finish(void) +static void up_smp_finish(void) { } @@ -44,7 +44,7 @@ static void up_cpus_done(void) /* * Firmware CPU startup hook */ -static void __cpuinit up_boot_secondary(int cpu, struct task_struct *idle) +static void up_boot_secondary(int cpu, struct task_struct *idle) { } diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index caeec21df1c4b..57b89cba16245 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -86,7 +86,7 @@ static inline void set_cpu_sibling_map(int cpu) struct plat_smp_ops *mp_ops; EXPORT_SYMBOL(mp_ops); -__cpuinit void register_smp_ops(struct plat_smp_ops *ops) +void register_smp_ops(struct plat_smp_ops *ops) { if (mp_ops) printk(KERN_WARNING "Overriding previously set SMP ops\n"); @@ -98,7 +98,7 @@ __cpuinit void register_smp_ops(struct plat_smp_ops *ops) * First C code run on the secondary CPUs after being started up by * the master. */ -asmlinkage __cpuinit void start_secondary(void) +asmlinkage void start_secondary(void) { unsigned int cpu; @@ -197,7 +197,7 @@ void smp_prepare_boot_cpu(void) cpu_set(0, cpu_callin_map); } -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { mp_ops->boot_secondary(cpu, tidle); diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 75a4fd709841a..dfc1b911be04b 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c @@ -645,7 +645,7 @@ void smtc_prepare_cpus(int cpus) * (unsigned long)idle->thread_info the gp * */ -void __cpuinit smtc_boot_secondary(int cpu, struct task_struct *idle) +void smtc_boot_secondary(int cpu, struct task_struct *idle) { extern u32 kernelsp[NR_CPUS]; unsigned long flags; diff --git a/arch/mips/kernel/spram.c b/arch/mips/kernel/spram.c index 6af08d896e20b..93f86817f20a6 100644 --- a/arch/mips/kernel/spram.c +++ b/arch/mips/kernel/spram.c @@ -37,7 +37,7 @@ /* * Different semantics to the set_c0_* function built by __BUILD_SET_C0 */ -static __cpuinit unsigned int bis_c0_errctl(unsigned int set) +static unsigned int bis_c0_errctl(unsigned int set) { unsigned int res; res = read_c0_errctl(); @@ -45,7 +45,7 @@ static __cpuinit unsigned int bis_c0_errctl(unsigned int set) return res; } -static __cpuinit void ispram_store_tag(unsigned int offset, unsigned int data) +static void ispram_store_tag(unsigned int offset, unsigned int data) { unsigned int errctl; @@ -64,7 +64,7 @@ static __cpuinit void ispram_store_tag(unsigned int offset, unsigned int data) } -static __cpuinit unsigned int ispram_load_tag(unsigned int offset) +static unsigned int ispram_load_tag(unsigned int offset) { unsigned int data; unsigned int errctl; @@ -82,7 +82,7 @@ static __cpuinit unsigned int ispram_load_tag(unsigned int offset) return data; } -static __cpuinit void dspram_store_tag(unsigned int offset, unsigned int data) +static void dspram_store_tag(unsigned int offset, unsigned int data) { unsigned int errctl; @@ -98,7 +98,7 @@ static __cpuinit void dspram_store_tag(unsigned int offset, unsigned int data) } -static __cpuinit unsigned int dspram_load_tag(unsigned int offset) +static unsigned int dspram_load_tag(unsigned int offset) { unsigned int data; unsigned int errctl; @@ -115,7 +115,7 @@ static __cpuinit unsigned int dspram_load_tag(unsigned int offset) return data; } -static __cpuinit void probe_spram(char *type, +static void probe_spram(char *type, unsigned int base, unsigned int (*read)(unsigned int), void (*write)(unsigned int, unsigned int)) @@ -196,7 +196,7 @@ static __cpuinit void probe_spram(char *type, offset += 2 * SPRAM_TAG_STRIDE; } } -void __cpuinit spram_config(void) +void spram_config(void) { struct cpuinfo_mips *c = ¤t_cpu_data; unsigned int config0; diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c index 1ff43d5ac2c4e..84536bf4a1540 100644 --- a/arch/mips/kernel/sync-r4k.c +++ b/arch/mips/kernel/sync-r4k.c @@ -20,15 +20,15 @@ #include #include -static atomic_t __cpuinitdata count_start_flag = ATOMIC_INIT(0); -static atomic_t __cpuinitdata count_count_start = ATOMIC_INIT(0); -static atomic_t __cpuinitdata count_count_stop = ATOMIC_INIT(0); -static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0); +static atomic_t count_start_flag = ATOMIC_INIT(0); +static atomic_t count_count_start = ATOMIC_INIT(0); +static atomic_t count_count_stop = ATOMIC_INIT(0); +static atomic_t count_reference = ATOMIC_INIT(0); #define COUNTON 100 #define NR_LOOPS 5 -void __cpuinit synchronise_count_master(int cpu) +void synchronise_count_master(int cpu) { int i; unsigned long flags; @@ -106,7 +106,7 @@ void __cpuinit synchronise_count_master(int cpu) printk("done.\n"); } -void __cpuinit synchronise_count_slave(int cpu) +void synchronise_count_slave(int cpu) { int i; unsigned int initcount; diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index a75ae40184aa3..4846c221ceec7 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -1642,7 +1642,7 @@ int cp0_compare_irq_shift; int cp0_perfcount_irq; EXPORT_SYMBOL_GPL(cp0_perfcount_irq); -static int __cpuinitdata noulri; +static int noulri; static int __init ulri_disable(char *s) { @@ -1653,7 +1653,7 @@ static int __init ulri_disable(char *s) } __setup("noulri", ulri_disable); -void __cpuinit per_cpu_trap_init(bool is_boot_cpu) +void per_cpu_trap_init(bool is_boot_cpu) { unsigned int cpu = smp_processor_id(); unsigned int status_set = ST0_CU0; @@ -1770,7 +1770,7 @@ void __cpuinit per_cpu_trap_init(bool is_boot_cpu) } /* Install CPU exception handler */ -void __cpuinit set_handler(unsigned long offset, void *addr, unsigned long size) +void set_handler(unsigned long offset, void *addr, unsigned long size) { #ifdef CONFIG_CPU_MICROMIPS memcpy((void *)(ebase + offset), ((unsigned char *)addr - 1), size); @@ -1780,7 +1780,7 @@ void __cpuinit set_handler(unsigned long offset, void *addr, unsigned long size) local_flush_icache_range(ebase + offset, ebase + offset + size); } -static char panic_null_cerr[] __cpuinitdata = +static char panic_null_cerr[] = "Trying to set NULL cache error exception handler"; /* @@ -1788,7 +1788,7 @@ static char panic_null_cerr[] __cpuinitdata = * This is suitable only for the cache error exception which is the only * exception handler that is being run uncached. */ -void __cpuinit set_uncached_handler(unsigned long offset, void *addr, +void set_uncached_handler(unsigned long offset, void *addr, unsigned long size) { unsigned long uncached_ebase = CKSEG1ADDR(ebase); diff --git a/arch/mips/kernel/watch.c b/arch/mips/kernel/watch.c index 7726f6157d9e7..3b7b9003ae2aa 100644 --- a/arch/mips/kernel/watch.c +++ b/arch/mips/kernel/watch.c @@ -100,7 +100,7 @@ void mips_clear_watch_registers(void) } } -__cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c) +void mips_probe_watch_registers(struct cpuinfo_mips *c) { unsigned int t; diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c index 51194875f1582..eb3e186596304 100644 --- a/arch/mips/lantiq/irq.c +++ b/arch/mips/lantiq/irq.c @@ -461,7 +461,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) return 0; } -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { return MIPS_CPU_TIMER_IRQ; } diff --git a/arch/mips/lib/uncached.c b/arch/mips/lib/uncached.c index 65e3dfc4e5855..d8522f8e842a2 100644 --- a/arch/mips/lib/uncached.c +++ b/arch/mips/lib/uncached.c @@ -36,7 +36,7 @@ * values, so we can avoid sharing the same stack area between a cached * and the uncached mode. */ -unsigned long __cpuinit run_uncached(void *func) +unsigned long run_uncached(void *func) { register long sp __asm__("$sp"); register long ret __asm__("$2"); diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c index 8557fb5528632..a0bcdbb81d410 100644 --- a/arch/mips/mm/c-octeon.c +++ b/arch/mips/mm/c-octeon.c @@ -180,7 +180,7 @@ static void octeon_flush_kernel_vmap_range(unsigned long vaddr, int size) * Probe Octeon's caches * */ -static void __cpuinit probe_octeon(void) +static void probe_octeon(void) { unsigned long icache_size; unsigned long dcache_size; @@ -251,7 +251,7 @@ static void __cpuinit probe_octeon(void) } } -static void __cpuinit octeon_cache_error_setup(void) +static void octeon_cache_error_setup(void) { extern char except_vec2_octeon; set_handler(0x100, &except_vec2_octeon, 0x80); @@ -261,7 +261,7 @@ static void __cpuinit octeon_cache_error_setup(void) * Setup the Octeon cache flush routines * */ -void __cpuinit octeon_cache_init(void) +void octeon_cache_init(void) { probe_octeon(); diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c index 704dc735a59df..2fcde0c8ea029 100644 --- a/arch/mips/mm/c-r3k.c +++ b/arch/mips/mm/c-r3k.c @@ -26,7 +26,7 @@ static unsigned long icache_size, dcache_size; /* Size in bytes */ static unsigned long icache_lsize, dcache_lsize; /* Size in bytes */ -unsigned long __cpuinit r3k_cache_size(unsigned long ca_flags) +unsigned long r3k_cache_size(unsigned long ca_flags) { unsigned long flags, status, dummy, size; volatile unsigned long *p; @@ -61,7 +61,7 @@ unsigned long __cpuinit r3k_cache_size(unsigned long ca_flags) return size * sizeof(*p); } -unsigned long __cpuinit r3k_cache_lsize(unsigned long ca_flags) +unsigned long r3k_cache_lsize(unsigned long ca_flags) { unsigned long flags, status, lsize, i; volatile unsigned long *p; @@ -90,7 +90,7 @@ unsigned long __cpuinit r3k_cache_lsize(unsigned long ca_flags) return lsize * sizeof(*p); } -static void __cpuinit r3k_probe_cache(void) +static void r3k_probe_cache(void) { dcache_size = r3k_cache_size(ST0_ISC); if (dcache_size) @@ -312,7 +312,7 @@ static void r3k_dma_cache_wback_inv(unsigned long start, unsigned long size) r3k_flush_dcache_range(start, start + size); } -void __cpuinit r3k_cache_init(void) +void r3k_cache_init(void) { extern void build_clear_page(void); extern void build_copy_page(void); diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index c2ec87e5d1cc6..e48a1e5240ee5 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -108,7 +108,7 @@ static inline void r4k_blast_dcache_page_dc64(unsigned long addr) blast_dcache64_page(addr); } -static void __cpuinit r4k_blast_dcache_page_setup(void) +static void r4k_blast_dcache_page_setup(void) { unsigned long dc_lsize = cpu_dcache_line_size(); @@ -124,7 +124,7 @@ static void __cpuinit r4k_blast_dcache_page_setup(void) static void (* r4k_blast_dcache_page_indexed)(unsigned long addr); -static void __cpuinit r4k_blast_dcache_page_indexed_setup(void) +static void r4k_blast_dcache_page_indexed_setup(void) { unsigned long dc_lsize = cpu_dcache_line_size(); @@ -141,7 +141,7 @@ static void __cpuinit r4k_blast_dcache_page_indexed_setup(void) void (* r4k_blast_dcache)(void); EXPORT_SYMBOL(r4k_blast_dcache); -static void __cpuinit r4k_blast_dcache_setup(void) +static void r4k_blast_dcache_setup(void) { unsigned long dc_lsize = cpu_dcache_line_size(); @@ -228,7 +228,7 @@ static inline void tx49_blast_icache32_page_indexed(unsigned long page) static void (* r4k_blast_icache_page)(unsigned long addr); -static void __cpuinit r4k_blast_icache_page_setup(void) +static void r4k_blast_icache_page_setup(void) { unsigned long ic_lsize = cpu_icache_line_size(); @@ -245,7 +245,7 @@ static void __cpuinit r4k_blast_icache_page_setup(void) static void (* r4k_blast_icache_page_indexed)(unsigned long addr); -static void __cpuinit r4k_blast_icache_page_indexed_setup(void) +static void r4k_blast_icache_page_indexed_setup(void) { unsigned long ic_lsize = cpu_icache_line_size(); @@ -270,7 +270,7 @@ static void __cpuinit r4k_blast_icache_page_indexed_setup(void) void (* r4k_blast_icache)(void); EXPORT_SYMBOL(r4k_blast_icache); -static void __cpuinit r4k_blast_icache_setup(void) +static void r4k_blast_icache_setup(void) { unsigned long ic_lsize = cpu_icache_line_size(); @@ -291,7 +291,7 @@ static void __cpuinit r4k_blast_icache_setup(void) static void (* r4k_blast_scache_page)(unsigned long addr); -static void __cpuinit r4k_blast_scache_page_setup(void) +static void r4k_blast_scache_page_setup(void) { unsigned long sc_lsize = cpu_scache_line_size(); @@ -309,7 +309,7 @@ static void __cpuinit r4k_blast_scache_page_setup(void) static void (* r4k_blast_scache_page_indexed)(unsigned long addr); -static void __cpuinit r4k_blast_scache_page_indexed_setup(void) +static void r4k_blast_scache_page_indexed_setup(void) { unsigned long sc_lsize = cpu_scache_line_size(); @@ -327,7 +327,7 @@ static void __cpuinit r4k_blast_scache_page_indexed_setup(void) static void (* r4k_blast_scache)(void); -static void __cpuinit r4k_blast_scache_setup(void) +static void r4k_blast_scache_setup(void) { unsigned long sc_lsize = cpu_scache_line_size(); @@ -804,11 +804,11 @@ static inline void alias_74k_erratum(struct cpuinfo_mips *c) } } -static char *way_string[] __cpuinitdata = { NULL, "direct mapped", "2-way", +static char *way_string[] = { NULL, "direct mapped", "2-way", "3-way", "4-way", "5-way", "6-way", "7-way", "8-way" }; -static void __cpuinit probe_pcache(void) +static void probe_pcache(void) { struct cpuinfo_mips *c = ¤t_cpu_data; unsigned int config = read_c0_config(); @@ -1126,7 +1126,7 @@ static void __cpuinit probe_pcache(void) * executes in KSEG1 space or else you will crash and burn badly. You have * been warned. */ -static int __cpuinit probe_scache(void) +static int probe_scache(void) { unsigned long flags, addr, begin, end, pow2; unsigned int config = read_c0_config(); @@ -1203,7 +1203,7 @@ extern int r5k_sc_init(void); extern int rm7k_sc_init(void); extern int mips_sc_init(void); -static void __cpuinit setup_scache(void) +static void setup_scache(void) { struct cpuinfo_mips *c = ¤t_cpu_data; unsigned int config = read_c0_config(); @@ -1336,7 +1336,7 @@ static void nxp_pr4450_fixup_config(void) NXP_BARRIER(); } -static int __cpuinitdata cca = -1; +static int cca = -1; static int __init cca_setup(char *str) { @@ -1347,7 +1347,7 @@ static int __init cca_setup(char *str) early_param("cca", cca_setup); -static void __cpuinit coherency_setup(void) +static void coherency_setup(void) { if (cca < 0 || cca > 7) cca = read_c0_config() & CONF_CM_CMASK; @@ -1387,7 +1387,7 @@ static void __cpuinit coherency_setup(void) } } -static void __cpuinit r4k_cache_error_setup(void) +static void r4k_cache_error_setup(void) { extern char __weak except_vec2_generic; extern char __weak except_vec2_sb1; @@ -1405,7 +1405,7 @@ static void __cpuinit r4k_cache_error_setup(void) } } -void __cpuinit r4k_cache_init(void) +void r4k_cache_init(void) { extern void build_clear_page(void); extern void build_copy_page(void); diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c index ba9da270289fa..8d909dbbf37f5 100644 --- a/arch/mips/mm/c-tx39.c +++ b/arch/mips/mm/c-tx39.c @@ -344,7 +344,7 @@ static __init void tx39_probe_cache(void) } } -void __cpuinit tx39_cache_init(void) +void tx39_cache_init(void) { extern void build_clear_page(void); extern void build_copy_page(void); diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 5aeb3eb0b72f8..15f813c303b45 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -182,7 +182,7 @@ static inline void setup_protection_map(void) } } -void __cpuinit cpu_cache_init(void) +void cpu_cache_init(void) { if (cpu_has_3k_cache) { extern void __weak r3k_cache_init(void); diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c index 4eb8dcfaf1ce1..e5506a54959cd 100644 --- a/arch/mips/mm/page.c +++ b/arch/mips/mm/page.c @@ -66,8 +66,8 @@ UASM_L_LA(_copy_pref_both) UASM_L_LA(_copy_pref_store) /* We need one branch and therefore one relocation per target label. */ -static struct uasm_label __cpuinitdata labels[5]; -static struct uasm_reloc __cpuinitdata relocs[5]; +static struct uasm_label labels[5]; +static struct uasm_reloc relocs[5]; #define cpu_is_r4600_v1_x() ((read_c0_prid() & 0xfffffff0) == 0x00002010) #define cpu_is_r4600_v2_x() ((read_c0_prid() & 0xfffffff0) == 0x00002020) @@ -88,7 +88,7 @@ static int half_copy_loop_size __cpuinitdata; static int cache_line_size __cpuinitdata; #define cache_line_mask() (cache_line_size - 1) -static inline void __cpuinit +static inline void pg_addiu(u32 **buf, unsigned int reg1, unsigned int reg2, unsigned int off) { if (cpu_has_64bit_gp_regs && DADDI_WAR && r4k_daddiu_bug()) { @@ -108,7 +108,7 @@ pg_addiu(u32 **buf, unsigned int reg1, unsigned int reg2, unsigned int off) } } -static void __cpuinit set_prefetch_parameters(void) +static void set_prefetch_parameters(void) { if (cpu_has_64bit_gp_regs || cpu_has_64bit_zero_reg) clear_word_size = 8; @@ -199,7 +199,7 @@ static void __cpuinit set_prefetch_parameters(void) 4 * copy_word_size)); } -static void __cpuinit build_clear_store(u32 **buf, int off) +static void build_clear_store(u32 **buf, int off) { if (cpu_has_64bit_gp_regs || cpu_has_64bit_zero_reg) { uasm_i_sd(buf, ZERO, off, A0); @@ -208,7 +208,7 @@ static void __cpuinit build_clear_store(u32 **buf, int off) } } -static inline void __cpuinit build_clear_pref(u32 **buf, int off) +static inline void build_clear_pref(u32 **buf, int off) { if (off & cache_line_mask()) return; @@ -240,7 +240,7 @@ extern u32 __clear_page_end; extern u32 __copy_page_start; extern u32 __copy_page_end; -void __cpuinit build_clear_page(void) +void build_clear_page(void) { int off; u32 *buf = &__clear_page_start; @@ -333,7 +333,7 @@ void __cpuinit build_clear_page(void) pr_debug("\t.set pop\n"); } -static void __cpuinit build_copy_load(u32 **buf, int reg, int off) +static void build_copy_load(u32 **buf, int reg, int off) { if (cpu_has_64bit_gp_regs) { uasm_i_ld(buf, reg, off, A1); @@ -342,7 +342,7 @@ static void __cpuinit build_copy_load(u32 **buf, int reg, int off) } } -static void __cpuinit build_copy_store(u32 **buf, int reg, int off) +static void build_copy_store(u32 **buf, int reg, int off) { if (cpu_has_64bit_gp_regs) { uasm_i_sd(buf, reg, off, A0); @@ -387,7 +387,7 @@ static inline void build_copy_store_pref(u32 **buf, int off) } } -void __cpuinit build_copy_page(void) +void build_copy_page(void) { int off; u32 *buf = &__copy_page_start; diff --git a/arch/mips/mm/sc-ip22.c b/arch/mips/mm/sc-ip22.c index c6aaed934d536..dc7c5a5214a9e 100644 --- a/arch/mips/mm/sc-ip22.c +++ b/arch/mips/mm/sc-ip22.c @@ -167,7 +167,7 @@ static struct bcache_ops indy_sc_ops = { .bc_inv = indy_sc_wback_invalidate }; -void __cpuinit indy_sc_init(void) +void indy_sc_init(void) { if (indy_sc_probe()) { indy_sc_enable(); diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c index df96da7e939b5..5d01392e3518d 100644 --- a/arch/mips/mm/sc-mips.c +++ b/arch/mips/mm/sc-mips.c @@ -132,7 +132,7 @@ static inline int __init mips_sc_probe(void) return 1; } -int __cpuinit mips_sc_init(void) +int mips_sc_init(void) { int found = mips_sc_probe(); if (found) { diff --git a/arch/mips/mm/sc-r5k.c b/arch/mips/mm/sc-r5k.c index 8bc67720e145f..0216ed6eaa2a9 100644 --- a/arch/mips/mm/sc-r5k.c +++ b/arch/mips/mm/sc-r5k.c @@ -98,7 +98,7 @@ static struct bcache_ops r5k_sc_ops = { .bc_inv = r5k_dma_cache_inv_sc }; -void __cpuinit r5k_sc_init(void) +void r5k_sc_init(void) { if (r5k_sc_probe()) { r5k_sc_enable(); diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c index 274af3be1442b..aaffbba337064 100644 --- a/arch/mips/mm/sc-rm7k.c +++ b/arch/mips/mm/sc-rm7k.c @@ -104,7 +104,7 @@ static void blast_rm7k_tcache(void) /* * This function is executed in uncached address space. */ -static __cpuinit void __rm7k_tc_enable(void) +static void __rm7k_tc_enable(void) { int i; @@ -117,7 +117,7 @@ static __cpuinit void __rm7k_tc_enable(void) cache_op(Index_Store_Tag_T, CKSEG0ADDR(i)); } -static __cpuinit void rm7k_tc_enable(void) +static void rm7k_tc_enable(void) { if (read_c0_config() & RM7K_CONF_TE) return; @@ -130,7 +130,7 @@ static __cpuinit void rm7k_tc_enable(void) /* * This function is executed in uncached address space. */ -static __cpuinit void __rm7k_sc_enable(void) +static void __rm7k_sc_enable(void) { int i; @@ -143,7 +143,7 @@ static __cpuinit void __rm7k_sc_enable(void) cache_op(Index_Store_Tag_SD, CKSEG0ADDR(i)); } -static __cpuinit void rm7k_sc_enable(void) +static void rm7k_sc_enable(void) { if (read_c0_config() & RM7K_CONF_SE) return; @@ -184,7 +184,7 @@ static struct bcache_ops rm7k_sc_ops = { * This is a probing function like the one found in c-r4k.c, we look for the * wrap around point with different addresses. */ -static __cpuinit void __probe_tcache(void) +static void __probe_tcache(void) { unsigned long flags, addr, begin, end, pow2; @@ -226,7 +226,7 @@ static __cpuinit void __probe_tcache(void) local_irq_restore(flags); } -void __cpuinit rm7k_sc_init(void) +void rm7k_sc_init(void) { struct cpuinfo_mips *c = ¤t_cpu_data; unsigned int config = read_c0_config(); diff --git a/arch/mips/mm/tlb-r3k.c b/arch/mips/mm/tlb-r3k.c index a63d1ed0827fe..9aca10994cd22 100644 --- a/arch/mips/mm/tlb-r3k.c +++ b/arch/mips/mm/tlb-r3k.c @@ -276,7 +276,7 @@ void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1, } } -void __cpuinit tlb_init(void) +void tlb_init(void) { local_flush_tlb_all(); diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index c643de4c473a8..00b26a67a06d8 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -389,7 +389,7 @@ int __init has_transparent_hugepage(void) #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ -static int __cpuinitdata ntlb; +static int ntlb; static int __init set_ntlb(char *str) { get_option(&str, &ntlb); @@ -398,7 +398,7 @@ static int __init set_ntlb(char *str) __setup("ntlb=", set_ntlb); -void __cpuinit tlb_init(void) +void tlb_init(void) { /* * You should never change this register: diff --git a/arch/mips/mm/tlb-r8k.c b/arch/mips/mm/tlb-r8k.c index 91c2499f806a2..6a99733a44402 100644 --- a/arch/mips/mm/tlb-r8k.c +++ b/arch/mips/mm/tlb-r8k.c @@ -213,14 +213,14 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte) local_irq_restore(flags); } -static void __cpuinit probe_tlb(unsigned long config) +static void probe_tlb(unsigned long config) { struct cpuinfo_mips *c = ¤t_cpu_data; c->tlbsize = 3 * 128; /* 3 sets each 128 entries */ } -void __cpuinit tlb_init(void) +void tlb_init(void) { unsigned int config = read_c0_config(); unsigned long status; diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index a91a7a99f70f3..842b087443a8b 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c @@ -136,7 +136,7 @@ static int scratchpad_offset(int i) * why; it's not an issue caused by the core RTL. * */ -static int __cpuinit m4kc_tlbp_war(void) +static int m4kc_tlbp_war(void) { return (current_cpu_data.processor_id & 0xffff00) == (PRID_COMP_MIPS | PRID_IMP_4KC); @@ -181,9 +181,9 @@ UASM_L_LA(_large_segbits_fault) UASM_L_LA(_tlb_huge_update) #endif -static int __cpuinitdata hazard_instance; +static int hazard_instance; -static void __cpuinit uasm_bgezl_hazard(u32 **p, +static void uasm_bgezl_hazard(u32 **p, struct uasm_reloc **r, int instance) { @@ -196,7 +196,7 @@ static void __cpuinit uasm_bgezl_hazard(u32 **p, } } -static void __cpuinit uasm_bgezl_label(struct uasm_label **l, +static void uasm_bgezl_label(struct uasm_label **l, u32 **p, int instance) { @@ -305,7 +305,7 @@ static int check_for_high_segbits __cpuinitdata; static unsigned int kscratch_used_mask __cpuinitdata; -static int __cpuinit allocate_kscratch(void) +static int allocate_kscratch(void) { int r; unsigned int a = cpu_data[0].kscratch_mask & ~kscratch_used_mask; @@ -326,7 +326,7 @@ static int scratch_reg __cpuinitdata; static int pgd_reg __cpuinitdata; enum vmalloc64_mode {not_refill, refill_scratch, refill_noscratch}; -static struct work_registers __cpuinit build_get_work_registers(u32 **p) +static struct work_registers build_get_work_registers(u32 **p) { struct work_registers r; @@ -382,7 +382,7 @@ static struct work_registers __cpuinit build_get_work_registers(u32 **p) return r; } -static void __cpuinit build_restore_work_registers(u32 **p) +static void build_restore_work_registers(u32 **p) { if (scratch_reg > 0) { UASM_i_MFC0(p, 1, 31, scratch_reg); @@ -407,7 +407,7 @@ extern unsigned long pgd_current[]; /* * The R3000 TLB handler is simple. */ -static void __cpuinit build_r3000_tlb_refill_handler(void) +static void build_r3000_tlb_refill_handler(void) { long pgdc = (long)pgd_current; u32 *p; @@ -476,7 +476,7 @@ static u32 final_handler[64] __cpuinitdata; * * As if we MIPS hackers wouldn't know how to nop pipelines happy ... */ -static void __cpuinit __maybe_unused build_tlb_probe_entry(u32 **p) +static void __maybe_unused build_tlb_probe_entry(u32 **p) { switch (current_cpu_type()) { /* Found by experiment: R4600 v2.0/R4700 needs this, too. */ @@ -500,7 +500,7 @@ static void __cpuinit __maybe_unused build_tlb_probe_entry(u32 **p) */ enum tlb_write_entry { tlb_random, tlb_indexed }; -static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, +static void build_tlb_write_entry(u32 **p, struct uasm_label **l, struct uasm_reloc **r, enum tlb_write_entry wmode) { @@ -636,7 +636,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, } } -static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p, +static __maybe_unused void build_convert_pte_to_entrylo(u32 **p, unsigned int reg) { if (cpu_has_rixi) { @@ -652,7 +652,7 @@ static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p, #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT -static __cpuinit void build_restore_pagemask(u32 **p, +static void build_restore_pagemask(u32 **p, struct uasm_reloc **r, unsigned int tmp, enum label_id lid, @@ -695,7 +695,7 @@ static __cpuinit void build_restore_pagemask(u32 **p, } } -static __cpuinit void build_huge_tlb_write_entry(u32 **p, +static void build_huge_tlb_write_entry(u32 **p, struct uasm_label **l, struct uasm_reloc **r, unsigned int tmp, @@ -715,7 +715,7 @@ static __cpuinit void build_huge_tlb_write_entry(u32 **p, /* * Check if Huge PTE is present, if so then jump to LABEL. */ -static void __cpuinit +static void build_is_huge_pte(u32 **p, struct uasm_reloc **r, unsigned int tmp, unsigned int pmd, int lid) { @@ -728,7 +728,7 @@ build_is_huge_pte(u32 **p, struct uasm_reloc **r, unsigned int tmp, } } -static __cpuinit void build_huge_update_entries(u32 **p, +static void build_huge_update_entries(u32 **p, unsigned int pte, unsigned int tmp) { @@ -760,7 +760,7 @@ static __cpuinit void build_huge_update_entries(u32 **p, UASM_i_MTC0(p, pte, C0_ENTRYLO1); /* load it */ } -static __cpuinit void build_huge_handler_tail(u32 **p, +static void build_huge_handler_tail(u32 **p, struct uasm_reloc **r, struct uasm_label **l, unsigned int pte, @@ -783,7 +783,7 @@ static __cpuinit void build_huge_handler_tail(u32 **p, * TMP and PTR are scratch. * TMP will be clobbered, PTR will hold the pmd entry. */ -static void __cpuinit +static void build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, unsigned int tmp, unsigned int ptr) { @@ -875,7 +875,7 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, * BVADDR is the faulting address, PTR is scratch. * PTR will hold the pgd for vmalloc. */ -static void __cpuinit +static void build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, unsigned int bvaddr, unsigned int ptr, enum vmalloc64_mode mode) @@ -945,7 +945,7 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, * TMP and PTR are scratch. * TMP will be clobbered, PTR will hold the pgd entry. */ -static void __cpuinit __maybe_unused +static void __maybe_unused build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) { long pgdc = (long)pgd_current; @@ -980,7 +980,7 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) #endif /* !CONFIG_64BIT */ -static void __cpuinit build_adjust_context(u32 **p, unsigned int ctx) +static void build_adjust_context(u32 **p, unsigned int ctx) { unsigned int shift = 4 - (PTE_T_LOG2 + 1) + PAGE_SHIFT - 12; unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1); @@ -1006,7 +1006,7 @@ static void __cpuinit build_adjust_context(u32 **p, unsigned int ctx) uasm_i_andi(p, ctx, ctx, mask); } -static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) +static void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) { /* * Bug workaround for the Nevada. It seems as if under certain @@ -1031,7 +1031,7 @@ static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr UASM_i_ADDU(p, ptr, ptr, tmp); /* add in offset */ } -static void __cpuinit build_update_entries(u32 **p, unsigned int tmp, +static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep) { /* @@ -1094,7 +1094,7 @@ struct mips_huge_tlb_info { bool need_reload_pte; }; -static struct mips_huge_tlb_info __cpuinit +static struct mips_huge_tlb_info build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l, struct uasm_reloc **r, unsigned int tmp, unsigned int ptr, int c0_scratch) @@ -1273,7 +1273,7 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l, */ #define MIPS64_REFILL_INSNS 32 -static void __cpuinit build_r4000_tlb_refill_handler(void) +static void build_r4000_tlb_refill_handler(void) { u32 *p = tlb_handler; struct uasm_label *l = labels; @@ -1461,7 +1461,7 @@ u32 handle_tlbm[FASTPATH_SIZE] __cacheline_aligned; #ifdef CONFIG_MIPS_PGD_C0_CONTEXT u32 tlbmiss_handler_setup_pgd_array[16] __cacheline_aligned; -static void __cpuinit build_r4000_setup_pgd(void) +static void build_r4000_setup_pgd(void) { const int a0 = 4; const int a1 = 5; @@ -1509,7 +1509,7 @@ static void __cpuinit build_r4000_setup_pgd(void) } #endif -static void __cpuinit +static void iPTE_LW(u32 **p, unsigned int pte, unsigned int ptr) { #ifdef CONFIG_SMP @@ -1529,7 +1529,7 @@ iPTE_LW(u32 **p, unsigned int pte, unsigned int ptr) #endif } -static void __cpuinit +static void iPTE_SW(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr, unsigned int mode) { @@ -1589,7 +1589,7 @@ iPTE_SW(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr, * the page table where this PTE is located, PTE will be re-loaded * with it's original value. */ -static void __cpuinit +static void build_pte_present(u32 **p, struct uasm_reloc **r, int pte, int ptr, int scratch, enum label_id lid) { @@ -1617,7 +1617,7 @@ build_pte_present(u32 **p, struct uasm_reloc **r, } /* Make PTE valid, store result in PTR. */ -static void __cpuinit +static void build_make_valid(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr) { @@ -1630,7 +1630,7 @@ build_make_valid(u32 **p, struct uasm_reloc **r, unsigned int pte, * Check if PTE can be written to, if not branch to LABEL. Regardless * restore PTE with value from PTR when done. */ -static void __cpuinit +static void build_pte_writable(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr, int scratch, enum label_id lid) @@ -1650,7 +1650,7 @@ build_pte_writable(u32 **p, struct uasm_reloc **r, /* Make PTE writable, update software status bits as well, then store * at PTR. */ -static void __cpuinit +static void build_make_write(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr) { @@ -1664,7 +1664,7 @@ build_make_write(u32 **p, struct uasm_reloc **r, unsigned int pte, * Check if PTE can be modified, if not branch to LABEL. Regardless * restore PTE with value from PTR when done. */ -static void __cpuinit +static void build_pte_modifiable(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr, int scratch, enum label_id lid) @@ -1693,7 +1693,7 @@ build_pte_modifiable(u32 **p, struct uasm_reloc **r, * This places the pte into ENTRYLO0 and writes it with tlbwi. * Then it returns. */ -static void __cpuinit +static void build_r3000_pte_reload_tlbwi(u32 **p, unsigned int pte, unsigned int tmp) { uasm_i_mtc0(p, pte, C0_ENTRYLO0); /* cp0 delay */ @@ -1709,7 +1709,7 @@ build_r3000_pte_reload_tlbwi(u32 **p, unsigned int pte, unsigned int tmp) * may have the probe fail bit set as a result of a trap on a * kseg2 access, i.e. without refill. Then it returns. */ -static void __cpuinit +static void build_r3000_tlb_reload_write(u32 **p, struct uasm_label **l, struct uasm_reloc **r, unsigned int pte, unsigned int tmp) @@ -1727,7 +1727,7 @@ build_r3000_tlb_reload_write(u32 **p, struct uasm_label **l, uasm_i_rfe(p); /* branch delay */ } -static void __cpuinit +static void build_r3000_tlbchange_handler_head(u32 **p, unsigned int pte, unsigned int ptr) { @@ -1747,7 +1747,7 @@ build_r3000_tlbchange_handler_head(u32 **p, unsigned int pte, uasm_i_tlbp(p); /* load delay */ } -static void __cpuinit build_r3000_tlb_load_handler(void) +static void build_r3000_tlb_load_handler(void) { u32 *p = handle_tlbl; struct uasm_label *l = labels; @@ -1777,7 +1777,7 @@ static void __cpuinit build_r3000_tlb_load_handler(void) dump_handler("r3000_tlb_load", handle_tlbl, ARRAY_SIZE(handle_tlbl)); } -static void __cpuinit build_r3000_tlb_store_handler(void) +static void build_r3000_tlb_store_handler(void) { u32 *p = handle_tlbs; struct uasm_label *l = labels; @@ -1807,7 +1807,7 @@ static void __cpuinit build_r3000_tlb_store_handler(void) dump_handler("r3000_tlb_store", handle_tlbs, ARRAY_SIZE(handle_tlbs)); } -static void __cpuinit build_r3000_tlb_modify_handler(void) +static void build_r3000_tlb_modify_handler(void) { u32 *p = handle_tlbm; struct uasm_label *l = labels; @@ -1841,7 +1841,7 @@ static void __cpuinit build_r3000_tlb_modify_handler(void) /* * R4000 style TLB load/store/modify handlers. */ -static struct work_registers __cpuinit +static struct work_registers build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l, struct uasm_reloc **r) { @@ -1877,7 +1877,7 @@ build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l, return wr; } -static void __cpuinit +static void build_r4000_tlbchange_handler_tail(u32 **p, struct uasm_label **l, struct uasm_reloc **r, unsigned int tmp, unsigned int ptr) @@ -1895,7 +1895,7 @@ build_r4000_tlbchange_handler_tail(u32 **p, struct uasm_label **l, #endif } -static void __cpuinit build_r4000_tlb_load_handler(void) +static void build_r4000_tlb_load_handler(void) { u32 *p = handle_tlbl; struct uasm_label *l = labels; @@ -2051,7 +2051,7 @@ static void __cpuinit build_r4000_tlb_load_handler(void) dump_handler("r4000_tlb_load", handle_tlbl, ARRAY_SIZE(handle_tlbl)); } -static void __cpuinit build_r4000_tlb_store_handler(void) +static void build_r4000_tlb_store_handler(void) { u32 *p = handle_tlbs; struct uasm_label *l = labels; @@ -2105,7 +2105,7 @@ static void __cpuinit build_r4000_tlb_store_handler(void) dump_handler("r4000_tlb_store", handle_tlbs, ARRAY_SIZE(handle_tlbs)); } -static void __cpuinit build_r4000_tlb_modify_handler(void) +static void build_r4000_tlb_modify_handler(void) { u32 *p = handle_tlbm; struct uasm_label *l = labels; @@ -2160,7 +2160,7 @@ static void __cpuinit build_r4000_tlb_modify_handler(void) dump_handler("r4000_tlb_modify", handle_tlbm, ARRAY_SIZE(handle_tlbm)); } -void __cpuinit build_tlb_refill_handler(void) +void build_tlb_refill_handler(void) { /* * The refill handler is generated per-CPU, multi-node systems @@ -2226,7 +2226,7 @@ void __cpuinit build_tlb_refill_handler(void) } } -void __cpuinit flush_tlb_handlers(void) +void flush_tlb_handlers(void) { local_flush_icache_range((unsigned long)handle_tlbl, (unsigned long)handle_tlbl + sizeof(handle_tlbl)); diff --git a/arch/mips/mti-malta/malta-smtc.c b/arch/mips/mti-malta/malta-smtc.c index becbf47506a59..c4849904f0139 100644 --- a/arch/mips/mti-malta/malta-smtc.c +++ b/arch/mips/mti-malta/malta-smtc.c @@ -32,7 +32,7 @@ static void msmtc_send_ipi_mask(const struct cpumask *mask, unsigned int action) /* * Post-config but pre-boot cleanup entry point */ -static void __cpuinit msmtc_init_secondary(void) +static void msmtc_init_secondary(void) { int myvpe; @@ -53,7 +53,7 @@ static void __cpuinit msmtc_init_secondary(void) /* * Platform "CPU" startup hook */ -static void __cpuinit msmtc_boot_secondary(int cpu, struct task_struct *idle) +static void msmtc_boot_secondary(int cpu, struct task_struct *idle) { smtc_boot_secondary(cpu, idle); } @@ -61,7 +61,7 @@ static void __cpuinit msmtc_boot_secondary(int cpu, struct task_struct *idle) /* * SMP initialization finalization entry point */ -static void __cpuinit msmtc_smp_finish(void) +static void msmtc_smp_finish(void) { smtc_smp_finish(); } diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c index 0ad305f75802b..53aad4a353756 100644 --- a/arch/mips/mti-malta/malta-time.c +++ b/arch/mips/mti-malta/malta-time.c @@ -150,7 +150,7 @@ static void __init plat_perf_setup(void) } } -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { #ifdef MSC01E_INT_BASE if (cpu_has_veic) { diff --git a/arch/mips/mti-sead3/sead3-time.c b/arch/mips/mti-sead3/sead3-time.c index 96b42eb9b5e22..a43ea3cc0a3bf 100644 --- a/arch/mips/mti-sead3/sead3-time.c +++ b/arch/mips/mti-sead3/sead3-time.c @@ -91,7 +91,7 @@ static void __init plat_perf_setup(void) } } -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { if (cpu_has_vint) set_vi_handler(cp0_compare_irq, mips_timer_dispatch); diff --git a/arch/mips/netlogic/common/smp.c b/arch/mips/netlogic/common/smp.c index ffba52489bef7..c01d554f64e14 100644 --- a/arch/mips/netlogic/common/smp.c +++ b/arch/mips/netlogic/common/smp.c @@ -116,7 +116,7 @@ void nlm_early_init_secondary(int cpu) /* * Code to run on secondary just after probing the CPU */ -static void __cpuinit nlm_init_secondary(void) +static void nlm_init_secondary(void) { int hwtid; @@ -252,7 +252,7 @@ static int nlm_parse_cpumask(cpumask_t *wakeup_mask) return 0; } -int __cpuinit nlm_wakeup_secondary_cpus(void) +int nlm_wakeup_secondary_cpus(void) { unsigned long reset_vec; char *reset_data; diff --git a/arch/mips/netlogic/common/time.c b/arch/mips/netlogic/common/time.c index 5c56555380bb1..045a396c57ced 100644 --- a/arch/mips/netlogic/common/time.c +++ b/arch/mips/netlogic/common/time.c @@ -54,7 +54,7 @@ #error "Unknown CPU" #endif -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { return IRQ_TIMER; } diff --git a/arch/mips/netlogic/xlr/wakeup.c b/arch/mips/netlogic/xlr/wakeup.c index 3ebf7411d67b1..37a40927ed719 100644 --- a/arch/mips/netlogic/xlr/wakeup.c +++ b/arch/mips/netlogic/xlr/wakeup.c @@ -49,7 +49,7 @@ #include #include -int __cpuinit xlr_wakeup_secondary_cpus(void) +int xlr_wakeup_secondary_cpus(void) { struct nlm_soc_info *nodep; unsigned int i, j, boot_cpu; diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c index 6eb65e44d9e4a..2946bdf654389 100644 --- a/arch/mips/pci/pci-ip27.c +++ b/arch/mips/pci/pci-ip27.c @@ -42,7 +42,7 @@ int irq_to_slot[MAX_PCI_BUSSES * MAX_DEVICES_PER_PCIBUS]; extern struct pci_ops bridge_pci_ops; -int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid) +int bridge_probe(nasid_t nasid, int widget_id, int masterwid) { unsigned long offset = NODE_OFFSET(nasid); struct bridge_controller *bc; diff --git a/arch/mips/pmcs-msp71xx/msp_smtc.c b/arch/mips/pmcs-msp71xx/msp_smtc.c index c8dcc1c01e181..6aa91401ddfc3 100644 --- a/arch/mips/pmcs-msp71xx/msp_smtc.c +++ b/arch/mips/pmcs-msp71xx/msp_smtc.c @@ -33,7 +33,7 @@ static void msp_smtc_send_ipi_mask(const struct cpumask *mask, /* * Post-config but pre-boot cleanup entry point */ -static void __cpuinit msp_smtc_init_secondary(void) +static void msp_smtc_init_secondary(void) { int myvpe; @@ -48,7 +48,7 @@ static void __cpuinit msp_smtc_init_secondary(void) /* * Platform "CPU" startup hook */ -static void __cpuinit msp_smtc_boot_secondary(int cpu, +static void msp_smtc_boot_secondary(int cpu, struct task_struct *idle) { smtc_boot_secondary(cpu, idle); @@ -57,7 +57,7 @@ static void __cpuinit msp_smtc_boot_secondary(int cpu, /* * SMP initialization finalization entry point */ -static void __cpuinit msp_smtc_smp_finish(void) +static void msp_smtc_smp_finish(void) { smtc_smp_finish(); } diff --git a/arch/mips/pmcs-msp71xx/msp_time.c b/arch/mips/pmcs-msp71xx/msp_time.c index 8f12ecc55ace5..fea917be0ff10 100644 --- a/arch/mips/pmcs-msp71xx/msp_time.c +++ b/arch/mips/pmcs-msp71xx/msp_time.c @@ -88,7 +88,7 @@ void __init plat_time_init(void) mips_hpt_frequency = cpu_rate/2; } -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { /* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe()) && !tim_installed) { diff --git a/arch/mips/pnx833x/common/interrupts.c b/arch/mips/pnx833x/common/interrupts.c index a4a90596c0ad4..e460865873c1c 100644 --- a/arch/mips/pnx833x/common/interrupts.c +++ b/arch/mips/pnx833x/common/interrupts.c @@ -281,7 +281,7 @@ void __init arch_init_irq(void) write_c0_status(read_c0_status() | IE_IRQ2); } -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { if (cpu_has_vint) set_vi_handler(cp0_compare_irq, pnx833x_timer_dispatch); diff --git a/arch/mips/powertv/time.c b/arch/mips/powertv/time.c index 9fd7b67f2af7c..f38b0d45eca90 100644 --- a/arch/mips/powertv/time.c +++ b/arch/mips/powertv/time.c @@ -25,7 +25,7 @@ #include "powertv-clock.h" -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { return irq_mips_timer; } diff --git a/arch/mips/ralink/irq.c b/arch/mips/ralink/irq.c index 320b1f1043fff..781b3d14a489e 100644 --- a/arch/mips/ralink/irq.c +++ b/arch/mips/ralink/irq.c @@ -73,7 +73,7 @@ static struct irq_chip ralink_intc_irq_chip = { .irq_mask_ack = ralink_intc_irq_mask, }; -unsigned int __cpuinit get_c0_compare_int(void) +unsigned int get_c0_compare_int(void) { return CP0_LEGACY_COMPARE_IRQ; } diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c index d41b1c6fb0329..ee736bd103f85 100644 --- a/arch/mips/sgi-ip27/ip27-init.c +++ b/arch/mips/sgi-ip27/ip27-init.c @@ -54,7 +54,7 @@ extern void pcibr_setup(cnodeid_t); extern void xtalk_probe_node(cnodeid_t nid); -static void __cpuinit per_hub_init(cnodeid_t cnode) +static void per_hub_init(cnodeid_t cnode) { struct hub_data *hub = hub_data(cnode); nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); @@ -110,7 +110,7 @@ static void __cpuinit per_hub_init(cnodeid_t cnode) } } -void __cpuinit per_cpu_init(void) +void per_cpu_init(void) { int cpu = smp_processor_id(); int slice = LOCAL_HUB_L(PI_CPU_NUM); diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c index f94638141b20e..f4ea8aa79ba2d 100644 --- a/arch/mips/sgi-ip27/ip27-smp.c +++ b/arch/mips/sgi-ip27/ip27-smp.c @@ -173,12 +173,12 @@ static void ip27_send_ipi_mask(const struct cpumask *mask, unsigned int action) ip27_send_ipi_single(i, action); } -static void __cpuinit ip27_init_secondary(void) +static void ip27_init_secondary(void) { per_cpu_init(); } -static void __cpuinit ip27_smp_finish(void) +static void ip27_smp_finish(void) { extern void hub_rt_clock_event_init(void); @@ -195,7 +195,7 @@ static void __init ip27_cpus_done(void) * set sp to the kernel stack of the newly created idle process, gp to the proc * struct so that current_thread_info() will work. */ -static void __cpuinit ip27_boot_secondary(int cpu, struct task_struct *idle) +static void ip27_boot_secondary(int cpu, struct task_struct *idle) { unsigned long gp = (unsigned long)task_thread_info(idle); unsigned long sp = __KSTK_TOS(idle); diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index 2e21b761cb9c7..1d97eaba0c5f0 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c @@ -106,7 +106,7 @@ struct irqaction hub_rt_irqaction = { #define NSEC_PER_CYCLE 800 #define CYCLES_PER_SEC (NSEC_PER_SEC / NSEC_PER_CYCLE) -void __cpuinit hub_rt_clock_event_init(void) +void hub_rt_clock_event_init(void) { unsigned int cpu = smp_processor_id(); struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); @@ -173,7 +173,7 @@ void __init plat_time_init(void) hub_rt_clock_event_init(); } -void __cpuinit cpu_time_init(void) +void cpu_time_init(void) { lboard_t *board; klcpu_t *cpu; @@ -194,7 +194,7 @@ void __cpuinit cpu_time_init(void) set_c0_status(SRB_TIMOCLK); } -void __cpuinit hub_rtc_init(cnodeid_t cnode) +void hub_rtc_init(cnodeid_t cnode) { /* diff --git a/arch/mips/sgi-ip27/ip27-xtalk.c b/arch/mips/sgi-ip27/ip27-xtalk.c index a4df7d0f6f12d..d59b820f528d1 100644 --- a/arch/mips/sgi-ip27/ip27-xtalk.c +++ b/arch/mips/sgi-ip27/ip27-xtalk.c @@ -23,7 +23,7 @@ extern int bridge_probe(nasid_t nasid, int widget, int masterwid); -static int __cpuinit probe_one_port(nasid_t nasid, int widget, int masterwid) +static int probe_one_port(nasid_t nasid, int widget, int masterwid) { widgetreg_t widget_id; xwidget_part_num_t partnum; @@ -47,7 +47,7 @@ static int __cpuinit probe_one_port(nasid_t nasid, int widget, int masterwid) return 0; } -static int __cpuinit xbow_probe(nasid_t nasid) +static int xbow_probe(nasid_t nasid) { lboard_t *brd; klxbow_t *xbow_p; @@ -100,7 +100,7 @@ static int __cpuinit xbow_probe(nasid_t nasid) return 0; } -void __cpuinit xtalk_probe_node(cnodeid_t nid) +void xtalk_probe_node(cnodeid_t nid) { volatile u64 hubreg; nasid_t nasid; diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.c index de88e22694a05..54e2c4de15c16 100644 --- a/arch/mips/sibyte/bcm1480/smp.c +++ b/arch/mips/sibyte/bcm1480/smp.c @@ -60,7 +60,7 @@ static void *mailbox_0_regs[] = { /* * SMP init and finish on secondary CPUs */ -void __cpuinit bcm1480_smp_init(void) +void bcm1480_smp_init(void) { unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 | STATUSF_IP1 | STATUSF_IP0; @@ -95,7 +95,7 @@ static void bcm1480_send_ipi_mask(const struct cpumask *mask, /* * Code to run on secondary just after probing the CPU */ -static void __cpuinit bcm1480_init_secondary(void) +static void bcm1480_init_secondary(void) { extern void bcm1480_smp_init(void); @@ -106,7 +106,7 @@ static void __cpuinit bcm1480_init_secondary(void) * Do any tidying up before marking online and running the idle * loop */ -static void __cpuinit bcm1480_smp_finish(void) +static void bcm1480_smp_finish(void) { extern void sb1480_clockevent_init(void); @@ -125,7 +125,7 @@ static void bcm1480_cpus_done(void) * Setup the PC, SP, and GP of a secondary processor and start it * running! */ -static void __cpuinit bcm1480_boot_secondary(int cpu, struct task_struct *idle) +static void bcm1480_boot_secondary(int cpu, struct task_struct *idle) { int retval; diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c index 285cfef4ebc08..d7b942db0ea51 100644 --- a/arch/mips/sibyte/sb1250/smp.c +++ b/arch/mips/sibyte/sb1250/smp.c @@ -48,7 +48,7 @@ static void *mailbox_regs[] = { /* * SMP init and finish on secondary CPUs */ -void __cpuinit sb1250_smp_init(void) +void sb1250_smp_init(void) { unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 | STATUSF_IP1 | STATUSF_IP0; @@ -83,7 +83,7 @@ static inline void sb1250_send_ipi_mask(const struct cpumask *mask, /* * Code to run on secondary just after probing the CPU */ -static void __cpuinit sb1250_init_secondary(void) +static void sb1250_init_secondary(void) { extern void sb1250_smp_init(void); @@ -94,7 +94,7 @@ static void __cpuinit sb1250_init_secondary(void) * Do any tidying up before marking online and running the idle * loop */ -static void __cpuinit sb1250_smp_finish(void) +static void sb1250_smp_finish(void) { extern void sb1250_clockevent_init(void); @@ -113,7 +113,7 @@ static void sb1250_cpus_done(void) * Setup the PC, SP, and GP of a secondary processor and start it * running! */ -static void __cpuinit sb1250_boot_secondary(int cpu, struct task_struct *idle) +static void sb1250_boot_secondary(int cpu, struct task_struct *idle) { int retval; diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index f4d5bedc3b4f7..d7359ffbcbdd3 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -267,7 +267,7 @@ void __init detect_unit_config(unsigned long upr, unsigned long mask, * */ -void __cpuinit calibrate_delay(void) +void calibrate_delay(void) { const int *val; struct device_node *cpu = NULL; diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index f65fa480c905f..4e6a60470bce8 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c @@ -150,7 +150,7 @@ static void convert_to_wide(unsigned long *addr) } #ifdef CONFIG_64BIT -void __cpuinit set_firmware_width_unlocked(void) +void set_firmware_width_unlocked(void) { int ret; @@ -167,7 +167,7 @@ void __cpuinit set_firmware_width_unlocked(void) * This function must be called before any pdc_* function that uses the * convert_to_wide function. */ -void __cpuinit set_firmware_width(void) +void set_firmware_width(void) { unsigned long flags; spin_lock_irqsave(&pdc_lock, flags); @@ -175,11 +175,11 @@ void __cpuinit set_firmware_width(void) spin_unlock_irqrestore(&pdc_lock, flags); } #else -void __cpuinit set_firmware_width_unlocked(void) { +void set_firmware_width_unlocked(void) { return; } -void __cpuinit set_firmware_width(void) { +void set_firmware_width(void) { return; } #endif /*CONFIG_64BIT*/ @@ -301,7 +301,7 @@ int pdc_chassis_warn(unsigned long *warn) return retval; } -int __cpuinit pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info) +int pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info) { int ret; @@ -322,7 +322,7 @@ int __cpuinit pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info) * This PDC call returns the presence and status of all the coprocessors * attached to the processor. */ -int __cpuinit pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info) +int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info) { int ret; unsigned long flags; diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c index c22c3d84e28b5..5b2c5f3940358 100644 --- a/arch/parisc/kernel/hardware.c +++ b/arch/parisc/kernel/hardware.c @@ -1368,7 +1368,7 @@ const char *parisc_hardware_description(struct parisc_device_id *id) /* Interpret hversion (ret[0]) from PDC_MODEL(4)/PDC_MODEL_INFO(0) */ -enum cpu_type __cpuinit +enum cpu_type parisc_get_cpu_type(unsigned long hversion) { struct hp_cpu_type_mask *ptr; diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index c8fb61ed32f4e..a128a94204e68 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -73,7 +73,7 @@ extern int update_cr16_clocksource(void); /* from time.c */ * * FIXME: doesn't do much yet... */ -static void __cpuinit +static void init_percpu_prof(unsigned long cpunum) { struct cpuinfo_parisc *p; @@ -92,7 +92,7 @@ init_percpu_prof(unsigned long cpunum) * (return 1). If so, initialize the chip and tell other partners in crime * they have work to do. */ -static int __cpuinit processor_probe(struct parisc_device *dev) +static int processor_probe(struct parisc_device *dev) { unsigned long txn_addr; unsigned long cpuid; @@ -299,7 +299,7 @@ void __init collect_boot_cpu_data(void) * * o Enable CPU profiling hooks. */ -int __cpuinit init_per_cpu(int cpunum) +int init_per_cpu(int cpunum) { int ret; struct pdc_coproc_cfg coproc_cfg; diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index e3614fb343e5e..71cb54ab9eaa5 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -64,7 +64,7 @@ volatile struct task_struct *smp_init_current_idle_task; /* track which CPU is booting */ static volatile int cpu_now_booting __cpuinitdata; -static int parisc_max_cpus __cpuinitdata = 1; +static int parisc_max_cpus = 1; static DEFINE_PER_CPU(spinlock_t, ipi_lock); @@ -328,7 +328,7 @@ void __init smp_callin(void) /* * Bring one cpu online. */ -int __cpuinit smp_boot_one_cpu(int cpuid, struct task_struct *idle) +int smp_boot_one_cpu(int cpuid, struct task_struct *idle) { const struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpuid); long timeout; @@ -424,7 +424,7 @@ void smp_cpus_done(unsigned int cpu_max) } -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { if (cpu != 0 && cpu < parisc_max_cpus) smp_boot_one_cpu(cpu, tidle); diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index 34fd70488d83f..c7a8bfc9f6f5e 100644 --- a/arch/powerpc/include/asm/rtas.h +++ b/arch/powerpc/include/asm/rtas.h @@ -350,8 +350,8 @@ static inline u32 rtas_config_addr(int busno, int devfn, int reg) (devfn << 8) | (reg & 0xff); } -extern void __cpuinit rtas_give_timebase(void); -extern void __cpuinit rtas_take_timebase(void); +extern void rtas_give_timebase(void); +extern void rtas_take_timebase(void); #ifdef CONFIG_PPC_RTAS static inline int page_is_rtas_user_buf(unsigned long pfn) diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h index 50f261bc3e959..0d9cecddf8a4f 100644 --- a/arch/powerpc/include/asm/vdso.h +++ b/arch/powerpc/include/asm/vdso.h @@ -22,7 +22,7 @@ extern unsigned long vdso64_rt_sigtramp; extern unsigned long vdso32_sigtramp; extern unsigned long vdso32_rt_sigtramp; -int __cpuinit vdso_getcpu_init(void); +int vdso_getcpu_init(void); #else /* __ASSEMBLY__ */ diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index b4437e8a7a8f6..03553af1334b1 100644 --- a/arch/powerpc/kernel/cacheinfo.c +++ b/arch/powerpc/kernel/cacheinfo.c @@ -131,7 +131,7 @@ static const char *cache_type_string(const struct cache *cache) return cache_type_info[cache->type].name; } -static void __cpuinit cache_init(struct cache *cache, int type, int level, struct device_node *ofnode) +static void cache_init(struct cache *cache, int type, int level, struct device_node *ofnode) { cache->type = type; cache->level = level; @@ -140,7 +140,7 @@ static void __cpuinit cache_init(struct cache *cache, int type, int level, struc list_add(&cache->list, &cache_list); } -static struct cache *__cpuinit new_cache(int type, int level, struct device_node *ofnode) +static struct cache *new_cache(int type, int level, struct device_node *ofnode) { struct cache *cache; @@ -324,7 +324,7 @@ static bool cache_node_is_unified(const struct device_node *np) return of_get_property(np, "cache-unified", NULL); } -static struct cache *__cpuinit cache_do_one_devnode_unified(struct device_node *node, int level) +static struct cache *cache_do_one_devnode_unified(struct device_node *node, int level) { struct cache *cache; @@ -335,7 +335,7 @@ static struct cache *__cpuinit cache_do_one_devnode_unified(struct device_node * return cache; } -static struct cache *__cpuinit cache_do_one_devnode_split(struct device_node *node, int level) +static struct cache *cache_do_one_devnode_split(struct device_node *node, int level) { struct cache *dcache, *icache; @@ -357,7 +357,7 @@ static struct cache *__cpuinit cache_do_one_devnode_split(struct device_node *no return NULL; } -static struct cache *__cpuinit cache_do_one_devnode(struct device_node *node, int level) +static struct cache *cache_do_one_devnode(struct device_node *node, int level) { struct cache *cache; @@ -369,7 +369,7 @@ static struct cache *__cpuinit cache_do_one_devnode(struct device_node *node, in return cache; } -static struct cache *__cpuinit cache_lookup_or_instantiate(struct device_node *node, int level) +static struct cache *cache_lookup_or_instantiate(struct device_node *node, int level) { struct cache *cache; @@ -385,7 +385,7 @@ static struct cache *__cpuinit cache_lookup_or_instantiate(struct device_node *n return cache; } -static void __cpuinit link_cache_lists(struct cache *smaller, struct cache *bigger) +static void link_cache_lists(struct cache *smaller, struct cache *bigger) { while (smaller->next_local) { if (smaller->next_local == bigger) @@ -396,13 +396,13 @@ static void __cpuinit link_cache_lists(struct cache *smaller, struct cache *bigg smaller->next_local = bigger; } -static void __cpuinit do_subsidiary_caches_debugcheck(struct cache *cache) +static void do_subsidiary_caches_debugcheck(struct cache *cache) { WARN_ON_ONCE(cache->level != 1); WARN_ON_ONCE(strcmp(cache->ofnode->type, "cpu")); } -static void __cpuinit do_subsidiary_caches(struct cache *cache) +static void do_subsidiary_caches(struct cache *cache) { struct device_node *subcache_node; int level = cache->level; @@ -423,7 +423,7 @@ static void __cpuinit do_subsidiary_caches(struct cache *cache) } } -static struct cache *__cpuinit cache_chain_instantiate(unsigned int cpu_id) +static struct cache *cache_chain_instantiate(unsigned int cpu_id) { struct device_node *cpu_node; struct cache *cpu_cache = NULL; @@ -448,7 +448,7 @@ static struct cache *__cpuinit cache_chain_instantiate(unsigned int cpu_id) return cpu_cache; } -static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id) +static struct cache_dir *cacheinfo_create_cache_dir(unsigned int cpu_id) { struct cache_dir *cache_dir; struct device *dev; @@ -653,7 +653,7 @@ static struct kobj_type cache_index_type = { .default_attrs = cache_index_default_attrs, }; -static void __cpuinit cacheinfo_create_index_opt_attrs(struct cache_index_dir *dir) +static void cacheinfo_create_index_opt_attrs(struct cache_index_dir *dir) { const char *cache_name; const char *cache_type; @@ -696,7 +696,7 @@ static void __cpuinit cacheinfo_create_index_opt_attrs(struct cache_index_dir *d kfree(buf); } -static void __cpuinit cacheinfo_create_index_dir(struct cache *cache, int index, struct cache_dir *cache_dir) +static void cacheinfo_create_index_dir(struct cache *cache, int index, struct cache_dir *cache_dir) { struct cache_index_dir *index_dir; int rc; @@ -722,7 +722,7 @@ static void __cpuinit cacheinfo_create_index_dir(struct cache *cache, int index, kfree(index_dir); } -static void __cpuinit cacheinfo_sysfs_populate(unsigned int cpu_id, struct cache *cache_list) +static void cacheinfo_sysfs_populate(unsigned int cpu_id, struct cache *cache_list) { struct cache_dir *cache_dir; struct cache *cache; @@ -740,7 +740,7 @@ static void __cpuinit cacheinfo_sysfs_populate(unsigned int cpu_id, struct cache } } -void __cpuinit cacheinfo_cpu_online(unsigned int cpu_id) +void cacheinfo_cpu_online(unsigned int cpu_id) { struct cache *cache; diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 2d6f5a8e19e25..3e1b24a1f98c1 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@ -1172,7 +1172,7 @@ int __init early_init_dt_scan_rtas(unsigned long node, static arch_spinlock_t timebase_lock; static u64 timebase = 0; -void __cpuinit rtas_give_timebase(void) +void rtas_give_timebase(void) { unsigned long flags; @@ -1189,7 +1189,7 @@ void __cpuinit rtas_give_timebase(void) local_irq_restore(flags); } -void __cpuinit rtas_take_timebase(void) +void rtas_take_timebase(void) { while (!timebase) barrier(); diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index c5c6407795491..6465fd9b6ce93 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -480,7 +480,7 @@ static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle) secondary_ti = current_set[cpu] = ti; } -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { int rc, c; @@ -610,7 +610,7 @@ static struct device_node *cpu_to_l2cache(int cpu) } /* Activate a secondary processor. */ -__cpuinit void start_secondary(void *unused) +void start_secondary(void *unused) { unsigned int cpu = smp_processor_id(); struct device_node *l2_cache; diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index a15fd1a0690c7..b4e667663d9bf 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c @@ -352,7 +352,7 @@ static struct device_attribute pa6t_attrs[] = { #endif /* HAS_PPC_PMC_PA6T */ #endif /* HAS_PPC_PMC_CLASSIC */ -static void __cpuinit register_cpu_online(unsigned int cpu) +static void register_cpu_online(unsigned int cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); struct device *s = &c->dev; @@ -516,7 +516,7 @@ ssize_t arch_cpu_release(const char *buf, size_t count) #endif /* CONFIG_HOTPLUG_CPU */ -static int __cpuinit sysfs_cpu_notify(struct notifier_block *self, +static int sysfs_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned int)(long)hcpu; @@ -536,7 +536,7 @@ static int __cpuinit sysfs_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata sysfs_cpu_nb = { +static struct notifier_block sysfs_cpu_nb = { .notifier_call = sysfs_cpu_notify, }; diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 57fd5c1e8e897..116b384aa7aa3 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -631,7 +631,7 @@ static int __init get_freq(char *name, int cells, unsigned long *val) return found; } -/* should become __cpuinit when secondary_cpu_time_init also is */ +/* should become when secondary_cpu_time_init also is */ void start_cpu_decrementer(void) { #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index d4f463ac65b1e..1d9c92621b36f 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c @@ -711,7 +711,7 @@ static void __init vdso_setup_syscall_map(void) } #ifdef CONFIG_PPC64 -int __cpuinit vdso_getcpu_init(void) +int vdso_getcpu_init(void) { unsigned long cpu, node, val; diff --git a/arch/powerpc/mm/44x_mmu.c b/arch/powerpc/mm/44x_mmu.c index 2c9441ee6bb85..82b1ff759e26d 100644 --- a/arch/powerpc/mm/44x_mmu.c +++ b/arch/powerpc/mm/44x_mmu.c @@ -41,7 +41,7 @@ int icache_44x_need_flush; unsigned long tlb_47x_boltmap[1024/8]; -static void __cpuinit ppc44x_update_tlb_hwater(void) +static void ppc44x_update_tlb_hwater(void) { extern unsigned int tlb_44x_patch_hwater_D[]; extern unsigned int tlb_44x_patch_hwater_I[]; @@ -134,7 +134,7 @@ static void __init ppc47x_update_boltmap(void) /* * "Pins" a 256MB TLB entry in AS0 for kernel lowmem for 47x type MMU */ -static void __cpuinit ppc47x_pin_tlb(unsigned int virt, unsigned int phys) +static void ppc47x_pin_tlb(unsigned int virt, unsigned int phys) { unsigned int rA; int bolted; @@ -229,7 +229,7 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base, } #ifdef CONFIG_SMP -void __cpuinit mmu_init_secondary(int cpu) +void mmu_init_secondary(int cpu) { unsigned long addr; unsigned long memstart = memstart_addr & ~(PPC_PIN_SIZE - 1); diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index e303a6d74e3a7..4481172664dab 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c @@ -807,7 +807,7 @@ void __init early_init_mmu(void) } #ifdef CONFIG_SMP -void __cpuinit early_init_mmu_secondary(void) +void early_init_mmu_secondary(void) { /* Initialize hash table for that CPU */ if (!firmware_has_feature(FW_FEATURE_LPAR)) diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c index e779642c25e5e..6a7238d68b2f6 100644 --- a/arch/powerpc/mm/mmu_context_nohash.c +++ b/arch/powerpc/mm/mmu_context_nohash.c @@ -329,7 +329,7 @@ void destroy_context(struct mm_struct *mm) #ifdef CONFIG_SMP -static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self, +static int mmu_context_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned int)(long)hcpu; @@ -363,7 +363,7 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata mmu_context_cpu_nb = { +static struct notifier_block mmu_context_cpu_nb = { .notifier_call = mmu_context_cpu_notify, }; diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 08c6f3185d45b..9ddf2e065ab0e 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -532,7 +532,7 @@ static int of_drconf_to_nid_single(struct of_drconf_cell *drmem, * Figure out to which domain a cpu belongs and stick it there. * Return the id of the domain used. */ -static int __cpuinit numa_setup_cpu(unsigned long lcpu) +static int numa_setup_cpu(unsigned long lcpu) { int nid; struct device_node *cpu; @@ -567,7 +567,7 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu) return nid; } -static int __cpuinit cpu_numa_callback(struct notifier_block *nfb, +static int cpu_numa_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { @@ -948,7 +948,7 @@ static void __init *careful_zallocation(int nid, unsigned long size, return ret; } -static struct notifier_block __cpuinitdata ppc64_numa_nb = { +static struct notifier_block ppc64_numa_nb = { .notifier_call = cpu_numa_callback, .priority = 1 /* Must run before sched domains notifier. */ }; diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c index 6888cad5103de..41cd68dee6816 100644 --- a/arch/powerpc/mm/tlb_nohash.c +++ b/arch/powerpc/mm/tlb_nohash.c @@ -648,7 +648,7 @@ void __init early_init_mmu(void) __early_init_mmu(1); } -void __cpuinit early_init_mmu_secondary(void) +void early_init_mmu_secondary(void) { __early_init_mmu(0); } diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index b63dc809596d5..e4a99f12e9937 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c @@ -1825,7 +1825,7 @@ static void power_pmu_setup(int cpu) cpuhw->mmcr[0] = MMCR0_FC; } -static int __cpuinit +static int power_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (long)hcpu; @@ -1842,7 +1842,7 @@ power_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu return NOTIFY_OK; } -int __cpuinit register_power_pmu(struct power_pmu *pmu) +int register_power_pmu(struct power_pmu *pmu) { if (ppmu) return -EBUSY; /* something's already registered */ diff --git a/arch/powerpc/platforms/44x/currituck.c b/arch/powerpc/platforms/44x/currituck.c index ecd3890c40d72..9cef9d381b05c 100644 --- a/arch/powerpc/platforms/44x/currituck.c +++ b/arch/powerpc/platforms/44x/currituck.c @@ -91,12 +91,12 @@ static void __init ppc47x_init_irq(void) } #ifdef CONFIG_SMP -static void __cpuinit smp_ppc47x_setup_cpu(int cpu) +static void smp_ppc47x_setup_cpu(int cpu) { mpic_setup_this_cpu(); } -static int __cpuinit smp_ppc47x_kick_cpu(int cpu) +static int smp_ppc47x_kick_cpu(int cpu) { struct device_node *cpunode = of_get_cpu_node(cpu, NULL); const u64 *spin_table_addr_prop; diff --git a/arch/powerpc/platforms/44x/iss4xx.c b/arch/powerpc/platforms/44x/iss4xx.c index a28a8629727ee..4241bc825800d 100644 --- a/arch/powerpc/platforms/44x/iss4xx.c +++ b/arch/powerpc/platforms/44x/iss4xx.c @@ -81,12 +81,12 @@ static void __init iss4xx_init_irq(void) } #ifdef CONFIG_SMP -static void __cpuinit smp_iss4xx_setup_cpu(int cpu) +static void smp_iss4xx_setup_cpu(int cpu) { mpic_setup_this_cpu(); } -static int __cpuinit smp_iss4xx_kick_cpu(int cpu) +static int smp_iss4xx_kick_cpu(int cpu) { struct device_node *cpunode = of_get_cpu_node(cpu, NULL); const u64 *spin_table_addr_prop; diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 6a1759939c6ba..5ced4f5bb2b2e 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c @@ -99,7 +99,7 @@ static void mpc85xx_take_timebase(void) } #ifdef CONFIG_HOTPLUG_CPU -static void __cpuinit smp_85xx_mach_cpu_die(void) +static void smp_85xx_mach_cpu_die(void) { unsigned int cpu = smp_processor_id(); u32 tmp; @@ -141,7 +141,7 @@ static inline u32 read_spin_table_addr_l(void *spin_table) return in_be32(&((struct epapr_spin_table *)spin_table)->addr_l); } -static int __cpuinit smp_85xx_kick_cpu(int nr) +static int smp_85xx_kick_cpu(int nr) { unsigned long flags; const u64 *cpu_rel_addr; @@ -362,7 +362,7 @@ static void mpc85xx_smp_machine_kexec(struct kimage *image) } #endif /* CONFIG_KEXEC */ -static void __cpuinit smp_85xx_setup_cpu(int cpu_nr) +static void smp_85xx_setup_cpu(int cpu_nr) { if (smp_85xx_ops.probe == smp_mpic_probe) mpic_setup_this_cpu(); diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index bdb738a69e418..49c9f9501c213 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c @@ -885,7 +885,7 @@ static int smp_core99_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata smp_core99_cpu_nb = { +static struct notifier_block smp_core99_cpu_nb = { .notifier_call = smp_core99_cpu_notify, }; #endif /* CONFIG_HOTPLUG_CPU */ diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c index 88c9459c3e071..c22b2b3d9d84f 100644 --- a/arch/powerpc/platforms/powernv/smp.c +++ b/arch/powerpc/platforms/powernv/smp.c @@ -40,7 +40,7 @@ #define DBG(fmt...) #endif -static void __cpuinit pnv_smp_setup_cpu(int cpu) +static void pnv_smp_setup_cpu(int cpu) { if (cpu != boot_cpuid) xics_setup_cpu(); diff --git a/arch/s390/kernel/cache.c b/arch/s390/kernel/cache.c index 64b24650e4f8c..ae32bfca2f3d1 100644 --- a/arch/s390/kernel/cache.c +++ b/arch/s390/kernel/cache.c @@ -173,7 +173,7 @@ static void __init cache_build_info(void) } } -static struct cache_dir *__cpuinit cache_create_cache_dir(int cpu) +static struct cache_dir *cache_create_cache_dir(int cpu) { struct cache_dir *cache_dir; struct kobject *kobj = NULL; @@ -289,7 +289,7 @@ static struct kobj_type cache_index_type = { .default_attrs = cache_index_default_attrs, }; -static int __cpuinit cache_create_index_dir(struct cache_dir *cache_dir, +static int cache_create_index_dir(struct cache_dir *cache_dir, struct cache *cache, int index, int cpu) { @@ -313,7 +313,7 @@ static int __cpuinit cache_create_index_dir(struct cache_dir *cache_dir, return rc; } -static int __cpuinit cache_add_cpu(int cpu) +static int cache_add_cpu(int cpu) { struct cache_dir *cache_dir; struct cache *cache; @@ -335,7 +335,7 @@ static int __cpuinit cache_add_cpu(int cpu) return 0; } -static void __cpuinit cache_remove_cpu(int cpu) +static void cache_remove_cpu(int cpu) { struct cache_index_dir *index, *next; struct cache_dir *cache_dir; @@ -354,7 +354,7 @@ static void __cpuinit cache_remove_cpu(int cpu) cache_dir_cpu[cpu] = NULL; } -static int __cpuinit cache_hotplug(struct notifier_block *nfb, +static int cache_hotplug(struct notifier_block *nfb, unsigned long action, void *hcpu) { int cpu = (long)hcpu; diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 390d9ae57bb2d..e7518bb6c3130 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -639,7 +639,7 @@ static struct pmu cpumf_pmu = { .cancel_txn = cpumf_pmu_cancel_txn, }; -static int __cpuinit cpumf_pmu_notifier(struct notifier_block *self, +static int cpumf_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (long) hcpu; diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 753c41d0ffd3a..24612029f4502 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c @@ -21,7 +21,7 @@ static DEFINE_PER_CPU(struct cpuid, cpu_id); /* * cpu_init - initializes state that is per-CPU. */ -void __cpuinit cpu_init(void) +void cpu_init(void) { struct s390_idle_data *idle = &__get_cpu_var(s390_idle); struct cpuid *id = &__get_cpu_var(cpu_id); diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 14647fe09d0cd..4266590ff7012 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -166,7 +166,7 @@ static void pcpu_ec_call(struct pcpu *pcpu, int ec_bit) pcpu_sigp_retry(pcpu, order, 0); } -static int __cpuinit pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu) +static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu) { struct _lowcore *lc; @@ -619,9 +619,9 @@ static struct sclp_cpu_info *smp_get_cpu_info(void) return info; } -static int __cpuinit smp_add_present_cpu(int cpu); +static int smp_add_present_cpu(int cpu); -static int __cpuinit __smp_rescan_cpus(struct sclp_cpu_info *info, +static int __smp_rescan_cpus(struct sclp_cpu_info *info, int sysfs_add) { struct pcpu *pcpu; @@ -688,7 +688,7 @@ static void __init smp_detect_cpus(void) /* * Activate a secondary processor. */ -static void __cpuinit smp_start_secondary(void *cpuvoid) +static void smp_start_secondary(void *cpuvoid) { S390_lowcore.last_update_clock = get_tod_clock(); S390_lowcore.restart_stack = (unsigned long) restart_stack; @@ -711,7 +711,7 @@ static void __cpuinit smp_start_secondary(void *cpuvoid) } /* Upping and downing of CPUs */ -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { struct pcpu *pcpu; int rc; @@ -967,7 +967,7 @@ static struct attribute_group cpu_online_attr_group = { .attrs = cpu_online_attrs, }; -static int __cpuinit smp_cpu_notify(struct notifier_block *self, +static int smp_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned int)(long)hcpu; @@ -986,7 +986,7 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self, return notifier_from_errno(err); } -static int __cpuinit smp_add_present_cpu(int cpu) +static int smp_add_present_cpu(int cpu) { struct cpu *c = &pcpu_devices[cpu].cpu; struct device *s = &c->dev; diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c index 62f89d98e8807..811f542b8ed4a 100644 --- a/arch/s390/kernel/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c @@ -418,7 +418,7 @@ void s390_adjust_jiffies(void) /* * calibrate the delay loop */ -void __cpuinit calibrate_delay(void) +void calibrate_delay(void) { s390_adjust_jiffies(); /* Print the good old Bogomips line .. */ diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 737d50caa4fea..a37d56a338395 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -371,13 +371,13 @@ EXPORT_SYMBOL(del_virt_timer); /* * Start the virtual CPU timer on the current CPU. */ -void __cpuinit init_cpu_vtimer(void) +void init_cpu_vtimer(void) { /* set initial cpu timer */ set_vtimer(VTIMER_MAX_SLICE); } -static int __cpuinit s390_nohz_notify(struct notifier_block *self, +static int s390_nohz_notify(struct notifier_block *self, unsigned long action, void *hcpu) { struct s390_idle_data *idle; diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index d214321db727f..245cfa9b3a670 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -647,7 +647,7 @@ static void pfault_interrupt(struct ext_code ext_code, put_task_struct(tsk); } -static int __cpuinit pfault_cpu_notify(struct notifier_block *self, +static int pfault_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { struct thread_struct *thread, *next; diff --git a/arch/score/mm/tlb-score.c b/arch/score/mm/tlb-score.c index 6fdb100244c81..004073717de03 100644 --- a/arch/score/mm/tlb-score.c +++ b/arch/score/mm/tlb-score.c @@ -240,7 +240,7 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte) local_irq_restore(flags); } -void __cpuinit tlb_init(void) +void tlb_init(void) { tlblock_set(0); local_flush_tlb_all(); diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index 61a07dafcd46c..0a2ef460e19d7 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c @@ -43,9 +43,9 @@ * peripherals (nofpu, nodsp, and so forth). */ #define onchip_setup(x) \ -static int x##_disabled __cpuinitdata = !cpu_has_##x; \ +static int x##_disabled = !cpu_has_##x; \ \ -static int __cpuinit x##_setup(char *opts) \ +static int x##_setup(char *opts) \ { \ x##_disabled = 1; \ return 1; \ @@ -59,7 +59,7 @@ onchip_setup(dsp); #define CPUOPM 0xff2f0000 #define CPUOPM_RABD (1 << 5) -static void __cpuinit speculative_execution_init(void) +static void speculative_execution_init(void) { /* Clear RABD */ __raw_writel(__raw_readl(CPUOPM) & ~CPUOPM_RABD, CPUOPM); @@ -78,7 +78,7 @@ static void __cpuinit speculative_execution_init(void) #define EXPMASK_BRDSSLP (1 << 1) #define EXPMASK_MMCAW (1 << 4) -static void __cpuinit expmask_init(void) +static void expmask_init(void) { unsigned long expmask = __raw_readl(EXPMASK); @@ -217,7 +217,7 @@ static void detect_cache_shape(void) l2_cache_shape = -1; /* No S-cache */ } -static void __cpuinit fpu_init(void) +static void fpu_init(void) { /* Disable the FPU */ if (fpu_disabled && (current_cpu_data.flags & CPU_HAS_FPU)) { @@ -230,7 +230,7 @@ static void __cpuinit fpu_init(void) } #ifdef CONFIG_SH_DSP -static void __cpuinit release_dsp(void) +static void release_dsp(void) { unsigned long sr; @@ -244,7 +244,7 @@ static void __cpuinit release_dsp(void) ); } -static void __cpuinit dsp_init(void) +static void dsp_init(void) { unsigned long sr; @@ -276,7 +276,7 @@ static void __cpuinit dsp_init(void) release_dsp(); } #else -static inline void __cpuinit dsp_init(void) { } +static inline void dsp_init(void) { } #endif /* CONFIG_SH_DSP */ /** @@ -295,7 +295,7 @@ static inline void __cpuinit dsp_init(void) { } * Each processor family is still responsible for doing its own probing * and cache configuration in cpu_probe(). */ -asmlinkage void __cpuinit cpu_init(void) +asmlinkage void cpu_init(void) { current_thread_info()->cpu = hard_smp_processor_id(); diff --git a/arch/sh/kernel/cpu/sh2/probe.c b/arch/sh/kernel/cpu/sh2/probe.c index bab8e75958aee..6c687ae812ef6 100644 --- a/arch/sh/kernel/cpu/sh2/probe.c +++ b/arch/sh/kernel/cpu/sh2/probe.c @@ -13,7 +13,7 @@ #include #include -void __cpuinit cpu_probe(void) +void cpu_probe(void) { #if defined(CONFIG_CPU_SUBTYPE_SH7619) boot_cpu_data.type = CPU_SH7619; diff --git a/arch/sh/kernel/cpu/sh2a/probe.c b/arch/sh/kernel/cpu/sh2a/probe.c index 5170b6aa4129e..3f87971082f11 100644 --- a/arch/sh/kernel/cpu/sh2a/probe.c +++ b/arch/sh/kernel/cpu/sh2a/probe.c @@ -13,7 +13,7 @@ #include #include -void __cpuinit cpu_probe(void) +void cpu_probe(void) { boot_cpu_data.family = CPU_FAMILY_SH2A; diff --git a/arch/sh/kernel/cpu/sh3/probe.c b/arch/sh/kernel/cpu/sh3/probe.c index bf23c322e164b..426e1e1dcedc7 100644 --- a/arch/sh/kernel/cpu/sh3/probe.c +++ b/arch/sh/kernel/cpu/sh3/probe.c @@ -16,7 +16,7 @@ #include #include -void __cpuinit cpu_probe(void) +void cpu_probe(void) { unsigned long addr0, addr1, data0, data1, data2, data3; diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c index 0fbbd50bc8ad3..a521bcf506956 100644 --- a/arch/sh/kernel/cpu/sh4/probe.c +++ b/arch/sh/kernel/cpu/sh4/probe.c @@ -15,7 +15,7 @@ #include #include -void __cpuinit cpu_probe(void) +void cpu_probe(void) { unsigned long pvr, prr, cvr; unsigned long size; diff --git a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c index 03f2b55757cfc..4a298808789c4 100644 --- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c @@ -124,7 +124,7 @@ static void shx3_update_boot_vector(unsigned int cpu) __raw_writel(STBCR_RESET, STBCR_REG(cpu)); } -static int __cpuinit +static int shx3_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned int)hcpu; @@ -143,11 +143,11 @@ shx3_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) return NOTIFY_OK; } -static struct notifier_block __cpuinitdata shx3_cpu_notifier = { +static struct notifier_block shx3_cpu_notifier = { .notifier_call = shx3_cpu_callback, }; -static int __cpuinit register_shx3_cpu_notifier(void) +static int register_shx3_cpu_notifier(void) { register_hotcpu_notifier(&shx3_cpu_notifier); return 0; diff --git a/arch/sh/kernel/cpu/sh5/probe.c b/arch/sh/kernel/cpu/sh5/probe.c index 9e882409e4e98..eca427c2f2f3d 100644 --- a/arch/sh/kernel/cpu/sh5/probe.c +++ b/arch/sh/kernel/cpu/sh5/probe.c @@ -17,7 +17,7 @@ #include #include -void __cpuinit cpu_probe(void) +void cpu_probe(void) { unsigned long long cir; diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 068b8a2759b52..b9cefebda55c0 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c @@ -367,7 +367,7 @@ static void sh_pmu_setup(int cpu) memset(cpuhw, 0, sizeof(struct cpu_hw_events)); } -static int __cpuinit +static int sh_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (long)hcpu; @@ -384,7 +384,7 @@ sh_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) return NOTIFY_OK; } -int __cpuinit register_sh_pmu(struct sh_pmu *_pmu) +int register_sh_pmu(struct sh_pmu *_pmu) { if (sh_pmu) return -EBUSY; diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 055d91b70305f..53bc6c4c84ecd 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@ -65,7 +65,7 @@ void arch_task_cache_init(void) # define HAVE_SOFTFP 0 #endif -void __cpuinit init_thread_xstate(void) +void init_thread_xstate(void) { if (boot_cpu_data.flags & CPU_HAS_FPU) xstate_size = sizeof(struct sh_fpu_hard_struct); diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index ebe7a7d97215e..1cf90e947dbf1 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -172,7 +172,7 @@ void __init check_for_initrd(void) #endif } -void __cpuinit calibrate_delay(void) +void calibrate_delay(void) { struct clk *clk = clk_get(NULL, "cpu_clk"); diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index 45696451f0ea3..86a7936a980b6 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c @@ -37,7 +37,7 @@ struct plat_smp_ops *mp_ops = NULL; /* State of each CPU */ DEFINE_PER_CPU(int, cpu_state) = { 0 }; -void __cpuinit register_smp_ops(struct plat_smp_ops *ops) +void register_smp_ops(struct plat_smp_ops *ops) { if (mp_ops) printk(KERN_WARNING "Overriding previously set SMP ops\n"); @@ -45,7 +45,7 @@ void __cpuinit register_smp_ops(struct plat_smp_ops *ops) mp_ops = ops; } -static inline void __cpuinit smp_store_cpu_info(unsigned int cpu) +static inline void smp_store_cpu_info(unsigned int cpu) { struct sh_cpuinfo *c = cpu_data + cpu; @@ -174,7 +174,7 @@ void native_play_dead(void) } #endif -asmlinkage void __cpuinit start_secondary(void) +asmlinkage void start_secondary(void) { unsigned int cpu = smp_processor_id(); struct mm_struct *mm = &init_mm; @@ -215,7 +215,7 @@ extern struct { void *thread_info; } stack_start; -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tsk) +int __cpu_up(unsigned int cpu, struct task_struct *tsk) { unsigned long timeout; diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index 5f513a64dedfc..68e99f09171dd 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c @@ -741,7 +741,7 @@ asmlinkage void do_exception_error(unsigned long r4, unsigned long r5, die_if_kernel("exception", regs, ex); } -void __cpuinit per_cpu_trap_init(void) +void per_cpu_trap_init(void) { extern void *vbr_base; diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c index f87d20da17916..112ea11c030d6 100644 --- a/arch/sh/kernel/traps_64.c +++ b/arch/sh/kernel/traps_64.c @@ -810,7 +810,7 @@ asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs) poke_real_address_q(DM_EXP_CAUSE_PHY, 0x0); } -void __cpuinit per_cpu_trap_init(void) +void per_cpu_trap_init(void) { /* Nothing to do for now, VBR initialization later. */ } diff --git a/arch/sh/mm/tlb-sh5.c b/arch/sh/mm/tlb-sh5.c index ff1c40a31cbc0..e4bb2a8e0a69d 100644 --- a/arch/sh/mm/tlb-sh5.c +++ b/arch/sh/mm/tlb-sh5.c @@ -17,7 +17,7 @@ /** * sh64_tlb_init - Perform initial setup for the DTLB and ITLB. */ -int __cpuinit sh64_tlb_init(void) +int sh64_tlb_init(void) { /* Assign some sane DTLB defaults */ cpu_data->dtlb.entries = 64; diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 252f8768aac69..3f7d4b372f3a6 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -528,7 +528,7 @@ static void dr_cpu_mark(struct ds_data *resp, int cpu, int ncpus, } } -static int __cpuinit dr_cpu_configure(struct ds_info *dp, +static int dr_cpu_configure(struct ds_info *dp, struct ds_cap_state *cp, u64 req_num, cpumask_t *mask) @@ -627,7 +627,7 @@ static int dr_cpu_unconfigure(struct ds_info *dp, return 0; } -static void __cpuinit dr_cpu_data(struct ds_info *dp, +static void dr_cpu_data(struct ds_info *dp, struct ds_cap_state *cp, void *buf, int len) { diff --git a/arch/sparc/kernel/entry.h b/arch/sparc/kernel/entry.h index cc3c5cb47cdaa..9c179fbfb219c 100644 --- a/arch/sparc/kernel/entry.h +++ b/arch/sparc/kernel/entry.h @@ -250,7 +250,7 @@ extern struct ino_bucket *ivector_table; extern unsigned long ivector_table_pa; extern void init_irqwork_curcpu(void); -extern void __cpuinit sun4v_register_mondo_queues(int this_cpu); +extern void sun4v_register_mondo_queues(int this_cpu); #endif /* CONFIG_SPARC32 */ #endif /* _ENTRY_H */ diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index 9bcbbe2c4e7e1..d16d16520678c 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c @@ -835,7 +835,7 @@ void notrace init_irqwork_curcpu(void) * Therefore you cannot make any OBP calls, not even prom_printf, * from these two routines. */ -static void __cpuinit notrace register_one_mondo(unsigned long paddr, unsigned long type, unsigned long qmask) +static void notrace register_one_mondo(unsigned long paddr, unsigned long type, unsigned long qmask) { unsigned long num_entries = (qmask + 1) / 64; unsigned long status; @@ -848,7 +848,7 @@ static void __cpuinit notrace register_one_mondo(unsigned long paddr, unsigned l } } -void __cpuinit notrace sun4v_register_mondo_queues(int this_cpu) +void notrace sun4v_register_mondo_queues(int this_cpu) { struct trap_per_cpu *tb = &trap_block[this_cpu]; diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index 6cfc1b09ec25a..b5945694bef63 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c @@ -54,7 +54,7 @@ extern ctxd_t *srmmu_ctx_table_phys; static int smp_processors_ready; extern volatile unsigned long cpu_callin_map[NR_CPUS]; extern cpumask_t smp_commenced_mask; -void __cpuinit leon_configure_cache_smp(void); +void leon_configure_cache_smp(void); static void leon_ipi_init(void); /* IRQ number of LEON IPIs */ @@ -69,12 +69,12 @@ static inline unsigned long do_swap(volatile unsigned long *ptr, return val; } -void __cpuinit leon_cpu_pre_starting(void *arg) +void leon_cpu_pre_starting(void *arg) { leon_configure_cache_smp(); } -void __cpuinit leon_cpu_pre_online(void *arg) +void leon_cpu_pre_online(void *arg) { int cpuid = hard_smp_processor_id(); @@ -106,7 +106,7 @@ void __cpuinit leon_cpu_pre_online(void *arg) extern struct linux_prom_registers smp_penguin_ctable; -void __cpuinit leon_configure_cache_smp(void) +void leon_configure_cache_smp(void) { unsigned long cfg = sparc_leon3_get_dcachecfg(); int me = smp_processor_id(); @@ -186,7 +186,7 @@ void __init leon_boot_cpus(void) } -int __cpuinit leon_boot_one_cpu(int i, struct task_struct *idle) +int leon_boot_one_cpu(int i, struct task_struct *idle) { int timeout; diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c index 831c001604e8e..3961054c595c4 100644 --- a/arch/sparc/kernel/mdesc.c +++ b/arch/sparc/kernel/mdesc.c @@ -571,7 +571,7 @@ static void __init report_platform_properties(void) mdesc_release(hp); } -static void __cpuinit fill_in_one_cache(cpuinfo_sparc *c, +static void fill_in_one_cache(cpuinfo_sparc *c, struct mdesc_handle *hp, u64 mp) { @@ -616,7 +616,7 @@ static void __cpuinit fill_in_one_cache(cpuinfo_sparc *c, } } -static void __cpuinit mark_core_ids(struct mdesc_handle *hp, u64 mp, int core_id) +static void mark_core_ids(struct mdesc_handle *hp, u64 mp, int core_id) { u64 a; @@ -649,7 +649,7 @@ static void __cpuinit mark_core_ids(struct mdesc_handle *hp, u64 mp, int core_id } } -static void __cpuinit set_core_ids(struct mdesc_handle *hp) +static void set_core_ids(struct mdesc_handle *hp) { int idx; u64 mp; @@ -674,7 +674,7 @@ static void __cpuinit set_core_ids(struct mdesc_handle *hp) } } -static void __cpuinit mark_proc_ids(struct mdesc_handle *hp, u64 mp, int proc_id) +static void mark_proc_ids(struct mdesc_handle *hp, u64 mp, int proc_id) { u64 a; @@ -693,7 +693,7 @@ static void __cpuinit mark_proc_ids(struct mdesc_handle *hp, u64 mp, int proc_id } } -static void __cpuinit __set_proc_ids(struct mdesc_handle *hp, const char *exec_unit_name) +static void __set_proc_ids(struct mdesc_handle *hp, const char *exec_unit_name) { int idx; u64 mp; @@ -714,13 +714,13 @@ static void __cpuinit __set_proc_ids(struct mdesc_handle *hp, const char *exec_u } } -static void __cpuinit set_proc_ids(struct mdesc_handle *hp) +static void set_proc_ids(struct mdesc_handle *hp) { __set_proc_ids(hp, "exec_unit"); __set_proc_ids(hp, "exec-unit"); } -static void __cpuinit get_one_mondo_bits(const u64 *p, unsigned int *mask, +static void get_one_mondo_bits(const u64 *p, unsigned int *mask, unsigned long def, unsigned long max) { u64 val; @@ -742,7 +742,7 @@ static void __cpuinit get_one_mondo_bits(const u64 *p, unsigned int *mask, *mask = ((1U << def) * 64U) - 1U; } -static void __cpuinit get_mondo_data(struct mdesc_handle *hp, u64 mp, +static void get_mondo_data(struct mdesc_handle *hp, u64 mp, struct trap_per_cpu *tb) { static int printed; @@ -769,7 +769,7 @@ static void __cpuinit get_mondo_data(struct mdesc_handle *hp, u64 mp, } } -static void * __cpuinit mdesc_iterate_over_cpus(void *(*func)(struct mdesc_handle *, u64, int, void *), void *arg, cpumask_t *mask) +static void * mdesc_iterate_over_cpus(void *(*func)(struct mdesc_handle *, u64, int, void *), void *arg, cpumask_t *mask) { struct mdesc_handle *hp = mdesc_grab(); void *ret = NULL; @@ -799,7 +799,7 @@ static void * __cpuinit mdesc_iterate_over_cpus(void *(*func)(struct mdesc_handl return ret; } -static void * __cpuinit record_one_cpu(struct mdesc_handle *hp, u64 mp, int cpuid, void *arg) +static void * record_one_cpu(struct mdesc_handle *hp, u64 mp, int cpuid, void *arg) { ncpus_probed++; #ifdef CONFIG_SMP @@ -808,7 +808,7 @@ static void * __cpuinit record_one_cpu(struct mdesc_handle *hp, u64 mp, int cpui return NULL; } -void __cpuinit mdesc_populate_present_mask(cpumask_t *mask) +void mdesc_populate_present_mask(cpumask_t *mask) { if (tlb_type != hypervisor) return; @@ -841,7 +841,7 @@ void __init mdesc_get_page_sizes(cpumask_t *mask, unsigned long *pgsz_mask) mdesc_iterate_over_cpus(check_one_pgsz, pgsz_mask, mask); } -static void * __cpuinit fill_in_one_cpu(struct mdesc_handle *hp, u64 mp, int cpuid, void *arg) +static void * fill_in_one_cpu(struct mdesc_handle *hp, u64 mp, int cpuid, void *arg) { const u64 *cfreq = mdesc_get_property(hp, mp, "clock-frequency", NULL); struct trap_per_cpu *tb; @@ -890,7 +890,7 @@ static void * __cpuinit fill_in_one_cpu(struct mdesc_handle *hp, u64 mp, int cpu return NULL; } -void __cpuinit mdesc_fill_in_cpu_data(cpumask_t *mask) +void mdesc_fill_in_cpu_data(cpumask_t *mask) { struct mdesc_handle *hp; diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c index e3f2b81c23f14..a102bfba6ea86 100644 --- a/arch/sparc/kernel/smp_32.c +++ b/arch/sparc/kernel/smp_32.c @@ -39,7 +39,7 @@ #include "kernel.h" #include "irq.h" -volatile unsigned long cpu_callin_map[NR_CPUS] __cpuinitdata = {0,}; +volatile unsigned long cpu_callin_map[NR_CPUS] = {0,}; cpumask_t smp_commenced_mask = CPU_MASK_NONE; @@ -53,7 +53,7 @@ const struct sparc32_ipi_ops *sparc32_ipi_ops; * instruction which is much better... */ -void __cpuinit smp_store_cpu_info(int id) +void smp_store_cpu_info(int id) { int cpu_node; int mid; @@ -120,7 +120,7 @@ void cpu_panic(void) panic("SMP bolixed\n"); } -struct linux_prom_registers smp_penguin_ctable __cpuinitdata = { 0 }; +struct linux_prom_registers smp_penguin_ctable = { 0 }; void smp_send_reschedule(int cpu) { @@ -259,10 +259,10 @@ void __init smp_prepare_boot_cpu(void) set_cpu_possible(cpuid, true); } -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { - extern int __cpuinit smp4m_boot_one_cpu(int, struct task_struct *); - extern int __cpuinit smp4d_boot_one_cpu(int, struct task_struct *); + extern int smp4m_boot_one_cpu(int, struct task_struct *); + extern int smp4d_boot_one_cpu(int, struct task_struct *); int ret=0; switch(sparc_cpu_model) { @@ -297,7 +297,7 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) return ret; } -void __cpuinit arch_cpu_pre_starting(void *arg) +void arch_cpu_pre_starting(void *arg) { local_ops->cache_all(); local_ops->tlb_all(); @@ -317,7 +317,7 @@ void __cpuinit arch_cpu_pre_starting(void *arg) } } -void __cpuinit arch_cpu_pre_online(void *arg) +void arch_cpu_pre_online(void *arg) { unsigned int cpuid = hard_smp_processor_id(); @@ -344,7 +344,7 @@ void __cpuinit arch_cpu_pre_online(void *arg) } } -void __cpuinit sparc_start_secondary(void *arg) +void sparc_start_secondary(void *arg) { unsigned int cpu; @@ -375,7 +375,7 @@ void __cpuinit sparc_start_secondary(void *arg) BUG(); } -void __cpuinit smp_callin(void) +void smp_callin(void) { sparc_start_secondary(NULL); } diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index 173964d5e948a..7c3d82107a61c 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -87,7 +87,7 @@ extern void setup_sparc64_timer(void); static volatile unsigned long callin_flag = 0; -void __cpuinit smp_callin(void) +void smp_callin(void) { int cpuid = hard_smp_processor_id(); @@ -281,7 +281,7 @@ static unsigned long kimage_addr_to_ra(void *p) return kern_base + (val - KERNBASE); } -static void __cpuinit ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg, void **descrp) +static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg, void **descrp) { extern unsigned long sparc64_ttable_tl0; extern unsigned long kern_locked_tte_data; @@ -342,7 +342,7 @@ extern unsigned long sparc64_cpu_startup; */ static struct thread_info *cpu_new_thread = NULL; -static int __cpuinit smp_boot_one_cpu(unsigned int cpu, struct task_struct *idle) +static int smp_boot_one_cpu(unsigned int cpu, struct task_struct *idle) { unsigned long entry = (unsigned long)(&sparc64_cpu_startup); @@ -1270,7 +1270,7 @@ void smp_fill_in_sib_core_maps(void) } } -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { int ret = smp_boot_one_cpu(cpu, tidle); diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index c9eb82f23d928..d5c319553fd08 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c @@ -50,7 +50,7 @@ static inline void show_leds(int cpuid) "i" (ASI_M_CTL)); } -void __cpuinit sun4d_cpu_pre_starting(void *arg) +void sun4d_cpu_pre_starting(void *arg) { int cpuid = hard_smp_processor_id(); @@ -62,7 +62,7 @@ void __cpuinit sun4d_cpu_pre_starting(void *arg) cc_set_imsk((cc_get_imsk() & ~0x8000) | 0x4000); } -void __cpuinit sun4d_cpu_pre_online(void *arg) +void sun4d_cpu_pre_online(void *arg) { unsigned long flags; int cpuid; @@ -118,7 +118,7 @@ void __init smp4d_boot_cpus(void) local_ops->cache_all(); } -int __cpuinit smp4d_boot_one_cpu(int i, struct task_struct *idle) +int smp4d_boot_one_cpu(int i, struct task_struct *idle) { unsigned long *entry = &sun4d_cpu_startup; int timeout; diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 8a65f158153dd..d3408e72d20c0 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c @@ -34,11 +34,11 @@ swap_ulong(volatile unsigned long *ptr, unsigned long val) return val; } -void __cpuinit sun4m_cpu_pre_starting(void *arg) +void sun4m_cpu_pre_starting(void *arg) { } -void __cpuinit sun4m_cpu_pre_online(void *arg) +void sun4m_cpu_pre_online(void *arg) { int cpuid = hard_smp_processor_id(); @@ -75,7 +75,7 @@ void __init smp4m_boot_cpus(void) local_ops->cache_all(); } -int __cpuinit smp4m_boot_one_cpu(int i, struct task_struct *idle) +int smp4m_boot_one_cpu(int i, struct task_struct *idle) { unsigned long *entry = &sun4m_cpu_startup; int timeout; diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c index 654e8aad3bbef..c21c673e5f7cd 100644 --- a/arch/sparc/kernel/sysfs.c +++ b/arch/sparc/kernel/sysfs.c @@ -246,7 +246,7 @@ static void unregister_cpu_online(unsigned int cpu) } #endif -static int __cpuinit sysfs_cpu_notify(struct notifier_block *self, +static int sysfs_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned int)(long)hcpu; @@ -266,7 +266,7 @@ static int __cpuinit sysfs_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata sysfs_cpu_nb = { +static struct notifier_block sysfs_cpu_nb = { .notifier_call = sysfs_cpu_notify, }; diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 272ebe7d380d4..04541b0cd9833 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -1698,7 +1698,7 @@ static void __init sun4v_ktsb_init(void) #endif } -void __cpuinit sun4v_ktsb_register(void) +void sun4v_ktsb_register(void) { unsigned long pa, ret; diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index f58cb540ff948..1e0e7d2837da1 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -860,7 +860,7 @@ static void __init map_kernel(void) } } -void (*poke_srmmu)(void) __cpuinitdata = NULL; +void (*poke_srmmu)(void) = NULL; extern unsigned long bootmem_init(unsigned long *pages_avail); @@ -1058,7 +1058,7 @@ static void __init init_vac_layout(void) (int)vac_cache_size, (int)vac_line_size); } -static void __cpuinit poke_hypersparc(void) +static void poke_hypersparc(void) { volatile unsigned long clear; unsigned long mreg = srmmu_get_mmureg(); @@ -1110,7 +1110,7 @@ static void __init init_hypersparc(void) hypersparc_setup_blockops(); } -static void __cpuinit poke_swift(void) +static void poke_swift(void) { unsigned long mreg; @@ -1290,7 +1290,7 @@ static void turbosparc_flush_tlb_page(struct vm_area_struct *vma, unsigned long } -static void __cpuinit poke_turbosparc(void) +static void poke_turbosparc(void) { unsigned long mreg = srmmu_get_mmureg(); unsigned long ccreg; @@ -1353,7 +1353,7 @@ static void __init init_turbosparc(void) poke_srmmu = poke_turbosparc; } -static void __cpuinit poke_tsunami(void) +static void poke_tsunami(void) { unsigned long mreg = srmmu_get_mmureg(); @@ -1394,7 +1394,7 @@ static void __init init_tsunami(void) tsunami_setup_blockops(); } -static void __cpuinit poke_viking(void) +static void poke_viking(void) { unsigned long mreg = srmmu_get_mmureg(); static int smp_catch; diff --git a/arch/tile/kernel/irq.c b/arch/tile/kernel/irq.c index 02e6280650125..3ccf2cd7182eb 100644 --- a/arch/tile/kernel/irq.c +++ b/arch/tile/kernel/irq.c @@ -220,7 +220,7 @@ void __init init_IRQ(void) ipi_init(); } -void __cpuinit setup_irq_regs(void) +void setup_irq_regs(void) { /* Enable interrupt delivery. */ unmask_irqs(~0UL); diff --git a/arch/tile/kernel/messaging.c b/arch/tile/kernel/messaging.c index 0858ee6b520f6..00331af9525dc 100644 --- a/arch/tile/kernel/messaging.c +++ b/arch/tile/kernel/messaging.c @@ -25,7 +25,7 @@ /* All messages are stored here */ static DEFINE_PER_CPU(HV_MsgState, msg_state); -void __cpuinit init_messaging(void) +void init_messaging(void) { /* Allocate storage for messages in kernel space */ HV_MsgState *state = &__get_cpu_var(msg_state); diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c index 7a5aa1a7864e2..422d55563c085 100644 --- a/arch/tile/kernel/setup.c +++ b/arch/tile/kernel/setup.c @@ -58,8 +58,8 @@ struct pglist_data node_data[MAX_NUMNODES] __read_mostly; EXPORT_SYMBOL(node_data); /* Information on the NUMA nodes that we compute early */ -unsigned long __cpuinitdata node_start_pfn[MAX_NUMNODES]; -unsigned long __cpuinitdata node_end_pfn[MAX_NUMNODES]; +unsigned long node_start_pfn[MAX_NUMNODES]; +unsigned long node_end_pfn[MAX_NUMNODES]; unsigned long __initdata node_memmap_pfn[MAX_NUMNODES]; unsigned long __initdata node_percpu_pfn[MAX_NUMNODES]; unsigned long __initdata node_free_pfn[MAX_NUMNODES]; @@ -84,7 +84,7 @@ unsigned long __initdata boot_pc = (unsigned long)start_kernel; #ifdef CONFIG_HIGHMEM /* Page frame index of end of lowmem on each controller. */ -unsigned long __cpuinitdata node_lowmem_end_pfn[MAX_NUMNODES]; +unsigned long node_lowmem_end_pfn[MAX_NUMNODES]; /* Number of pages that can be mapped into lowmem. */ static unsigned long __initdata mappable_physpages; @@ -290,7 +290,7 @@ static void *__init setup_pa_va_mapping(void) * This is up to 4 mappings for lowmem, one mapping per memory * controller, plus one for our text segment. */ -static void __cpuinit store_permanent_mappings(void) +static void store_permanent_mappings(void) { int i; @@ -935,7 +935,7 @@ subsys_initcall(topology_init); * So the values we set up here in the hypervisor may be overridden on * the boot cpu as arguments are parsed. */ -static __cpuinit void init_super_pages(void) +static void init_super_pages(void) { #ifdef CONFIG_HUGETLB_SUPER_PAGES int i; @@ -950,7 +950,7 @@ static __cpuinit void init_super_pages(void) * * Called from setup_arch() on the boot cpu, or online_secondary(). */ -void __cpuinit setup_cpu(int boot) +void setup_cpu(int boot) { /* The boot cpu sets up its permanent mappings much earlier. */ if (!boot) diff --git a/arch/tile/kernel/smpboot.c b/arch/tile/kernel/smpboot.c index 44bab29bf2f3a..c4d09761a3838 100644 --- a/arch/tile/kernel/smpboot.c +++ b/arch/tile/kernel/smpboot.c @@ -140,7 +140,7 @@ static struct cpumask cpu_started __cpuinitdata; * to this path without knowing what you're doing, since SMP booting * is pretty fragile. */ -static void __cpuinit start_secondary(void) +static void start_secondary(void) { int cpuid = smp_processor_id(); @@ -183,7 +183,7 @@ static void __cpuinit start_secondary(void) /* * Bring a secondary processor online. */ -void __cpuinit online_secondary(void) +void online_secondary(void) { /* * low-memory mappings have been cleared, flush them from @@ -210,7 +210,7 @@ void __cpuinit online_secondary(void) cpu_startup_entry(CPUHP_ONLINE); } -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle) { /* Wait 5s total for all CPUs for them to come online */ static int timeout; diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c index 5ac397ec6986c..7c353d8c2da92 100644 --- a/arch/tile/kernel/time.c +++ b/arch/tile/kernel/time.c @@ -159,7 +159,7 @@ static DEFINE_PER_CPU(struct clock_event_device, tile_timer) = { .set_mode = tile_timer_set_mode, }; -void __cpuinit setup_tile_timer(void) +void setup_tile_timer(void) { struct clock_event_device *evt = &__get_cpu_var(tile_timer); diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h index 5f9a1243190e8..d2b12988d2ed1 100644 --- a/arch/x86/include/asm/cpu.h +++ b/arch/x86/include/asm/cpu.h @@ -28,7 +28,7 @@ struct x86_cpu { #ifdef CONFIG_HOTPLUG_CPU extern int arch_register_cpu(int num); extern void arch_unregister_cpu(int); -extern void __cpuinit start_cpu0(void); +extern void start_cpu0(void); #ifdef CONFIG_DEBUG_HOTPLUG_CPU0 extern int _debug_hotplug_cpu(int cpu, int action); #endif diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h index 6bc3985ee473d..f98bd66253182 100644 --- a/arch/x86/include/asm/microcode.h +++ b/arch/x86/include/asm/microcode.h @@ -60,11 +60,11 @@ static inline void __exit exit_amd_microcode(void) {} #ifdef CONFIG_MICROCODE_EARLY #define MAX_UCODE_COUNT 128 extern void __init load_ucode_bsp(void); -extern void __cpuinit load_ucode_ap(void); +extern void load_ucode_ap(void); extern int __init save_microcode_in_initrd(void); #else static inline void __init load_ucode_bsp(void) {} -static inline void __cpuinit load_ucode_ap(void) {} +static inline void load_ucode_ap(void) {} static inline int __init save_microcode_in_initrd(void) { return 0; diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h index 5356f927d411c..62c1f79625777 100644 --- a/arch/x86/include/asm/microcode_intel.h +++ b/arch/x86/include/asm/microcode_intel.h @@ -65,11 +65,11 @@ update_match_revision(struct microcode_header_intel *mc_header, int rev); #ifdef CONFIG_MICROCODE_INTEL_EARLY extern void __init load_ucode_intel_bsp(void); -extern void __cpuinit load_ucode_intel_ap(void); +extern void load_ucode_intel_ap(void); extern void show_ucode_info_early(void); #else static inline __init void load_ucode_intel_bsp(void) {} -static inline __cpuinit void load_ucode_intel_ap(void) {} +static inline void load_ucode_intel_ap(void) {} static inline void show_ucode_info_early(void) {} #endif diff --git a/arch/x86/include/asm/mmconfig.h b/arch/x86/include/asm/mmconfig.h index 9b119da1d105f..04a3fed22cfe0 100644 --- a/arch/x86/include/asm/mmconfig.h +++ b/arch/x86/include/asm/mmconfig.h @@ -2,8 +2,8 @@ #define _ASM_X86_MMCONFIG_H #ifdef CONFIG_PCI_MMCONFIG -extern void __cpuinit fam10h_check_enable_mmcfg(void); -extern void __cpuinit check_enable_amd_mmconf_dmi(void); +extern void fam10h_check_enable_mmcfg(void); +extern void check_enable_amd_mmconf_dmi(void); #else static inline void fam10h_check_enable_mmcfg(void) { } static inline void check_enable_amd_mmconf_dmi(void) { } diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 3e2f42a4b872a..626cf70082d7c 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -94,7 +94,7 @@ static inline void early_reserve_e820_mpc_new(void) { } #define default_get_smp_config x86_init_uint_noop #endif -void __cpuinit generic_processor_info(int apicid, int version); +void generic_processor_info(int apicid, int version); #ifdef CONFIG_ACPI extern void mp_register_ioapic(int id, u32 address, u32 gsi_base); extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index 1b99ee5c9f00d..4064acae625d9 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h @@ -39,7 +39,7 @@ static inline void set_apicid_to_node(int apicid, s16 node) __apicid_to_node[apicid] = node; } -extern int __cpuinit numa_cpu_node(int cpu); +extern int numa_cpu_node(int cpu); #else /* CONFIG_NUMA */ static inline void set_apicid_to_node(int apicid, s16 node) @@ -60,8 +60,8 @@ static inline int numa_cpu_node(int cpu) extern void numa_set_node(int cpu, int node); extern void numa_clear_node(int cpu); extern void __init init_cpu_to_node(void); -extern void __cpuinit numa_add_cpu(int cpu); -extern void __cpuinit numa_remove_cpu(int cpu); +extern void numa_add_cpu(int cpu); +extern void numa_remove_cpu(int cpu); #else /* CONFIG_NUMA */ static inline void numa_set_node(int cpu, int node) { } static inline void numa_clear_node(int cpu) { } diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h index 60bef663609a4..bade6ac3b14fc 100644 --- a/arch/x86/include/asm/prom.h +++ b/arch/x86/include/asm/prom.h @@ -27,7 +27,7 @@ extern int of_ioapic; extern u64 initial_dtb; extern void add_dtb(u64 data); extern void x86_add_irq_domains(void); -void __cpuinit x86_of_pci_init(void); +void x86_of_pci_init(void); void x86_dtb_init(void); #else static inline void add_dtb(u64 data) { } diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index b073aaea747c2..1e2b33829cb2b 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -179,7 +179,7 @@ static inline int wbinvd_on_all_cpus(void) } #endif /* CONFIG_SMP */ -extern unsigned disabled_cpus __cpuinitdata; +extern unsigned disabled_cpusdata; #ifdef CONFIG_X86_32_SMP /* diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 230c8ea878e5f..6c96b60fe3f39 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -194,7 +194,7 @@ static int __init acpi_parse_madt(struct acpi_table_header *table) return 0; } -static void __cpuinit acpi_register_lapic(int id, u8 enabled) +static void acpi_register_lapic(int id, u8 enabled) { unsigned int ver = 0; @@ -600,7 +600,7 @@ void __init acpi_set_irq_model_ioapic(void) #ifdef CONFIG_ACPI_HOTPLUG_CPU #include -static void __cpuinit acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) +static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) { #ifdef CONFIG_ACPI_NUMA int nid; @@ -613,7 +613,7 @@ static void __cpuinit acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) #endif } -static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) +static int _acpi_map_lsapic(acpi_handle handle, int *pcpu) { struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *obj; diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 033eb44dc661a..f00a86fe13c72 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -543,7 +543,7 @@ static DEFINE_PER_CPU(struct clock_event_device, lapic_events); * Setup the local APIC timer for this CPU. Copy the initialized values * of the boot CPU and register the clock event in the framework. */ -static void __cpuinit setup_APIC_timer(void) +static void setup_APIC_timer(void) { struct clock_event_device *levt = &__get_cpu_var(lapic_events); @@ -865,7 +865,7 @@ void __init setup_boot_APIC_clock(void) setup_APIC_timer(); } -void __cpuinit setup_secondary_APIC_clock(void) +void setup_secondary_APIC_clock(void) { setup_APIC_timer(); } @@ -1210,7 +1210,7 @@ void __init init_bsp_APIC(void) apic_write(APIC_LVT1, value); } -static void __cpuinit lapic_setup_esr(void) +static void lapic_setup_esr(void) { unsigned int oldvalue, value, maxlvt; @@ -1257,7 +1257,7 @@ static void __cpuinit lapic_setup_esr(void) * Used to setup local APIC while initializing BSP or bringin up APs. * Always called with preemption disabled. */ -void __cpuinit setup_local_APIC(void) +void setup_local_APIC(void) { int cpu = smp_processor_id(); unsigned int value, queued; @@ -1452,7 +1452,7 @@ void __cpuinit setup_local_APIC(void) #endif } -void __cpuinit end_local_APIC_setup(void) +void end_local_APIC_setup(void) { lapic_setup_esr(); @@ -2062,7 +2062,7 @@ void disconnect_bsp_APIC(int virt_wire_setup) apic_write(APIC_LVT1, value); } -void __cpuinit generic_processor_info(int apicid, int version) +void generic_processor_info(int apicid, int version) { int cpu, max = nr_cpu_ids; bool boot_cpu_detected = physid_isset(boot_cpu_physical_apicid, @@ -2332,7 +2332,7 @@ static struct syscore_ops lapic_syscore_ops = { .suspend = lapic_suspend, }; -static void __cpuinit apic_pm_activate(void) +static void apic_pm_activate(void) { apic_pm_state.active = 1; } @@ -2357,7 +2357,7 @@ static void apic_pm_activate(void) { } #ifdef CONFIG_X86_64 -static int __cpuinit apic_cluster_num(void) +static int apic_cluster_num(void) { int i, clusters, zeros; unsigned id; @@ -2402,10 +2402,10 @@ static int __cpuinit apic_cluster_num(void) return clusters; } -static int __cpuinitdata multi_checked; -static int __cpuinitdata multi; +static int multi_checked; +static int multi; -static int __cpuinit set_multi(const struct dmi_system_id *d) +static int set_multi(const struct dmi_system_id *d) { if (multi) return 0; @@ -2414,7 +2414,7 @@ static int __cpuinit set_multi(const struct dmi_system_id *d) return 0; } -static const __cpuinitconst struct dmi_system_id multi_dmi_table[] = { +static const struct dmi_system_id multi_dmi_table[] = { { .callback = set_multi, .ident = "IBM System Summit2", @@ -2426,7 +2426,7 @@ static const __cpuinitconst struct dmi_system_id multi_dmi_table[] = { {} }; -static void __cpuinit dmi_check_multi(void) +static void dmi_check_multi(void) { if (multi_checked) return; @@ -2443,7 +2443,7 @@ static void __cpuinit dmi_check_multi(void) * multi-chassis. * Use DMI to check them */ -__cpuinit int apic_is_clustered_box(void) +int apic_is_clustered_box(void) { dmi_check_multi(); if (multi) diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c index 9a9110918ca71..3e67f9e3d7ef1 100644 --- a/arch/x86/kernel/apic/apic_numachip.c +++ b/arch/x86/kernel/apic/apic_numachip.c @@ -74,7 +74,7 @@ static int numachip_phys_pkg_id(int initial_apic_id, int index_msb) return initial_apic_id >> index_msb; } -static int __cpuinit numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip) +static int numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip) { union numachip_csr_g3_ext_irq_gen int_gen; diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index 0874799a98c6f..c55224731b2d7 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c @@ -130,7 +130,7 @@ int es7000_plat; */ -static int __cpuinit wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip) +static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip) { unsigned long vect = 0, psaival = 0; diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index d661ee95cabfa..1e42e8f305ee2 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c @@ -105,7 +105,7 @@ static void __init smp_dump_qct(void) } } -void __cpuinit numaq_tsc_disable(void) +void numaq_tsc_disable(void) { if (!found_numaq) return; diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index c88baa4ff0e56..140e29db478d7 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c @@ -148,7 +148,7 @@ static void init_x2apic_ldr(void) /* * At CPU state changes, update the x2apic cluster sibling info. */ -static int __cpuinit +static int update_clusterinfo(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int this_cpu = (unsigned long)hcpu; diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index b32dbb411a9ae..578d821d75f25 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -194,7 +194,7 @@ EXPORT_SYMBOL_GPL(uv_possible_blades); unsigned long sn_rtc_cycles_per_second; EXPORT_SYMBOL(sn_rtc_cycles_per_second); -static int __cpuinit uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) +static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) { #ifdef CONFIG_SMP unsigned long val; @@ -401,7 +401,7 @@ static struct apic __refdata apic_x2apic_uv_x = { .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle, }; -static __cpuinit void set_x2apic_extra_bits(int pnode) +static void set_x2apic_extra_bits(int pnode) { __this_cpu_write(x2apic_extra_bits, pnode << uvh_apicid.s.pnode_shift); } @@ -683,7 +683,7 @@ static void uv_heartbeat(unsigned long ignored) mod_timer_pinned(timer, jiffies + SCIR_CPU_HB_INTERVAL); } -static void __cpuinit uv_heartbeat_enable(int cpu) +static void uv_heartbeat_enable(int cpu) { while (!uv_cpu_hub_info(cpu)->scir.enabled) { struct timer_list *timer = &uv_cpu_hub_info(cpu)->scir.timer; @@ -700,7 +700,7 @@ static void __cpuinit uv_heartbeat_enable(int cpu) } #ifdef CONFIG_HOTPLUG_CPU -static void __cpuinit uv_heartbeat_disable(int cpu) +static void uv_heartbeat_disable(int cpu) { if (uv_cpu_hub_info(cpu)->scir.enabled) { uv_cpu_hub_info(cpu)->scir.enabled = 0; @@ -712,7 +712,7 @@ static void __cpuinit uv_heartbeat_disable(int cpu) /* * cpu hotplug notifier */ -static __cpuinit int uv_scir_cpu_notify(struct notifier_block *self, +static int uv_scir_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { long cpu = (long)hcpu; @@ -783,7 +783,7 @@ int uv_set_vga_state(struct pci_dev *pdev, bool decode, * Called on each cpu to initialize the per_cpu UV data area. * FIXME: hotplug not supported yet */ -void __cpuinit uv_cpu_init(void) +void uv_cpu_init(void) { /* CPU 0 initilization will be done via uv_system_init. */ if (!uv_blade_info) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index ae177a014180b..bb4f57d5b7fd8 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -69,7 +69,7 @@ static inline int wrmsrl_amd_safe(unsigned msr, unsigned long long val) extern void vide(void); __asm__(".align 4\nvide: ret"); -static void __cpuinit init_amd_k5(struct cpuinfo_x86 *c) +static void init_amd_k5(struct cpuinfo_x86 *c) { /* * General Systems BIOSen alias the cpu frequency registers @@ -87,7 +87,7 @@ static void __cpuinit init_amd_k5(struct cpuinfo_x86 *c) } -static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c) +static void init_amd_k6(struct cpuinfo_x86 *c) { u32 l, h; int mbytes = num_physpages >> (20-PAGE_SHIFT); @@ -179,7 +179,7 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c) } } -static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c) +static void amd_k7_smp_check(struct cpuinfo_x86 *c) { /* calling is from identify_secondary_cpu() ? */ if (!c->cpu_index) @@ -222,7 +222,7 @@ static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c) add_taint(TAINT_UNSAFE_SMP, LOCKDEP_NOW_UNRELIABLE); } -static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c) +static void init_amd_k7(struct cpuinfo_x86 *c) { u32 l, h; @@ -267,7 +267,7 @@ static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c) * To workaround broken NUMA config. Read the comment in * srat_detect_node(). */ -static int __cpuinit nearby_node(int apicid) +static int nearby_node(int apicid) { int i, node; @@ -292,7 +292,7 @@ static int __cpuinit nearby_node(int apicid) * (2) AMD processors supporting compute units */ #ifdef CONFIG_X86_HT -static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c) +static void amd_get_topology(struct cpuinfo_x86 *c) { u32 nodes, cores_per_cu = 1; u8 node_id; @@ -342,7 +342,7 @@ static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c) * On a AMD dual core setup the lower bits of the APIC id distingush the cores. * Assumes number of cores is a power of two. */ -static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c) +static void amd_detect_cmp(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_HT unsigned bits; @@ -369,7 +369,7 @@ u16 amd_get_nb_id(int cpu) } EXPORT_SYMBOL_GPL(amd_get_nb_id); -static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) +static void srat_detect_node(struct cpuinfo_x86 *c) { #ifdef CONFIG_NUMA int cpu = smp_processor_id(); @@ -421,7 +421,7 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) #endif } -static void __cpuinit early_init_amd_mc(struct cpuinfo_x86 *c) +static void early_init_amd_mc(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_HT unsigned bits, ecx; @@ -447,7 +447,7 @@ static void __cpuinit early_init_amd_mc(struct cpuinfo_x86 *c) #endif } -static void __cpuinit bsp_init_amd(struct cpuinfo_x86 *c) +static void bsp_init_amd(struct cpuinfo_x86 *c) { if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) { @@ -475,7 +475,7 @@ static void __cpuinit bsp_init_amd(struct cpuinfo_x86 *c) } } -static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) +static void early_init_amd(struct cpuinfo_x86 *c) { early_init_amd_mc(c); @@ -524,7 +524,7 @@ static const int amd_erratum_383[]; static const int amd_erratum_400[]; static bool cpu_has_amd_erratum(const int *erratum); -static void __cpuinit init_amd(struct cpuinfo_x86 *c) +static void init_amd(struct cpuinfo_x86 *c) { u32 dummy; unsigned long long value; @@ -750,7 +750,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) } #ifdef CONFIG_X86_32 -static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c, +static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size) { /* AMD errata T13 (order #21922) */ @@ -767,7 +767,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c, } #endif -static void __cpuinit cpu_set_tlb_flushall_shift(struct cpuinfo_x86 *c) +static void cpu_set_tlb_flushall_shift(struct cpuinfo_x86 *c) { tlb_flushall_shift = 5; @@ -775,7 +775,7 @@ static void __cpuinit cpu_set_tlb_flushall_shift(struct cpuinfo_x86 *c) tlb_flushall_shift = 4; } -static void __cpuinit cpu_detect_tlb_amd(struct cpuinfo_x86 *c) +static void cpu_detect_tlb_amd(struct cpuinfo_x86 *c) { u32 ebx, eax, ecx, edx; u16 mask = 0xfff; @@ -830,7 +830,7 @@ static void __cpuinit cpu_detect_tlb_amd(struct cpuinfo_x86 *c) cpu_set_tlb_flushall_shift(c); } -static const struct cpu_dev __cpuinitconst amd_cpu_dev = { +static const struct cpu_dev amd_cpu_dev = { .c_vendor = "AMD", .c_ident = { "AuthenticAMD" }, #ifdef CONFIG_X86_32 diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index 159103c0b1f4b..fbf6c3bc2400a 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c @@ -11,7 +11,7 @@ #ifdef CONFIG_X86_OOSTORE -static u32 __cpuinit power2(u32 x) +static u32 power2(u32 x) { u32 s = 1; @@ -25,7 +25,7 @@ static u32 __cpuinit power2(u32 x) /* * Set up an actual MCR */ -static void __cpuinit centaur_mcr_insert(int reg, u32 base, u32 size, int key) +static void centaur_mcr_insert(int reg, u32 base, u32 size, int key) { u32 lo, hi; @@ -42,7 +42,7 @@ static void __cpuinit centaur_mcr_insert(int reg, u32 base, u32 size, int key) * * Shortcut: We know you can't put 4Gig of RAM on a winchip */ -static u32 __cpuinit ramtop(void) +static u32 ramtop(void) { u32 clip = 0xFFFFFFFFUL; u32 top = 0; @@ -91,7 +91,7 @@ static u32 __cpuinit ramtop(void) /* * Compute a set of MCR's to give maximum coverage */ -static int __cpuinit centaur_mcr_compute(int nr, int key) +static int centaur_mcr_compute(int nr, int key) { u32 mem = ramtop(); u32 root = power2(mem); @@ -157,7 +157,7 @@ static int __cpuinit centaur_mcr_compute(int nr, int key) return ct; } -static void __cpuinit centaur_create_optimal_mcr(void) +static void centaur_create_optimal_mcr(void) { int used; int i; @@ -181,7 +181,7 @@ static void __cpuinit centaur_create_optimal_mcr(void) wrmsr(MSR_IDT_MCR0+i, 0, 0); } -static void __cpuinit winchip2_create_optimal_mcr(void) +static void winchip2_create_optimal_mcr(void) { u32 lo, hi; int used; @@ -217,7 +217,7 @@ static void __cpuinit winchip2_create_optimal_mcr(void) /* * Handle the MCR key on the Winchip 2. */ -static void __cpuinit winchip2_unprotect_mcr(void) +static void winchip2_unprotect_mcr(void) { u32 lo, hi; u32 key; @@ -229,7 +229,7 @@ static void __cpuinit winchip2_unprotect_mcr(void) wrmsr(MSR_IDT_MCR_CTRL, lo, hi); } -static void __cpuinit winchip2_protect_mcr(void) +static void winchip2_protect_mcr(void) { u32 lo, hi; @@ -247,7 +247,7 @@ static void __cpuinit winchip2_protect_mcr(void) #define RNG_ENABLED (1 << 3) #define RNG_ENABLE (1 << 6) /* MSR_VIA_RNG */ -static void __cpuinit init_c3(struct cpuinfo_x86 *c) +static void init_c3(struct cpuinfo_x86 *c) { u32 lo, hi; @@ -318,7 +318,7 @@ enum { EAMD3D = 1<<20, }; -static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) +static void early_init_centaur(struct cpuinfo_x86 *c) { switch (c->x86) { #ifdef CONFIG_X86_32 @@ -337,7 +337,7 @@ static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) #endif } -static void __cpuinit init_centaur(struct cpuinfo_x86 *c) +static void init_centaur(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_32 char *name; @@ -468,7 +468,7 @@ static void __cpuinit init_centaur(struct cpuinfo_x86 *c) #endif } -static unsigned int __cpuinit +static unsigned int centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) { #ifdef CONFIG_X86_32 @@ -488,7 +488,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) return size; } -static const struct cpu_dev __cpuinitconst centaur_cpu_dev = { +static const struct cpu_dev centaur_cpu_dev = { .c_vendor = "Centaur", .c_ident = { "CentaurHauls" }, .c_early_init = early_init_centaur, diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 564140155c360..7ad5011f5ec31 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -63,7 +63,7 @@ void __init setup_cpu_local_masks(void) alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask); } -static void __cpuinit default_init(struct cpuinfo_x86 *c) +static void default_init(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_64 cpu_detect_cache_sizes(c); @@ -80,13 +80,13 @@ static void __cpuinit default_init(struct cpuinfo_x86 *c) #endif } -static const struct cpu_dev __cpuinitconst default_cpu = { +static const struct cpu_dev default_cpu = { .c_init = default_init, .c_vendor = "Unknown", .c_x86_vendor = X86_VENDOR_UNKNOWN, }; -static const struct cpu_dev *this_cpu __cpuinitdata = &default_cpu; +static const struct cpu_dev *this_cpu = &default_cpu; DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = { #ifdef CONFIG_X86_64 @@ -162,8 +162,8 @@ static int __init x86_xsaveopt_setup(char *s) __setup("noxsaveopt", x86_xsaveopt_setup); #ifdef CONFIG_X86_32 -static int cachesize_override __cpuinitdata = -1; -static int disable_x86_serial_nr __cpuinitdata = 1; +static int cachesize_override = -1; +static int disable_x86_serial_nr = 1; static int __init cachesize_setup(char *str) { @@ -217,12 +217,12 @@ static inline int flag_is_changeable_p(u32 flag) } /* Probe for the CPUID instruction */ -int __cpuinit have_cpuid_p(void) +int have_cpuid_p(void) { return flag_is_changeable_p(X86_EFLAGS_ID); } -static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) +static void squash_the_stupid_serial_number(struct cpuinfo_x86 *c) { unsigned long lo, hi; @@ -313,7 +313,7 @@ cpuid_dependent_features[] = { { 0, 0 } }; -static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) +static void filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) { const struct cpuid_dependent_feature *df; @@ -351,7 +351,7 @@ static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) */ /* Look up CPU names by table lookup. */ -static const char *__cpuinit table_lookup_model(struct cpuinfo_x86 *c) +static const char *table_lookup_model(struct cpuinfo_x86 *c) { const struct cpu_model_info *info; @@ -401,9 +401,9 @@ void switch_to_new_gdt(int cpu) load_percpu_segment(cpu); } -static const struct cpu_dev *__cpuinitdata cpu_devs[X86_VENDOR_NUM] = {}; +static const struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {}; -static void __cpuinit get_model_name(struct cpuinfo_x86 *c) +static void get_model_name(struct cpuinfo_x86 *c) { unsigned int *v; char *p, *q; @@ -432,7 +432,7 @@ static void __cpuinit get_model_name(struct cpuinfo_x86 *c) } } -void __cpuinit cpu_detect_cache_sizes(struct cpuinfo_x86 *c) +void cpu_detect_cache_sizes(struct cpuinfo_x86 *c) { unsigned int n, dummy, ebx, ecx, edx, l2size; @@ -486,7 +486,7 @@ u16 __read_mostly tlb_lld_4m[NR_INFO]; */ s8 __read_mostly tlb_flushall_shift = -1; -void __cpuinit cpu_detect_tlb(struct cpuinfo_x86 *c) +void cpu_detect_tlb(struct cpuinfo_x86 *c) { if (this_cpu->c_detect_tlb) this_cpu->c_detect_tlb(c); @@ -500,7 +500,7 @@ void __cpuinit cpu_detect_tlb(struct cpuinfo_x86 *c) tlb_flushall_shift); } -void __cpuinit detect_ht(struct cpuinfo_x86 *c) +void detect_ht(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_HT u32 eax, ebx, ecx, edx; @@ -551,7 +551,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c) #endif } -static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) +static void get_cpu_vendor(struct cpuinfo_x86 *c) { char *v = c->x86_vendor_id; int i; @@ -578,7 +578,7 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) this_cpu = &default_cpu; } -void __cpuinit cpu_detect(struct cpuinfo_x86 *c) +void cpu_detect(struct cpuinfo_x86 *c) { /* Get vendor name */ cpuid(0x00000000, (unsigned int *)&c->cpuid_level, @@ -608,7 +608,7 @@ void __cpuinit cpu_detect(struct cpuinfo_x86 *c) } } -void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) +void get_cpu_cap(struct cpuinfo_x86 *c) { u32 tfms, xlvl; u32 ebx; @@ -659,7 +659,7 @@ void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) init_scattered_cpuid_features(c); } -static void __cpuinit identify_cpu_without_cpuid(struct cpuinfo_x86 *c) +static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_32 int i; @@ -775,7 +775,7 @@ void __init early_cpu_init(void) * unless we can find a reliable way to detect all the broken cases. * Enable it explicitly on 64-bit for non-constant inputs of cpu_has(). */ -static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) +static void detect_nopl(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_32 clear_cpu_cap(c, X86_FEATURE_NOPL); @@ -784,7 +784,7 @@ static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) #endif } -static void __cpuinit generic_identify(struct cpuinfo_x86 *c) +static void generic_identify(struct cpuinfo_x86 *c) { c->extended_cpuid_level = 0; @@ -821,7 +821,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c) /* * This does the hard work of actually picking apart the CPU stuff... */ -static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) +static void identify_cpu(struct cpuinfo_x86 *c) { int i; @@ -966,7 +966,7 @@ void __init identify_boot_cpu(void) cpu_detect_tlb(&boot_cpu_data); } -void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) +void identify_secondary_cpu(struct cpuinfo_x86 *c) { BUG_ON(c == &boot_cpu_data); identify_cpu(c); @@ -981,14 +981,14 @@ struct msr_range { unsigned max; }; -static const struct msr_range msr_range_array[] __cpuinitconst = { +static const struct msr_range msr_range_array[] = { { 0x00000000, 0x00000418}, { 0xc0000000, 0xc000040b}, { 0xc0010000, 0xc0010142}, { 0xc0011000, 0xc001103b}, }; -static void __cpuinit __print_cpu_msr(void) +static void __print_cpu_msr(void) { unsigned index_min, index_max; unsigned index; @@ -1028,7 +1028,7 @@ static __init int setup_noclflush(char *arg) } __setup("noclflush", setup_noclflush); -void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) +void print_cpu_info(struct cpuinfo_x86 *c) { const char *vendor = NULL; @@ -1057,7 +1057,7 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) print_cpu_msr(c); } -void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c) +void print_cpu_msr(struct cpuinfo_x86 *c) { if (c->cpu_index < show_msr) __print_cpu_msr(); @@ -1222,7 +1222,7 @@ static void dbg_restore_debug_regs(void) */ #ifdef CONFIG_X86_64 -void __cpuinit cpu_init(void) +void cpu_init(void) { struct orig_ist *oist; struct task_struct *me; @@ -1321,7 +1321,7 @@ void __cpuinit cpu_init(void) #else -void __cpuinit cpu_init(void) +void cpu_init(void) { int cpu = smp_processor_id(); struct task_struct *curr = current; diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index d048d5ca43c1c..f1fa2f2c2c906 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c @@ -15,7 +15,7 @@ /* * Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU */ -static void __cpuinit __do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) +static void __do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) { unsigned char ccr2, ccr3; @@ -44,7 +44,7 @@ static void __cpuinit __do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) } } -static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) +static void do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) { unsigned long flags; @@ -59,25 +59,25 @@ static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) * Actually since bugs.h doesn't even reference this perhaps someone should * fix the documentation ??? */ -static unsigned char Cx86_dir0_msb __cpuinitdata = 0; +static unsigned char Cx86_dir0_msb = 0; -static const char __cpuinitconst Cx86_model[][9] = { +static const char Cx86_model[][9] = { "Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ", "M II ", "Unknown" }; -static const char __cpuinitconst Cx486_name[][5] = { +static const char Cx486_name[][5] = { "SLC", "DLC", "SLC2", "DLC2", "SRx", "DRx", "SRx2", "DRx2" }; -static const char __cpuinitconst Cx486S_name[][4] = { +static const char Cx486S_name[][4] = { "S", "S2", "Se", "S2e" }; -static const char __cpuinitconst Cx486D_name[][4] = { +static const char Cx486D_name[][4] = { "DX", "DX2", "?", "?", "?", "DX4" }; -static char Cx86_cb[] __cpuinitdata = "?.5x Core/Bus Clock"; -static const char __cpuinitconst cyrix_model_mult1[] = "12??43"; -static const char __cpuinitconst cyrix_model_mult2[] = "12233445"; +static char Cx86_cb[] = "?.5x Core/Bus Clock"; +static const char cyrix_model_mult1[] = "12??43"; +static const char cyrix_model_mult2[] = "12233445"; /* * Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old @@ -87,7 +87,7 @@ static const char __cpuinitconst cyrix_model_mult2[] = "12233445"; * FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP */ -static void __cpuinit check_cx686_slop(struct cpuinfo_x86 *c) +static void check_cx686_slop(struct cpuinfo_x86 *c) { unsigned long flags; @@ -112,7 +112,7 @@ static void __cpuinit check_cx686_slop(struct cpuinfo_x86 *c) } -static void __cpuinit set_cx86_reorder(void) +static void set_cx86_reorder(void) { u8 ccr3; @@ -127,7 +127,7 @@ static void __cpuinit set_cx86_reorder(void) setCx86(CX86_CCR3, ccr3); } -static void __cpuinit set_cx86_memwb(void) +static void set_cx86_memwb(void) { printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n"); @@ -143,7 +143,7 @@ static void __cpuinit set_cx86_memwb(void) * Configure later MediaGX and/or Geode processor. */ -static void __cpuinit geode_configure(void) +static void geode_configure(void) { unsigned long flags; u8 ccr3; @@ -166,7 +166,7 @@ static void __cpuinit geode_configure(void) local_irq_restore(flags); } -static void __cpuinit early_init_cyrix(struct cpuinfo_x86 *c) +static void early_init_cyrix(struct cpuinfo_x86 *c) { unsigned char dir0, dir0_msn, dir1 = 0; @@ -185,7 +185,7 @@ static void __cpuinit early_init_cyrix(struct cpuinfo_x86 *c) } } -static void __cpuinit init_cyrix(struct cpuinfo_x86 *c) +static void init_cyrix(struct cpuinfo_x86 *c) { unsigned char dir0, dir0_msn, dir0_lsn, dir1 = 0; char *buf = c->x86_model_id; @@ -356,7 +356,7 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c) /* * Handle National Semiconductor branded processors */ -static void __cpuinit init_nsc(struct cpuinfo_x86 *c) +static void init_nsc(struct cpuinfo_x86 *c) { /* * There may be GX1 processors in the wild that are branded @@ -405,7 +405,7 @@ static inline int test_cyrix_52div(void) return (unsigned char) (test >> 8) == 0x02; } -static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c) +static void cyrix_identify(struct cpuinfo_x86 *c) { /* Detect Cyrix with disabled CPUID */ if (c->x86 == 4 && test_cyrix_52div()) { @@ -441,7 +441,7 @@ static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c) } } -static const struct cpu_dev __cpuinitconst cyrix_cpu_dev = { +static const struct cpu_dev cyrix_cpu_dev = { .c_vendor = "Cyrix", .c_ident = { "CyrixInstead" }, .c_early_init = early_init_cyrix, @@ -452,7 +452,7 @@ static const struct cpu_dev __cpuinitconst cyrix_cpu_dev = { cpu_dev_register(cyrix_cpu_dev); -static const struct cpu_dev __cpuinitconst nsc_cpu_dev = { +static const struct cpu_dev nsc_cpu_dev = { .c_vendor = "NSC", .c_ident = { "Geode by NSC" }, .c_init = init_nsc, diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index 1e7e84a02ebaf..87279212d3186 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -60,7 +60,7 @@ detect_hypervisor_vendor(void) } } -void __cpuinit init_hypervisor(struct cpuinfo_x86 *c) +void init_hypervisor(struct cpuinfo_x86 *c) { if (x86_hyper && x86_hyper->set_cpu_features) x86_hyper->set_cpu_features(c); diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 8533e69d2b89f..1d8152b764a7c 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -26,7 +26,7 @@ #include #endif -static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) +static void early_init_intel(struct cpuinfo_x86 *c) { u64 misc_enable; @@ -178,7 +178,7 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) * This is called before we do cpu ident work */ -int __cpuinit ppro_with_ram_bug(void) +int ppro_with_ram_bug(void) { /* Uses data from early_cpu_detect now */ if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && @@ -191,7 +191,7 @@ int __cpuinit ppro_with_ram_bug(void) return 0; } -static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c) +static void intel_smp_check(struct cpuinfo_x86 *c) { /* calling is from identify_secondary_cpu() ? */ if (!c->cpu_index) @@ -211,7 +211,7 @@ static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c) } } -static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) +static void intel_workarounds(struct cpuinfo_x86 *c) { unsigned long lo, hi; @@ -290,12 +290,12 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) intel_smp_check(c); } #else -static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) +static void intel_workarounds(struct cpuinfo_x86 *c) { } #endif -static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) +static void srat_detect_node(struct cpuinfo_x86 *c) { #ifdef CONFIG_NUMA unsigned node; @@ -315,7 +315,7 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) /* * find out the number of processor cores on the die */ -static int __cpuinit intel_num_cpu_cores(struct cpuinfo_x86 *c) +static int intel_num_cpu_cores(struct cpuinfo_x86 *c) { unsigned int eax, ebx, ecx, edx; @@ -330,7 +330,7 @@ static int __cpuinit intel_num_cpu_cores(struct cpuinfo_x86 *c) return 1; } -static void __cpuinit detect_vmx_virtcap(struct cpuinfo_x86 *c) +static void detect_vmx_virtcap(struct cpuinfo_x86 *c) { /* Intel VMX MSR indicated features */ #define X86_VMX_FEATURE_PROC_CTLS_TPR_SHADOW 0x00200000 @@ -368,7 +368,7 @@ static void __cpuinit detect_vmx_virtcap(struct cpuinfo_x86 *c) } } -static void __cpuinit init_intel(struct cpuinfo_x86 *c) +static void init_intel(struct cpuinfo_x86 *c) { unsigned int l2 = 0; @@ -488,7 +488,7 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) } #ifdef CONFIG_X86_32 -static unsigned int __cpuinit intel_size_cache(struct cpuinfo_x86 *c, unsigned int size) +static unsigned int intel_size_cache(struct cpuinfo_x86 *c, unsigned int size) { /* * Intel PIII Tualatin. This comes in two flavours. @@ -522,7 +522,7 @@ static unsigned int __cpuinit intel_size_cache(struct cpuinfo_x86 *c, unsigned i #define STLB_4K 0x41 -static const struct _tlb_table intel_tlb_table[] __cpuinitconst = { +static const struct _tlb_table intel_tlb_table[] = { { 0x01, TLB_INST_4K, 32, " TLB_INST 4 KByte pages, 4-way set associative" }, { 0x02, TLB_INST_4M, 2, " TLB_INST 4 MByte pages, full associative" }, { 0x03, TLB_DATA_4K, 64, " TLB_DATA 4 KByte pages, 4-way set associative" }, @@ -552,7 +552,7 @@ static const struct _tlb_table intel_tlb_table[] __cpuinitconst = { { 0x00, 0, 0 } }; -static void __cpuinit intel_tlb_lookup(const unsigned char desc) +static void intel_tlb_lookup(const unsigned char desc) { unsigned char k; if (desc == 0) @@ -621,7 +621,7 @@ static void __cpuinit intel_tlb_lookup(const unsigned char desc) } } -static void __cpuinit intel_tlb_flushall_shift_set(struct cpuinfo_x86 *c) +static void intel_tlb_flushall_shift_set(struct cpuinfo_x86 *c) { switch ((c->x86 << 8) + c->x86_model) { case 0x60f: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */ @@ -650,7 +650,7 @@ static void __cpuinit intel_tlb_flushall_shift_set(struct cpuinfo_x86 *c) } } -static void __cpuinit intel_detect_tlb(struct cpuinfo_x86 *c) +static void intel_detect_tlb(struct cpuinfo_x86 *c) { int i, j, n; unsigned int regs[4]; @@ -677,7 +677,7 @@ static void __cpuinit intel_detect_tlb(struct cpuinfo_x86 *c) intel_tlb_flushall_shift_set(c); } -static const struct cpu_dev __cpuinitconst intel_cpu_dev = { +static const struct cpu_dev intel_cpu_dev = { .c_vendor = "Intel", .c_ident = { "GenuineIntel" }, #ifdef CONFIG_X86_32 diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 7c6f7d548c0f9..3ef4c94a2f5eb 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c @@ -37,7 +37,7 @@ struct _cache_table { /* All the cache descriptor types we care about (no TLB or trace cache entries) */ -static const struct _cache_table __cpuinitconst cache_table[] = +static const struct _cache_table cache_table[] = { { 0x06, LVL_1_INST, 8 }, /* 4-way set assoc, 32 byte line size */ { 0x08, LVL_1_INST, 16 }, /* 4-way set assoc, 32 byte line size */ @@ -203,7 +203,7 @@ union l3_cache { unsigned val; }; -static const unsigned short __cpuinitconst assocs[] = { +static const unsigned short assocs[] = { [1] = 1, [2] = 2, [4] = 4, @@ -217,10 +217,10 @@ static const unsigned short __cpuinitconst assocs[] = { [0xf] = 0xffff /* fully associative - no way to show this currently */ }; -static const unsigned char __cpuinitconst levels[] = { 1, 1, 2, 3 }; -static const unsigned char __cpuinitconst types[] = { 1, 2, 3, 3 }; +static const unsigned char levels[] = { 1, 1, 2, 3 }; +static const unsigned char types[] = { 1, 2, 3, 3 }; -static void __cpuinit +static void amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, union _cpuid4_leaf_ebx *ebx, union _cpuid4_leaf_ecx *ecx) @@ -302,7 +302,7 @@ struct _cache_attr { /* * L3 cache descriptors */ -static void __cpuinit amd_calc_l3_indices(struct amd_northbridge *nb) +static void amd_calc_l3_indices(struct amd_northbridge *nb) { struct amd_l3_cache *l3 = &nb->l3_cache; unsigned int sc0, sc1, sc2, sc3; @@ -325,7 +325,7 @@ static void __cpuinit amd_calc_l3_indices(struct amd_northbridge *nb) l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1; } -static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) +static void amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) { int node; @@ -528,7 +528,7 @@ static struct _cache_attr subcaches = #endif /* CONFIG_AMD_NB && CONFIG_SYSFS */ static int -__cpuinit cpuid4_cache_lookup_regs(int index, +cpuid4_cache_lookup_regs(int index, struct _cpuid4_info_regs *this_leaf) { union _cpuid4_leaf_eax eax; @@ -560,7 +560,7 @@ __cpuinit cpuid4_cache_lookup_regs(int index, return 0; } -static int __cpuinit find_num_cache_leaves(struct cpuinfo_x86 *c) +static int find_num_cache_leaves(struct cpuinfo_x86 *c) { unsigned int eax, ebx, ecx, edx, op; union _cpuid4_leaf_eax cache_eax; @@ -580,7 +580,7 @@ static int __cpuinit find_num_cache_leaves(struct cpuinfo_x86 *c) return i; } -void __cpuinit init_amd_cacheinfo(struct cpuinfo_x86 *c) +void init_amd_cacheinfo(struct cpuinfo_x86 *c) { if (cpu_has_topoext) { @@ -593,7 +593,7 @@ void __cpuinit init_amd_cacheinfo(struct cpuinfo_x86 *c) } } -unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c) +unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) { /* Cache sizes */ unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; @@ -746,7 +746,7 @@ static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info); #ifdef CONFIG_SMP -static int __cpuinit cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) +static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) { struct _cpuid4_info *this_leaf; int i, sibling; @@ -795,7 +795,7 @@ static int __cpuinit cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) return 1; } -static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) +static void cache_shared_cpu_map_setup(unsigned int cpu, int index) { struct _cpuid4_info *this_leaf, *sibling_leaf; unsigned long num_threads_sharing; @@ -830,7 +830,7 @@ static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) } } } -static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index) +static void cache_remove_shared_cpu_map(unsigned int cpu, int index) { struct _cpuid4_info *this_leaf, *sibling_leaf; int sibling; @@ -843,16 +843,16 @@ static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index) } } #else -static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) +static void cache_shared_cpu_map_setup(unsigned int cpu, int index) { } -static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index) +static void cache_remove_shared_cpu_map(unsigned int cpu, int index) { } #endif -static void __cpuinit free_cache_attributes(unsigned int cpu) +static void free_cache_attributes(unsigned int cpu) { int i; @@ -863,7 +863,7 @@ static void __cpuinit free_cache_attributes(unsigned int cpu) per_cpu(ici_cpuid4_info, cpu) = NULL; } -static void __cpuinit get_cpu_leaves(void *_retval) +static void get_cpu_leaves(void *_retval) { int j, *retval = _retval, cpu = smp_processor_id(); @@ -883,7 +883,7 @@ static void __cpuinit get_cpu_leaves(void *_retval) } } -static int __cpuinit detect_cache_attributes(unsigned int cpu) +static int detect_cache_attributes(unsigned int cpu) { int retval; @@ -1017,7 +1017,7 @@ static struct attribute *default_attrs[] = { }; #ifdef CONFIG_AMD_NB -static struct attribute ** __cpuinit amd_l3_attrs(void) +static struct attribute ** amd_l3_attrs(void) { static struct attribute **attrs; int n; @@ -1093,7 +1093,7 @@ static struct kobj_type ktype_percpu_entry = { .sysfs_ops = &sysfs_ops, }; -static void __cpuinit cpuid4_cache_sysfs_exit(unsigned int cpu) +static void cpuid4_cache_sysfs_exit(unsigned int cpu) { kfree(per_cpu(ici_cache_kobject, cpu)); kfree(per_cpu(ici_index_kobject, cpu)); @@ -1102,7 +1102,7 @@ static void __cpuinit cpuid4_cache_sysfs_exit(unsigned int cpu) free_cache_attributes(cpu); } -static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) +static int cpuid4_cache_sysfs_init(unsigned int cpu) { int err; @@ -1134,7 +1134,7 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) static DECLARE_BITMAP(cache_dev_map, NR_CPUS); /* Add/Remove cache interface for CPU device */ -static int __cpuinit cache_add_dev(struct device *dev) +static int cache_add_dev(struct device *dev) { unsigned int cpu = dev->id; unsigned long i, j; @@ -1185,7 +1185,7 @@ static int __cpuinit cache_add_dev(struct device *dev) return 0; } -static void __cpuinit cache_remove_dev(struct device *dev) +static void cache_remove_dev(struct device *dev) { unsigned int cpu = dev->id; unsigned long i; @@ -1202,7 +1202,7 @@ static void __cpuinit cache_remove_dev(struct device *dev) cpuid4_cache_sysfs_exit(cpu); } -static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb, +static int cacheinfo_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -1222,7 +1222,7 @@ static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata cacheinfo_cpu_notifier = { +static struct notifier_block cacheinfo_cpu_notifier = { .notifier_call = cacheinfo_cpu_callback, }; diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 9239504b41cbc..a33bca5083fb7 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -1360,7 +1360,7 @@ int mce_notify_irq(void) } EXPORT_SYMBOL_GPL(mce_notify_irq); -static int __cpuinit __mcheck_cpu_mce_banks_init(void) +static int __mcheck_cpu_mce_banks_init(void) { int i; u8 num_banks = mca_cfg.banks; @@ -1381,7 +1381,7 @@ static int __cpuinit __mcheck_cpu_mce_banks_init(void) /* * Initialize Machine Checks for a CPU. */ -static int __cpuinit __mcheck_cpu_cap_init(void) +static int __mcheck_cpu_cap_init(void) { unsigned b; u64 cap; @@ -1480,7 +1480,7 @@ static void quirk_sandybridge_ifu(int bank, struct mce *m, struct pt_regs *regs) } /* Add per CPU specific workarounds here */ -static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c) +static int __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c) { struct mca_config *cfg = &mca_cfg; @@ -1590,7 +1590,7 @@ static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c) return 0; } -static int __cpuinit __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c) +static int __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c) { if (c->x86 != 5) return 0; @@ -1661,7 +1661,7 @@ void (*machine_check_vector)(struct pt_regs *, long error_code) = * Called for each booted CPU to set up machine checks. * Must be called with preempt off: */ -void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c) +void mcheck_cpu_init(struct cpuinfo_x86 *c) { if (mca_cfg.disabled) return; @@ -2225,7 +2225,7 @@ static void mce_device_release(struct device *dev) } /* Per cpu device init. All of the cpus still share the same ctrl bank: */ -static __cpuinit int mce_device_create(unsigned int cpu) +static int mce_device_create(unsigned int cpu) { struct device *dev; int err; @@ -2271,7 +2271,7 @@ static __cpuinit int mce_device_create(unsigned int cpu) return err; } -static __cpuinit void mce_device_remove(unsigned int cpu) +static void mce_device_remove(unsigned int cpu) { struct device *dev = per_cpu(mce_device, cpu); int i; @@ -2291,7 +2291,7 @@ static __cpuinit void mce_device_remove(unsigned int cpu) } /* Make sure there are no machine checks on offlined CPUs. */ -static void __cpuinit mce_disable_cpu(void *h) +static void mce_disable_cpu(void *h) { unsigned long action = *(unsigned long *)h; int i; @@ -2309,7 +2309,7 @@ static void __cpuinit mce_disable_cpu(void *h) } } -static void __cpuinit mce_reenable_cpu(void *h) +static void mce_reenable_cpu(void *h) { unsigned long action = *(unsigned long *)h; int i; @@ -2328,7 +2328,7 @@ static void __cpuinit mce_reenable_cpu(void *h) } /* Get notified when a cpu comes on/off. Be hotplug friendly. */ -static int __cpuinit +static int mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -2364,7 +2364,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) return NOTIFY_OK; } -static struct notifier_block mce_cpu_notifier __cpuinitdata = { +static struct notifier_block mce_cpu_notifier = { .notifier_call = mce_cpu_callback, }; diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index 9cb52767999aa..cd98fade4c1ce 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c @@ -458,7 +458,7 @@ static struct kobj_type threshold_ktype = { .default_attrs = default_attrs, }; -static __cpuinit int allocate_threshold_blocks(unsigned int cpu, +static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank, unsigned int block, u32 address) @@ -543,7 +543,7 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, return err; } -static __cpuinit int __threshold_add_blocks(struct threshold_bank *b) +static int __threshold_add_blocks(struct threshold_bank *b) { struct list_head *head = &b->blocks->miscj; struct threshold_block *pos = NULL; @@ -567,7 +567,7 @@ static __cpuinit int __threshold_add_blocks(struct threshold_bank *b) return err; } -static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) +static int threshold_create_bank(unsigned int cpu, unsigned int bank) { struct device *dev = per_cpu(mce_device, cpu); struct amd_northbridge *nb = NULL; @@ -632,7 +632,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) } /* create dir/files for all valid threshold banks */ -static __cpuinit int threshold_create_device(unsigned int cpu) +static int threshold_create_device(unsigned int cpu) { unsigned int bank; struct threshold_bank **bp; @@ -736,7 +736,7 @@ static void threshold_remove_device(unsigned int cpu) } /* get notified when a cpu comes on/off */ -static void __cpuinit +static void amd_64_threshold_cpu_callback(unsigned long action, unsigned int cpu) { switch (action) { diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 47a1870279aad..7b7e8fdd771cb 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c @@ -221,7 +221,7 @@ static int thresh_event_valid(int event) #ifdef CONFIG_SYSFS /* Add/Remove thermal_throttle interface for CPU device: */ -static __cpuinit int thermal_throttle_add_dev(struct device *dev, +static int thermal_throttle_add_dev(struct device *dev, unsigned int cpu) { int err; @@ -248,7 +248,7 @@ static __cpuinit int thermal_throttle_add_dev(struct device *dev, return err; } -static __cpuinit void thermal_throttle_remove_dev(struct device *dev) +static void thermal_throttle_remove_dev(struct device *dev) { sysfs_remove_group(&dev->kobj, &thermal_attr_group); } @@ -257,7 +257,7 @@ static __cpuinit void thermal_throttle_remove_dev(struct device *dev) static DEFINE_MUTEX(therm_cpu_lock); /* Get notified when a cpu comes on/off. Be hotplug friendly. */ -static __cpuinit int +static int thermal_throttle_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) @@ -288,7 +288,7 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb, return notifier_from_errno(err); } -static struct notifier_block thermal_throttle_cpu_notifier __cpuinitdata = +static struct notifier_block thermal_throttle_cpu_notifier = { .notifier_call = thermal_throttle_cpu_callback, }; diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 123d9e2271dc5..715528dd6d3c8 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -1271,7 +1271,7 @@ perf_event_nmi_handler(unsigned int cmd, struct pt_regs *regs) struct event_constraint emptyconstraint; struct event_constraint unconstrained; -static int __cpuinit +static int x86_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (long)hcpu; diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c index b46601ada8134..4b8e4d3cd6ea6 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c +++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c @@ -894,7 +894,7 @@ static inline void perf_ibs_pm_init(void) { } #endif -static int __cpuinit +static int perf_ibs_cpu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) { switch (action & ~CPU_TASKS_FROZEN) { diff --git a/arch/x86/kernel/cpu/perf_event_amd_uncore.c b/arch/x86/kernel/cpu/perf_event_amd_uncore.c index c0c661adf03e2..b7b2e3de95e39 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_amd_uncore.c @@ -288,13 +288,13 @@ static struct pmu amd_l2_pmu = { .read = amd_uncore_read, }; -static struct amd_uncore * __cpuinit amd_uncore_alloc(unsigned int cpu) +static struct amd_uncore * amd_uncore_alloc(unsigned int cpu) { return kzalloc_node(sizeof(struct amd_uncore), GFP_KERNEL, cpu_to_node(cpu)); } -static void __cpuinit amd_uncore_cpu_up_prepare(unsigned int cpu) +static void amd_uncore_cpu_up_prepare(unsigned int cpu) { struct amd_uncore *uncore; @@ -322,7 +322,7 @@ static void __cpuinit amd_uncore_cpu_up_prepare(unsigned int cpu) } static struct amd_uncore * -__cpuinit amd_uncore_find_online_sibling(struct amd_uncore *this, +amd_uncore_find_online_sibling(struct amd_uncore *this, struct amd_uncore * __percpu *uncores) { unsigned int cpu; @@ -348,7 +348,7 @@ __cpuinit amd_uncore_find_online_sibling(struct amd_uncore *this, return this; } -static void __cpuinit amd_uncore_cpu_starting(unsigned int cpu) +static void amd_uncore_cpu_starting(unsigned int cpu) { unsigned int eax, ebx, ecx, edx; struct amd_uncore *uncore; @@ -376,7 +376,7 @@ static void __cpuinit amd_uncore_cpu_starting(unsigned int cpu) } } -static void __cpuinit uncore_online(unsigned int cpu, +static void uncore_online(unsigned int cpu, struct amd_uncore * __percpu *uncores) { struct amd_uncore *uncore = *per_cpu_ptr(uncores, cpu); @@ -388,7 +388,7 @@ static void __cpuinit uncore_online(unsigned int cpu, cpumask_set_cpu(cpu, uncore->active_mask); } -static void __cpuinit amd_uncore_cpu_online(unsigned int cpu) +static void amd_uncore_cpu_online(unsigned int cpu) { if (amd_uncore_nb) uncore_online(cpu, amd_uncore_nb); @@ -397,7 +397,7 @@ static void __cpuinit amd_uncore_cpu_online(unsigned int cpu) uncore_online(cpu, amd_uncore_l2); } -static void __cpuinit uncore_down_prepare(unsigned int cpu, +static void uncore_down_prepare(unsigned int cpu, struct amd_uncore * __percpu *uncores) { unsigned int i; @@ -423,7 +423,7 @@ static void __cpuinit uncore_down_prepare(unsigned int cpu, } } -static void __cpuinit amd_uncore_cpu_down_prepare(unsigned int cpu) +static void amd_uncore_cpu_down_prepare(unsigned int cpu) { if (amd_uncore_nb) uncore_down_prepare(cpu, amd_uncore_nb); @@ -432,7 +432,7 @@ static void __cpuinit amd_uncore_cpu_down_prepare(unsigned int cpu) uncore_down_prepare(cpu, amd_uncore_l2); } -static void __cpuinit uncore_dead(unsigned int cpu, +static void uncore_dead(unsigned int cpu, struct amd_uncore * __percpu *uncores) { struct amd_uncore *uncore = *per_cpu_ptr(uncores, cpu); @@ -445,7 +445,7 @@ static void __cpuinit uncore_dead(unsigned int cpu, *per_cpu_ptr(amd_uncore_nb, cpu) = NULL; } -static void __cpuinit amd_uncore_cpu_dead(unsigned int cpu) +static void amd_uncore_cpu_dead(unsigned int cpu) { if (amd_uncore_nb) uncore_dead(cpu, amd_uncore_nb); @@ -454,7 +454,7 @@ static void __cpuinit amd_uncore_cpu_dead(unsigned int cpu) uncore_dead(cpu, amd_uncore_l2); } -static int __cpuinit +static int amd_uncore_cpu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) { @@ -489,7 +489,7 @@ amd_uncore_cpu_notifier(struct notifier_block *self, unsigned long action, return NOTIFY_OK; } -static struct notifier_block amd_uncore_cpu_notifier_block __cpuinitdata = { +static struct notifier_block amd_uncore_cpu_notifier_block = { .notifier_call = amd_uncore_cpu_notifier, .priority = CPU_PRI_PERF + 1, }; diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index 7185af255fb52..afaf184259b94 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c @@ -3311,7 +3311,7 @@ static void __init uncore_pci_exit(void) /* CPU hot plug/unplug are serialized by cpu_add_remove_lock mutex */ static LIST_HEAD(boxes_to_free); -static void __cpuinit uncore_kfree_boxes(void) +static void uncore_kfree_boxes(void) { struct intel_uncore_box *box; @@ -3323,7 +3323,7 @@ static void __cpuinit uncore_kfree_boxes(void) } } -static void __cpuinit uncore_cpu_dying(int cpu) +static void uncore_cpu_dying(int cpu) { struct intel_uncore_type *type; struct intel_uncore_pmu *pmu; @@ -3342,7 +3342,7 @@ static void __cpuinit uncore_cpu_dying(int cpu) } } -static int __cpuinit uncore_cpu_starting(int cpu) +static int uncore_cpu_starting(int cpu) { struct intel_uncore_type *type; struct intel_uncore_pmu *pmu; @@ -3385,7 +3385,7 @@ static int __cpuinit uncore_cpu_starting(int cpu) return 0; } -static int __cpuinit uncore_cpu_prepare(int cpu, int phys_id) +static int uncore_cpu_prepare(int cpu, int phys_id) { struct intel_uncore_type *type; struct intel_uncore_pmu *pmu; @@ -3411,7 +3411,7 @@ static int __cpuinit uncore_cpu_prepare(int cpu, int phys_id) return 0; } -static void __cpuinit +static void uncore_change_context(struct intel_uncore_type **uncores, int old_cpu, int new_cpu) { struct intel_uncore_type *type; @@ -3449,7 +3449,7 @@ uncore_change_context(struct intel_uncore_type **uncores, int old_cpu, int new_c } } -static void __cpuinit uncore_event_exit_cpu(int cpu) +static void uncore_event_exit_cpu(int cpu) { int i, phys_id, target; @@ -3477,7 +3477,7 @@ static void __cpuinit uncore_event_exit_cpu(int cpu) uncore_change_context(pci_uncores, cpu, target); } -static void __cpuinit uncore_event_init_cpu(int cpu) +static void uncore_event_init_cpu(int cpu) { int i, phys_id; @@ -3494,7 +3494,7 @@ static void __cpuinit uncore_event_init_cpu(int cpu) } static int - __cpuinit uncore_cpu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) + uncore_cpu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (long)hcpu; @@ -3534,7 +3534,7 @@ static int return NOTIFY_OK; } -static struct notifier_block uncore_cpu_nb __cpuinitdata = { +static struct notifier_block uncore_cpu_nb = { .notifier_call = uncore_cpu_notifier, /* * to migrate uncore events, our notifier should be executed diff --git a/arch/x86/kernel/cpu/rdrand.c b/arch/x86/kernel/cpu/rdrand.c index feca286c2bb4a..88db010845cb2 100644 --- a/arch/x86/kernel/cpu/rdrand.c +++ b/arch/x86/kernel/cpu/rdrand.c @@ -52,7 +52,7 @@ static inline int rdrand_long(unsigned long *v) */ #define RESEED_LOOP ((512*128)/sizeof(unsigned long)) -void __cpuinit x86_init_rdrand(struct cpuinfo_x86 *c) +void x86_init_rdrand(struct cpuinfo_x86 *c) { #ifdef CONFIG_ARCH_RANDOM unsigned long tmp; diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index d92b5dad15dd4..f2cc63e9cf08f 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -24,13 +24,13 @@ enum cpuid_regs { CR_EBX }; -void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) +void init_scattered_cpuid_features(struct cpuinfo_x86 *c) { u32 max_level; u32 regs[4]; const struct cpuid_bit *cb; - static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { + static const struct cpuid_bit cpuid_bits[] = { { X86_FEATURE_DTHERM, CR_EAX, 0, 0x00000006, 0 }, { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 }, { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 }, diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c index 4397e987a1cfb..4c60eaf0571c2 100644 --- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -26,7 +26,7 @@ * exists, use it for populating initial_apicid and cpu topology * detection. */ -void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) +void detect_extended_topology(struct cpuinfo_x86 *c) { #ifdef CONFIG_SMP unsigned int eax, ebx, ecx, edx, sub_index; diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c index 28000743bbb06..aa0430d69b900 100644 --- a/arch/x86/kernel/cpu/transmeta.c +++ b/arch/x86/kernel/cpu/transmeta.c @@ -5,7 +5,7 @@ #include #include "cpu.h" -static void __cpuinit early_init_transmeta(struct cpuinfo_x86 *c) +static void early_init_transmeta(struct cpuinfo_x86 *c) { u32 xlvl; @@ -17,7 +17,7 @@ static void __cpuinit early_init_transmeta(struct cpuinfo_x86 *c) } } -static void __cpuinit init_transmeta(struct cpuinfo_x86 *c) +static void init_transmeta(struct cpuinfo_x86 *c) { unsigned int cap_mask, uk, max, dummy; unsigned int cms_rev1, cms_rev2; @@ -98,7 +98,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c) #endif } -static const struct cpu_dev __cpuinitconst transmeta_cpu_dev = { +static const struct cpu_dev transmeta_cpu_dev = { .c_vendor = "Transmeta", .c_ident = { "GenuineTMx86", "TransmetaCPU" }, .c_early_init = early_init_transmeta, diff --git a/arch/x86/kernel/cpu/umc.c b/arch/x86/kernel/cpu/umc.c index fd2c37bf7acb6..202759a141212 100644 --- a/arch/x86/kernel/cpu/umc.c +++ b/arch/x86/kernel/cpu/umc.c @@ -8,7 +8,7 @@ * so no special init takes place. */ -static const struct cpu_dev __cpuinitconst umc_cpu_dev = { +static const struct cpu_dev umc_cpu_dev = { .c_vendor = "UMC", .c_ident = { "UMC UMC UMC" }, .c_models = { diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 03a36321ec544..7076878404ec0 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -122,7 +122,7 @@ static bool __init vmware_platform(void) * so that the kernel could just trust the hypervisor with providing a * reliable virtual TSC that is suitable for timekeeping. */ -static void __cpuinit vmware_set_cpu_features(struct cpuinfo_x86 *c) +static void vmware_set_cpu_features(struct cpuinfo_x86 *c) { set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE); diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index 1e4dbcfe6d316..563fea5fcba26 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c @@ -137,7 +137,7 @@ static const struct file_operations cpuid_fops = { .open = cpuid_open, }; -static __cpuinit int cpuid_device_create(int cpu) +static int cpuid_device_create(int cpu) { struct device *dev; @@ -151,7 +151,7 @@ static void cpuid_device_destroy(int cpu) device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu)); } -static int __cpuinit cpuid_class_cpu_callback(struct notifier_block *nfb, +static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 2fbad6b9f23c0..a4aad73cd57f3 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -132,7 +132,7 @@ static void x86_of_pci_irq_disable(struct pci_dev *dev) { } -void __cpuinit x86_of_pci_init(void) +void x86_of_pci_init(void) { pcibios_enable_irq = x86_of_pci_irq_enable; pcibios_disable_irq = x86_of_pci_irq_disable; diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index b03ff1842547a..e6f08c6853f7c 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c @@ -119,7 +119,7 @@ unsigned int xstate_size; EXPORT_SYMBOL_GPL(xstate_size); static struct i387_fxsave_struct fx_scratch __cpuinitdata; -static void __cpuinit mxcsr_feature_mask_init(void) +static void mxcsr_feature_mask_init(void) { unsigned long mask = 0; @@ -133,7 +133,7 @@ static void __cpuinit mxcsr_feature_mask_init(void) mxcsr_feature_mask &= mask; } -static void __cpuinit init_thread_xstate(void) +static void init_thread_xstate(void) { /* * Note that xstate_size might be overwriten later during @@ -162,7 +162,7 @@ static void __cpuinit init_thread_xstate(void) * into all processes. */ -void __cpuinit fpu_init(void) +void fpu_init(void) { unsigned long cr0; unsigned long cr4_mask = 0; diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index 344faf8d0d621..4186755f1d7cf 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -119,7 +119,7 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) /* * allocate per-cpu stacks for hardirq and for softirq processing */ -void __cpuinit irq_ctx_init(int cpu) +void irq_ctx_init(int cpu) { union irq_ctx *irqctx; diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index c4ff2a9161399..d561f0a5b33a9 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -327,7 +327,7 @@ static void kvm_guest_apic_eoi_write(u32 reg, u32 val) apic_write(APIC_EOI, APIC_EOI_ACK); } -void __cpuinit kvm_guest_cpu_init(void) +void kvm_guest_cpu_init(void) { if (!kvm_para_available()) return; @@ -428,7 +428,7 @@ static void __init kvm_smp_prepare_boot_cpu(void) native_smp_prepare_boot_cpu(); } -static void __cpuinit kvm_guest_cpu_online(void *dummy) +static void kvm_guest_cpu_online(void *dummy) { kvm_guest_cpu_init(); } @@ -442,7 +442,7 @@ static void kvm_guest_cpu_offline(void *dummy) apf_task_wake_all(); } -static int __cpuinit kvm_cpu_notify(struct notifier_block *self, +static int kvm_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { int cpu = (unsigned long)hcpu; @@ -462,7 +462,7 @@ static int __cpuinit kvm_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata kvm_cpu_notifier = { +static struct notifier_block kvm_cpu_notifier = { .notifier_call = kvm_cpu_notify, }; #endif diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 41514f56c2413..836c78b7ac1d0 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -185,7 +185,7 @@ static void kvm_restore_sched_clock_state(void) } #ifdef CONFIG_X86_LOCAL_APIC -static void __cpuinit kvm_setup_secondary_clock(void) +static void kvm_setup_secondary_clock(void) { /* * Now that the first cpu already had this clocksource initialized, diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index 22db92bbdf1a4..15c987698b0f7 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c @@ -468,7 +468,7 @@ static struct syscore_ops mc_syscore_ops = { .resume = mc_bp_resume, }; -static __cpuinit int +static int mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; diff --git a/arch/x86/kernel/microcode_core_early.c b/arch/x86/kernel/microcode_core_early.c index 833d51d6ee065..c97844e3aedbb 100644 --- a/arch/x86/kernel/microcode_core_early.c +++ b/arch/x86/kernel/microcode_core_early.c @@ -40,7 +40,7 @@ * * x86_vendor() gets vendor information directly through cpuid. */ -static int __cpuinit x86_vendor(void) +static int x86_vendor(void) { u32 eax = 0x00000000; u32 ebx, ecx = 0, edx; @@ -56,7 +56,7 @@ static int __cpuinit x86_vendor(void) return X86_VENDOR_UNKNOWN; } -static int __cpuinit x86_family(void) +static int x86_family(void) { u32 eax = 0x00000001; u32 ebx, ecx = 0, edx; @@ -85,7 +85,7 @@ void __init load_ucode_bsp(void) load_ucode_intel_bsp(); } -void __cpuinit load_ucode_ap(void) +void load_ucode_ap(void) { int vendor, x86; diff --git a/arch/x86/kernel/microcode_intel_early.c b/arch/x86/kernel/microcode_intel_early.c index a883942aee44a..a1f9ebf459165 100644 --- a/arch/x86/kernel/microcode_intel_early.c +++ b/arch/x86/kernel/microcode_intel_early.c @@ -34,7 +34,7 @@ struct mc_saved_data { struct microcode_intel **mc_saved; } mc_saved_data; -static enum ucode_state __cpuinit +static enum ucode_state generic_load_microcode_early(struct microcode_intel **mc_saved_p, unsigned int mc_saved_count, struct ucode_cpu_info *uci) @@ -69,7 +69,7 @@ generic_load_microcode_early(struct microcode_intel **mc_saved_p, return state; } -static void __cpuinit +static void microcode_pointer(struct microcode_intel **mc_saved, unsigned long *mc_saved_in_initrd, unsigned long initrd_start, int mc_saved_count) @@ -82,7 +82,7 @@ microcode_pointer(struct microcode_intel **mc_saved, } #ifdef CONFIG_X86_32 -static void __cpuinit +static void microcode_phys(struct microcode_intel **mc_saved_tmp, struct mc_saved_data *mc_saved_data) { @@ -101,7 +101,7 @@ microcode_phys(struct microcode_intel **mc_saved_tmp, } #endif -static enum ucode_state __cpuinit +static enum ucode_state load_microcode(struct mc_saved_data *mc_saved_data, unsigned long *mc_saved_in_initrd, unsigned long initrd_start, @@ -375,7 +375,7 @@ do { \ #define native_wrmsr(msr, low, high) \ native_write_msr(msr, low, high); -static int __cpuinit collect_cpu_info_early(struct ucode_cpu_info *uci) +static int collect_cpu_info_early(struct ucode_cpu_info *uci) { unsigned int val[2]; u8 x86, x86_model; @@ -584,7 +584,7 @@ scan_microcode(unsigned long start, unsigned long end, /* * Print ucode update info. */ -static void __cpuinit +static void print_ucode_info(struct ucode_cpu_info *uci, unsigned int date) { int cpu = smp_processor_id(); @@ -605,7 +605,7 @@ static int current_mc_date; /* * Print early updated ucode info after printk works. This is delayed info dump. */ -void __cpuinit show_ucode_info_early(void) +void show_ucode_info_early(void) { struct ucode_cpu_info uci; @@ -621,7 +621,7 @@ void __cpuinit show_ucode_info_early(void) * mc_saved_data.mc_saved and delay printing microcode info in * show_ucode_info_early() until printk() works. */ -static void __cpuinit print_ucode(struct ucode_cpu_info *uci) +static void print_ucode(struct ucode_cpu_info *uci) { struct microcode_intel *mc_intel; int *delay_ucode_info_p; @@ -643,12 +643,12 @@ static void __cpuinit print_ucode(struct ucode_cpu_info *uci) * Flush global tlb. We only do this in x86_64 where paging has been enabled * already and PGE should be enabled as well. */ -static inline void __cpuinit flush_tlb_early(void) +static inline void flush_tlb_early(void) { __native_flush_tlb_global_irq_disabled(); } -static inline void __cpuinit print_ucode(struct ucode_cpu_info *uci) +static inline void print_ucode(struct ucode_cpu_info *uci) { struct microcode_intel *mc_intel; @@ -660,7 +660,7 @@ static inline void __cpuinit print_ucode(struct ucode_cpu_info *uci) } #endif -static int __cpuinit apply_microcode_early(struct mc_saved_data *mc_saved_data, +static int apply_microcode_early(struct mc_saved_data *mc_saved_data, struct ucode_cpu_info *uci) { struct microcode_intel *mc_intel; @@ -763,7 +763,7 @@ load_ucode_intel_bsp(void) #endif } -void __cpuinit load_ucode_intel_ap(void) +void load_ucode_intel_ap(void) { struct mc_saved_data *mc_saved_data_p; struct ucode_cpu_info uci; diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c index ac861b8348e2d..33fd4e6407b7b 100644 --- a/arch/x86/kernel/mmconf-fam10h_64.c +++ b/arch/x86/kernel/mmconf-fam10h_64.c @@ -24,14 +24,14 @@ struct pci_hostbridge_probe { u32 device; }; -static u64 __cpuinitdata fam10h_pci_mmconf_base; +static u64 fam10h_pci_mmconf_base; -static struct pci_hostbridge_probe pci_probes[] __cpuinitdata = { +static struct pci_hostbridge_probe pci_probes[] = { { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1200 }, { 0xff, 0, PCI_VENDOR_ID_AMD, 0x1200 }, }; -static int __cpuinit cmp_range(const void *x1, const void *x2) +static int cmp_range(const void *x1, const void *x2) { const struct range *r1 = x1; const struct range *r2 = x2; @@ -49,7 +49,7 @@ static int __cpuinit cmp_range(const void *x1, const void *x2) /* need to avoid (0xfd<<32), (0xfe<<32), and (0xff<<32), ht used space */ #define FAM10H_PCI_MMCONF_BASE (0xfcULL<<32) #define BASE_VALID(b) ((b) + MMCONF_SIZE <= (0xfdULL<<32) || (b) >= (1ULL<<40)) -static void __cpuinit get_fam10h_pci_mmconf_base(void) +static void get_fam10h_pci_mmconf_base(void) { int i; unsigned bus; @@ -166,7 +166,7 @@ static void __cpuinit get_fam10h_pci_mmconf_base(void) fam10h_pci_mmconf_base = base; } -void __cpuinit fam10h_check_enable_mmcfg(void) +void fam10h_check_enable_mmcfg(void) { u64 val; u32 address; @@ -230,7 +230,7 @@ static const struct dmi_system_id __initconst mmconf_dmi_table[] = { {} }; -/* Called from a __cpuinit function, but only on the BSP. */ +/* Called from a function, but only on the BSP. */ void __ref check_enable_amd_mmconf_dmi(void) { dmi_check_system(mmconf_dmi_table); diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index ce130493b8020..6d9d08e443c57 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c @@ -200,7 +200,7 @@ static const struct file_operations msr_fops = { .compat_ioctl = msr_ioctl, }; -static int __cpuinit msr_device_create(int cpu) +static int msr_device_create(int cpu) { struct device *dev; @@ -214,7 +214,7 @@ static void msr_device_destroy(int cpu) device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); } -static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb, +static int msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 48f4399534361..3179fc1bfd970 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -385,7 +385,7 @@ static void amd_e400_idle(void) default_idle(); } -void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) +void select_idle_routine(const struct cpuinfo_x86 *c) { #ifdef CONFIG_SMP if (boot_option_idle_override == IDLE_POLL && smp_num_siblings > 1) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index a3627ade4b157..4576b37acf070 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -170,7 +170,7 @@ static struct resource bss_resource = { #ifdef CONFIG_X86_32 /* cpu data as detected by the assembly code in head.S */ -struct cpuinfo_x86 new_cpu_data __cpuinitdata = { +struct cpuinfo_x86 new_cpu_data = { .wp_works_ok = -1, }; /* common cpu data for all cpus */ diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 87084ab90d190..009e1adaf9073 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -130,7 +130,7 @@ atomic_t init_deasserted; * Report back to the Boot Processor during boot time or to the caller processor * during CPU online. */ -static void __cpuinit smp_callin(void) +static void smp_callin(void) { int cpuid, phys_id; unsigned long timeout; @@ -237,7 +237,7 @@ static int enable_start_cpu0; /* * Activate a secondary processor. */ -notrace static void __cpuinit start_secondary(void *unused) +notrace static void start_secondary(void *unused) { /* * Don't put *anything* before cpu_init(), SMP booting is too @@ -307,7 +307,7 @@ void __init smp_store_boot_cpu_info(void) * The bootstrap kernel entry code has set these up. Save them for * a given CPU */ -void __cpuinit smp_store_cpu_info(int id) +void smp_store_cpu_info(int id) { struct cpuinfo_x86 *c = &cpu_data(id); @@ -320,7 +320,7 @@ void __cpuinit smp_store_cpu_info(int id) identify_secondary_cpu(c); } -static bool __cpuinit +static bool topology_sane(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o, const char *name) { int cpu1 = c->cpu_index, cpu2 = o->cpu_index; @@ -337,7 +337,7 @@ do { \ cpumask_set_cpu((c2), cpu_##_m##_mask(c1)); \ } while (0) -static bool __cpuinit match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) +static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) { if (cpu_has_topoext) { int cpu1 = c->cpu_index, cpu2 = o->cpu_index; @@ -355,7 +355,7 @@ static bool __cpuinit match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) return false; } -static bool __cpuinit match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) +static bool match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) { int cpu1 = c->cpu_index, cpu2 = o->cpu_index; @@ -366,7 +366,7 @@ static bool __cpuinit match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) return false; } -static bool __cpuinit match_mc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) +static bool match_mc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) { if (c->phys_proc_id == o->phys_proc_id) { if (cpu_has(c, X86_FEATURE_AMD_DCM)) @@ -377,7 +377,7 @@ static bool __cpuinit match_mc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) return false; } -void __cpuinit set_cpu_sibling_map(int cpu) +void set_cpu_sibling_map(int cpu) { bool has_smt = smp_num_siblings > 1; bool has_mp = has_smt || boot_cpu_data.x86_max_cores > 1; @@ -506,7 +506,7 @@ void __inquire_remote_apic(int apicid) * INIT, INIT, STARTUP sequence will reset the chip hard for us, and this * won't ... remember to clear down the APIC, etc later. */ -int __cpuinit +int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip) { unsigned long send_status, accept_status = 0; @@ -540,7 +540,7 @@ wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip) return (send_status | accept_status); } -static int __cpuinit +static int wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) { unsigned long send_status, accept_status = 0; @@ -656,7 +656,7 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) } /* reduce the number of lines printed when booting a large cpu count system */ -static void __cpuinit announce_cpu(int cpu, int apicid) +static void announce_cpu(int cpu, int apicid) { static int current_node = -1; int node = early_cpu_to_node(cpu); @@ -698,7 +698,7 @@ static int wakeup_cpu0_nmi(unsigned int cmd, struct pt_regs *regs) * We'll change this code in the future to wake up hard offlined CPU0 if * real platform and request are available. */ -static int __cpuinit +static int wakeup_cpu_via_init_nmi(int cpu, unsigned long start_ip, int apicid, int *cpu0_nmi_registered) { @@ -738,7 +738,7 @@ wakeup_cpu_via_init_nmi(int cpu, unsigned long start_ip, int apicid, * Returns zero if CPU booted OK, else error code from * ->wakeup_secondary_cpu. */ -static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle) +static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle) { volatile u32 *trampoline_status = (volatile u32 *) __va(real_mode_header->trampoline_status); @@ -879,7 +879,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle) return boot_error; } -int __cpuinit native_cpu_up(unsigned int cpu, struct task_struct *tidle) +int native_cpu_up(unsigned int cpu, struct task_struct *tidle) { int apicid = apic->cpu_present_to_apicid(cpu); unsigned long flags; diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c index f84fe00fad48a..68e8057f03c6b 100644 --- a/arch/x86/kernel/tboot.c +++ b/arch/x86/kernel/tboot.c @@ -319,7 +319,7 @@ static int tboot_wait_for_aps(int num_aps) return !(atomic_read((atomic_t *)&tboot->num_in_wfs) == num_aps); } -static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb, +static int tboot_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { switch (action) { @@ -333,7 +333,7 @@ static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block tboot_cpu_notifier __cpuinitdata = +static struct notifier_block tboot_cpu_notifier = { .notifier_call = tboot_cpu_callback, }; diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 27e3a14fc917b..04ed4deecfbf2 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -824,7 +824,7 @@ static void __init check_system_tsc_reliable(void) * Make an educated guess if the TSC is trustworthy and synchronized * over all CPUs. */ -__cpuinit int unsynchronized_tsc(void) +int unsynchronized_tsc(void) { if (!cpu_has_tsc || tsc_unstable) return 1; @@ -1023,7 +1023,7 @@ void __init tsc_init(void) * been calibrated. This assumes that CONSTANT_TSC applies to all * cpus in the socket - this should be a safe assumption. */ -unsigned long __cpuinit calibrate_delay_is_known(void) +unsigned long calibrate_delay_is_known(void) { int i, cpu = smp_processor_id(); diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index fc25e60a58845..adfdf56a3714e 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c @@ -25,24 +25,24 @@ * Entry/exit counters that make sure that both CPUs * run the measurement code at once: */ -static __cpuinitdata atomic_t start_count; -static __cpuinitdata atomic_t stop_count; +static atomic_t start_count; +static atomic_t stop_count; /* * We use a raw spinlock in this exceptional case, because * we want to have the fastest, inlined, non-debug version * of a critical section, to be able to prove TSC time-warps: */ -static __cpuinitdata arch_spinlock_t sync_lock = __ARCH_SPIN_LOCK_UNLOCKED; +static arch_spinlock_t sync_lock = __ARCH_SPIN_LOCK_UNLOCKED; -static __cpuinitdata cycles_t last_tsc; -static __cpuinitdata cycles_t max_warp; -static __cpuinitdata int nr_warps; +static cycles_t last_tsc; +static cycles_t max_warp; +static int nr_warps; /* * TSC-warp measurement loop running on both CPUs: */ -static __cpuinit void check_tsc_warp(unsigned int timeout) +static void check_tsc_warp(unsigned int timeout) { cycles_t start, now, prev, end; int i; @@ -121,7 +121,7 @@ static inline unsigned int loop_timeout(int cpu) * Source CPU calls into this - it waits for the freshly booted * target CPU to arrive and then starts the measurement: */ -void __cpuinit check_tsc_sync_source(int cpu) +void check_tsc_sync_source(int cpu) { int cpus = 2; @@ -187,7 +187,7 @@ void __cpuinit check_tsc_sync_source(int cpu) /* * Freshly booted CPUs call into this: */ -void __cpuinit check_tsc_sync_target(void) +void check_tsc_sync_target(void) { int cpus = 2; diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index c52c07efe970a..09ce23ae370cc 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c @@ -331,7 +331,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) * Assume __initcall executes before all user space. Hopefully kmod * doesn't violate that. We'll find out if it does. */ -static void __cpuinit vsyscall_set_cpu(int cpu) +static void vsyscall_set_cpu(int cpu) { unsigned long d; unsigned long node = 0; @@ -353,13 +353,13 @@ static void __cpuinit vsyscall_set_cpu(int cpu) write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S); } -static void __cpuinit cpu_vsyscall_init(void *arg) +static void cpu_vsyscall_init(void *arg) { /* preemption should be already off */ vsyscall_set_cpu(raw_smp_processor_id()); } -static int __cpuinit +static int cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg) { long cpu = (long)arg; diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 45a14dbbddafe..5f24c71accaaf 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -25,7 +25,7 @@ #include #include -void __cpuinit x86_init_noop(void) { } +void x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } @@ -85,7 +85,7 @@ struct x86_init_ops x86_init __initdata = { }, }; -struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { +struct x86_cpuinit_ops x86_cpuinit = { .early_percpu_clock_init = x86_init_noop, .setup_percpu_clockev = setup_secondary_APIC_clock, }; diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index 92f37e7683c50..7ed034752e934 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c @@ -576,7 +576,7 @@ static void __init xstate_enable_boot_cpu(void) * This is somewhat obfuscated due to the lack of powerful enough * overrides for the section checks. */ -void __cpuinit xsave_init(void) +void xsave_init(void) { static __refdata void (*next_func)(void) = xstate_enable_boot_cpu; void (*this_func)(void); @@ -597,7 +597,7 @@ static inline void __init eager_fpu_init_bp(void) setup_init_fpu_buf(); } -void __cpuinit eager_fpu_init(void) +void eager_fpu_init(void) { static __refdata void (*boot_func)(void) = eager_fpu_init_bp; diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index a71c4e207679a..8bf93bae1f13f 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -60,7 +60,7 @@ s16 __apicid_to_node[MAX_LOCAL_APIC] = { [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE }; -int __cpuinit numa_cpu_node(int cpu) +int numa_cpu_node(int cpu) { int apicid = early_per_cpu(x86_cpu_to_apicid, cpu); @@ -691,12 +691,12 @@ void __init init_cpu_to_node(void) #ifndef CONFIG_DEBUG_PER_CPU_MAPS # ifndef CONFIG_NUMA_EMU -void __cpuinit numa_add_cpu(int cpu) +void numa_add_cpu(int cpu) { cpumask_set_cpu(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]); } -void __cpuinit numa_remove_cpu(int cpu) +void numa_remove_cpu(int cpu) { cpumask_clear_cpu(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]); } @@ -763,17 +763,17 @@ void debug_cpumask_set_cpu(int cpu, int node, bool enable) } # ifndef CONFIG_NUMA_EMU -static void __cpuinit numa_set_cpumask(int cpu, bool enable) +static void numa_set_cpumask(int cpu, bool enable) { debug_cpumask_set_cpu(cpu, early_cpu_to_node(cpu), enable); } -void __cpuinit numa_add_cpu(int cpu) +void numa_add_cpu(int cpu) { numa_set_cpumask(cpu, true); } -void __cpuinit numa_remove_cpu(int cpu) +void numa_remove_cpu(int cpu) { numa_set_cpumask(cpu, false); } diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c index dbbbb47260ccc..67c2d21b800b9 100644 --- a/arch/x86/mm/numa_emulation.c +++ b/arch/x86/mm/numa_emulation.c @@ -444,7 +444,7 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) } #ifndef CONFIG_DEBUG_PER_CPU_MAPS -void __cpuinit numa_add_cpu(int cpu) +void numa_add_cpu(int cpu) { int physnid, nid; @@ -462,7 +462,7 @@ void __cpuinit numa_add_cpu(int cpu) cpumask_set_cpu(cpu, node_to_cpumask_map[nid]); } -void __cpuinit numa_remove_cpu(int cpu) +void numa_remove_cpu(int cpu) { int i; @@ -470,7 +470,7 @@ void __cpuinit numa_remove_cpu(int cpu) cpumask_clear_cpu(cpu, node_to_cpumask_map[i]); } #else /* !CONFIG_DEBUG_PER_CPU_MAPS */ -static void __cpuinit numa_set_cpumask(int cpu, bool enable) +static void numa_set_cpumask(int cpu, bool enable) { int nid, physnid; @@ -490,12 +490,12 @@ static void __cpuinit numa_set_cpumask(int cpu, bool enable) } } -void __cpuinit numa_add_cpu(int cpu) +void numa_add_cpu(int cpu) { numa_set_cpumask(cpu, true); } -void __cpuinit numa_remove_cpu(int cpu) +void numa_remove_cpu(int cpu) { numa_set_cpumask(cpu, false); } diff --git a/arch/x86/mm/setup_nx.c b/arch/x86/mm/setup_nx.c index 410531d3c292d..da23af2868821 100644 --- a/arch/x86/mm/setup_nx.c +++ b/arch/x86/mm/setup_nx.c @@ -29,7 +29,7 @@ static int __init noexec_setup(char *str) } early_param("noexec", noexec_setup); -void __cpuinit x86_configure_nx(void) +void x86_configure_nx(void) { if (cpu_has_nx && !disable_nx) __supported_pte_mask |= _PAGE_NX; diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c index e9e6ed5cdf946..a0077b78ae86c 100644 --- a/arch/x86/pci/amd_bus.c +++ b/arch/x86/pci/amd_bus.c @@ -312,7 +312,7 @@ static int __init early_fill_mp_bus_info(void) #define ENABLE_CF8_EXT_CFG (1ULL << 46) -static void __cpuinit enable_pci_io_ecs(void *unused) +static void enable_pci_io_ecs(void *unused) { u64 reg; rdmsrl(MSR_AMD64_NB_CFG, reg); @@ -322,7 +322,7 @@ static void __cpuinit enable_pci_io_ecs(void *unused) } } -static int __cpuinit amd_cpu_notify(struct notifier_block *self, +static int amd_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { int cpu = (long)hcpu; @@ -337,7 +337,7 @@ static int __cpuinit amd_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata amd_cpu_notifier = { +static struct notifier_block amd_cpu_notifier = { .notifier_call = amd_cpu_notify, }; diff --git a/arch/x86/platform/ce4100/ce4100.c b/arch/x86/platform/ce4100/ce4100.c index f8ab4945892ee..baec704231b31 100644 --- a/arch/x86/platform/ce4100/ce4100.c +++ b/arch/x86/platform/ce4100/ce4100.c @@ -134,7 +134,7 @@ static void __init sdv_arch_setup(void) } #ifdef CONFIG_X86_IO_APIC -static void __cpuinit sdv_pci_init(void) +static void sdv_pci_init(void) { x86_of_pci_init(); /* We can't set this earlier, because we need to calibrate the timer */ diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index a0a0a4389bbd9..47fe66fe61f12 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c @@ -65,7 +65,7 @@ * lapic (always-on,ARAT) ------ 150 */ -__cpuinitdata enum mrst_timer_options mrst_timer_options; +enum mrst_timer_options mrst_timer_options; static u32 sfi_mtimer_usage[SFI_MTMR_MAX_NUM]; static struct sfi_timer_table_entry sfi_mtimer_array[SFI_MTMR_MAX_NUM]; @@ -248,7 +248,7 @@ static void __init mrst_time_init(void) apbt_time_init(); } -static void __cpuinit mrst_arch_setup(void) +static void mrst_arch_setup(void) { if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27) __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index a492be2635ac0..53b05d261e9c9 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -1681,7 +1681,7 @@ static void __init init_hvm_pv_info(void) xen_domain_type = XEN_HVM_DOMAIN; } -static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, +static int xen_hvm_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { int cpu = (long)hcpu; @@ -1700,7 +1700,7 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block xen_hvm_cpu_notifier __cpuinitdata = { +static struct notifier_block xen_hvm_cpu_notifier = { .notifier_call = xen_hvm_cpu_notify, }; diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 0a9fb7a0b4521..8f3eea6b80c52 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -497,7 +497,7 @@ static void __init fiddle_vdso(void) #endif } -static int __cpuinit register_callback(unsigned type, const void *func) +static int register_callback(unsigned type, const void *func) { struct callback_register callback = { .type = type, @@ -508,7 +508,7 @@ static int __cpuinit register_callback(unsigned type, const void *func) return HYPERVISOR_callback_op(CALLBACKOP_register, &callback); } -void __cpuinit xen_enable_sysenter(void) +void xen_enable_sysenter(void) { int ret; unsigned sysenter_feature; @@ -527,7 +527,7 @@ void __cpuinit xen_enable_sysenter(void) setup_clear_cpu_cap(sysenter_feature); } -void __cpuinit xen_enable_syscall(void) +void xen_enable_syscall(void) { #ifdef CONFIG_X86_64 int ret; diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 570c9a5c4d3f6..bee9e9b9cb4c0 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -61,7 +61,7 @@ static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static void __cpuinit cpu_bringup(void) +static void cpu_bringup(void) { int cpu; @@ -93,7 +93,7 @@ static void __cpuinit cpu_bringup(void) wmb(); /* make sure everything is out */ } -static void __cpuinit cpu_bringup_and_idle(void) +static void cpu_bringup_and_idle(void) { cpu_bringup(); cpu_startup_entry(CPUHP_ONLINE); @@ -303,7 +303,7 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) set_cpu_present(cpu, true); } -static int __cpuinit +static int cpu_initialize_context(unsigned int cpu, struct task_struct *idle) { struct vcpu_guest_context *ctxt; @@ -374,7 +374,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle) return 0; } -static int __cpuinit xen_cpu_up(unsigned int cpu, struct task_struct *idle) +static int xen_cpu_up(unsigned int cpu, struct task_struct *idle) { int rc; @@ -452,7 +452,7 @@ static void xen_cpu_die(unsigned int cpu) xen_teardown_timer(cpu); } -static void __cpuinit xen_play_dead(void) /* used only with HOTPLUG_CPU */ +static void xen_play_dead(void) /* used only with HOTPLUG_CPU */ { play_dead_common(); HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL); @@ -673,7 +673,7 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus) xen_init_lock_cpu(0); } -static int __cpuinit xen_hvm_cpu_up(unsigned int cpu, struct task_struct *tidle) +static int xen_hvm_cpu_up(unsigned int cpu, struct task_struct *tidle) { int rc; /* diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c index 3002ec1bb71a2..9553b2b917363 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c @@ -359,7 +359,7 @@ static irqreturn_t dummy_handler(int irq, void *dev_id) return IRQ_HANDLED; } -void __cpuinit xen_init_lock_cpu(int cpu) +void xen_init_lock_cpu(int cpu) { int irq; const char *name; diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index a95b41744ad0b..86782c5d7e2a6 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -73,7 +73,7 @@ static inline void xen_hvm_smp_init(void) {} #ifdef CONFIG_PARAVIRT_SPINLOCKS void __init xen_init_spinlocks(void); -void __cpuinit xen_init_lock_cpu(int cpu); +void xen_init_lock_cpu(int cpu); void xen_uninit_lock_cpu(int cpu); #else static inline void xen_init_spinlocks(void) diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index ffb4741043116..f1818db1d9882 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c @@ -109,7 +109,7 @@ irqreturn_t timer_interrupt (int irq, void *dev_id) } #ifndef CONFIG_GENERIC_CALIBRATE_DELAY -void __cpuinit calibrate_delay(void) +void calibrate_delay(void) { loops_per_jiffy = CCOUNT_PER_JIFFY; printk("Calibrating delay loop (skipped)... " diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c index 2d4d8d5674412..5b9432264e69a 100644 --- a/block/blk-iopoll.c +++ b/block/blk-iopoll.c @@ -189,7 +189,7 @@ void blk_iopoll_init(struct blk_iopoll *iop, int weight, blk_iopoll_fn *poll_fn) } EXPORT_SYMBOL(blk_iopoll_init); -static int __cpuinit blk_iopoll_cpu_notify(struct notifier_block *self, +static int blk_iopoll_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { /* @@ -209,7 +209,7 @@ static int __cpuinit blk_iopoll_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata blk_iopoll_cpu_notifier = { +static struct notifier_block blk_iopoll_cpu_notifier = { .notifier_call = blk_iopoll_cpu_notify, }; diff --git a/block/blk-softirq.c b/block/blk-softirq.c index 2b01c0b739848..76b9d2f7cc133 100644 --- a/block/blk-softirq.c +++ b/block/blk-softirq.c @@ -78,7 +78,7 @@ static int raise_blk_irq(int cpu, struct request *rq) } #endif -static int __cpuinit blk_cpu_notify(struct notifier_block *self, +static int blk_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { /* @@ -98,7 +98,7 @@ static int __cpuinit blk_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata blk_cpu_notifier = { +static struct notifier_block blk_cpu_notifier = { .notifier_call = blk_cpu_notify, }; diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 164d49569aebf..a5e9f4a5b2816 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -253,7 +253,7 @@ static bool __init processor_physically_present(acpi_handle handle) return true; } -static void __cpuinit acpi_set_pdc_bits(u32 *buf) +static void acpi_set_pdc_bits(u32 *buf) { buf[0] = ACPI_PDC_REVISION_ID; buf[1] = 1; @@ -265,7 +265,7 @@ static void __cpuinit acpi_set_pdc_bits(u32 *buf) arch_acpi_set_pdc_bits(buf); } -static struct acpi_object_list *__cpuinit acpi_processor_alloc_pdc(void) +static struct acpi_object_list *acpi_processor_alloc_pdc(void) { struct acpi_object_list *obj_list; union acpi_object *obj; @@ -308,7 +308,7 @@ static struct acpi_object_list *__cpuinit acpi_processor_alloc_pdc(void) * _PDC is required for a BIOS-OS handshake for most of the newer * ACPI processor features. */ -static int __cpuinit +static int acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) { acpi_status status = AE_OK; @@ -336,7 +336,7 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) return status; } -void __cpuinit acpi_processor_set_pdc(acpi_handle handle) +void acpi_processor_set_pdc(acpi_handle handle) { struct acpi_object_list *obj_list; diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index c266cdc117840..3efb90bb0f90c 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -461,7 +461,7 @@ static struct notifier_block acpi_cpu_notifier = * acpi_cpu_soft_notify(). Getting it __cpuinit{data} is difficult, the * root cause seem to be that acpi_processor_uninstall_hotplug_notify() * is in the module_exit (__exit) func. Allowing acpi_processor_start() - * to not be in __cpuinit section, but being called from __cpuinit funcs + * to not be in section, but being called from funcs * via __ref looks like the right thing to do here. */ static __ref int acpi_processor_start(struct acpi_processor *pr) @@ -524,7 +524,7 @@ static __ref int acpi_processor_start(struct acpi_processor *pr) * (cpu_data(cpu)) values, like CPU feature flags, family, model, etc. * Such things have to be put in and set up above in acpi_processor_start() */ -static int __cpuinit acpi_processor_add(struct acpi_device *device) +static int acpi_processor_add(struct acpi_device *device) { struct acpi_processor *pr = NULL; int result = 0; diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index c991fe680e589..1b8ade5ad3801 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -98,7 +98,7 @@ static int set_max_cstate(const struct dmi_system_id *id) /* Actually this shouldn't be __cpuinitdata, would be better to fix the callers to only run once -AK */ -static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = { +static struct dmi_system_id processor_power_dmi_table[] = { { set_max_cstate, "Clevo 5600D", { DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")}, @@ -1139,7 +1139,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) static int acpi_processor_registered; -int __cpuinit acpi_processor_power_init(struct acpi_processor *pr) +int acpi_processor_power_init(struct acpi_processor *pr) { acpi_status status = 0; int retval; diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index d5963ed5e5b13..821b91af9207c 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -87,7 +87,7 @@ static ssize_t __ref store_online(struct device *dev, } static DEVICE_ATTR(online, 0644, show_online, store_online); -static void __cpuinit register_cpu_control(struct cpu *cpu) +static void register_cpu_control(struct cpu *cpu) { device_create_file(&cpu->dev, &dev_attr_online); } @@ -465,7 +465,7 @@ static int cpu_uevent(struct device *dev, struct kobj_uevent_env *env) * * Initialize and register the CPU device. */ -int __cpuinit register_cpu(struct cpu *cpu, int num) +int register_cpu(struct cpu *cpu, int num) { int error; diff --git a/drivers/base/topology.c b/drivers/base/topology.c index 1eeb5f0048810..e4306a834b2e1 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c @@ -142,21 +142,21 @@ static struct attribute_group topology_attr_group = { }; /* Add/Remove cpu_topology interface for CPU device */ -static int __cpuinit topology_add_dev(unsigned int cpu) +static int topology_add_dev(unsigned int cpu) { struct device *dev = get_cpu_device(cpu); return sysfs_create_group(&dev->kobj, &topology_attr_group); } -static void __cpuinit topology_remove_dev(unsigned int cpu) +static void topology_remove_dev(unsigned int cpu) { struct device *dev = get_cpu_device(cpu); sysfs_remove_group(&dev->kobj, &topology_attr_group); } -static int __cpuinit topology_cpu_callback(struct notifier_block *nfb, +static int topology_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -177,7 +177,7 @@ static int __cpuinit topology_cpu_callback(struct notifier_block *nfb, return notifier_from_errno(rc); } -static int __cpuinit topology_sysfs_init(void) +static int topology_sysfs_init(void) { int cpu; int rc = 0; diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 1bdf38aab486f..dccb7e0c97e11 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -268,7 +268,7 @@ static int arch_timer_set_next_event_phys_mem(unsigned long evt, return 0; } -static void __cpuinit __arch_timer_setup(unsigned type, +static void __arch_timer_setup(unsigned type, struct clock_event_device *clk) { clk->features = CLOCK_EVT_FEAT_ONESHOT; @@ -499,7 +499,7 @@ static void __init arch_counter_register(unsigned type) sched_clock_register(arch_timer_read_counter, 56, arch_timer_rate); } -static void __cpuinit arch_timer_stop(struct clock_event_device *clk) +static void arch_timer_stop(struct clock_event_device *clk) { pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n", clk->irq, smp_processor_id()); @@ -515,7 +515,7 @@ static void __cpuinit arch_timer_stop(struct clock_event_device *clk) clk->set_mode(CLOCK_EVT_MODE_UNUSED, clk); } -static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, +static int arch_timer_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { /* @@ -534,7 +534,7 @@ static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { +static struct notifier_block arch_timer_cpu_nb = { .notifier_call = arch_timer_cpu_notify, }; diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 3dfa3e5e3705e..7b98e6472631e 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -412,7 +412,7 @@ static struct irqaction mct_tick1_event_irq = { .handler = exynos4_mct_tick_isr, }; -static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt) +static int exynos4_local_timer_setup(struct clock_event_device *evt) { struct mct_clock_event_device *mevt; unsigned int cpu = smp_processor_id(); @@ -465,7 +465,7 @@ static void exynos4_local_timer_stop(struct clock_event_device *evt) disable_percpu_irq(mct_irqs[MCT_L0_IRQ]); } -static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = { +static struct local_timer_ops exynos4_mct_tick_ops = { .setup = exynos4_local_timer_setup, .stop = exynos4_local_timer_stop, }; diff --git a/drivers/clocksource/metag_generic.c b/drivers/clocksource/metag_generic.c index ade7513a11d1d..05ccb99acf3ef 100644 --- a/drivers/clocksource/metag_generic.c +++ b/drivers/clocksource/metag_generic.c @@ -109,7 +109,7 @@ unsigned long long sched_clock(void) return ticks << HARDWARE_TO_NS_SHIFT; } -static void __cpuinit arch_timer_setup(unsigned int cpu) +static void arch_timer_setup(unsigned int cpu) { unsigned int txdivtime; struct clock_event_device *clk = &per_cpu(local_clockevent, cpu); @@ -154,7 +154,7 @@ static void __cpuinit arch_timer_setup(unsigned int cpu) } } -static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, +static int arch_timer_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { int cpu = (long)hcpu; @@ -169,7 +169,7 @@ static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata arch_timer_cpu_nb = { +static struct notifier_block arch_timer_cpu_nb = { .notifier_call = arch_timer_cpu_notify, }; diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c index efdca3263afef..1b04b7e1d39b9 100644 --- a/drivers/clocksource/time-armada-370-xp.c +++ b/drivers/clocksource/time-armada-370-xp.c @@ -167,7 +167,7 @@ static irqreturn_t armada_370_xp_timer_interrupt(int irq, void *dev_id) /* * Setup the local clock events for a CPU. */ -static int __cpuinit armada_370_xp_timer_setup(struct clock_event_device *evt) +static int armada_370_xp_timer_setup(struct clock_event_device *evt) { u32 u; int cpu = smp_processor_id(); @@ -205,7 +205,7 @@ static void armada_370_xp_timer_stop(struct clock_event_device *evt) disable_percpu_irq(evt->irq); } -static struct local_timer_ops armada_370_xp_local_timer_ops __cpuinitdata = { +static struct local_timer_ops armada_370_xp_local_timer_ops = { .setup = armada_370_xp_timer_setup, .stop = armada_370_xp_timer_stop, }; diff --git a/drivers/clocksource/timer-marco.c b/drivers/clocksource/timer-marco.c index e5dc9129ca263..62876baa3ab9c 100644 --- a/drivers/clocksource/timer-marco.c +++ b/drivers/clocksource/timer-marco.c @@ -184,7 +184,7 @@ static struct irqaction sirfsoc_timer1_irq = { .handler = sirfsoc_timer_interrupt, }; -static int __cpuinit sirfsoc_local_timer_setup(struct clock_event_device *ce) +static int sirfsoc_local_timer_setup(struct clock_event_device *ce) { /* Use existing clock_event for cpu 0 */ if (!smp_processor_id()) @@ -216,7 +216,7 @@ static void sirfsoc_local_timer_stop(struct clock_event_device *ce) remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq); } -static struct local_timer_ops sirfsoc_local_timer_ops __cpuinitdata = { +static struct local_timer_ops sirfsoc_local_timer_ops = { .setup = sirfsoc_local_timer_setup, .stop = sirfsoc_local_timer_stop, }; diff --git a/drivers/cpufreq/cpufreq_persistent_stats.c b/drivers/cpufreq/cpufreq_persistent_stats.c index 0b2ded84e17b8..dbd86f30a49f1 100644 --- a/drivers/cpufreq/cpufreq_persistent_stats.c +++ b/drivers/cpufreq/cpufreq_persistent_stats.c @@ -268,7 +268,7 @@ static int cpufreq_stat_notifier_trans(struct notifier_block *nb, return 0; } -static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb, +static int cpufreq_stat_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 0cf25101b3c3e..9f8ac97e78be9 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -195,7 +195,7 @@ struct tjmax { int tjmax; }; -static const struct tjmax __cpuinitconst tjmax_table[] = { +static const struct tjmax tjmax_table[] = { { "CPU 230", 100000 }, /* Model 0x1c, stepping 2 */ { "CPU 330", 125000 }, /* Model 0x1c, stepping 2 */ { "CPU CE4110", 110000 }, /* Model 0x1c, stepping 10 Sodaville */ @@ -211,7 +211,7 @@ struct tjmax_model { #define ANY 0xff -static const struct tjmax_model __cpuinitconst tjmax_model_table[] = { +static const struct tjmax_model tjmax_model_table[] = { { 0x1c, 10, 100000 }, /* D4xx, K4xx, N4xx, D5xx, K5xx, N5xx */ { 0x1c, ANY, 90000 }, /* Z5xx, N2xx, possibly others * Note: Also matches 230 and 330, @@ -226,7 +226,7 @@ static const struct tjmax_model __cpuinitconst tjmax_model_table[] = { { 0x36, ANY, 100000 }, /* Atom Cedar Trail/Cedarview (N2xxx, D2xxx) */ }; -static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, +static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) { /* The 100C is default for both mobile and non mobile CPUs */ @@ -317,7 +317,7 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, return tjmax; } -static int __cpuinit get_tjmax(struct cpuinfo_x86 *c, u32 id, +static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) { int err; @@ -367,7 +367,7 @@ static int create_name_attr(struct platform_data *pdata, return device_create_file(dev, &pdata->name_attr); } -static int __cpuinit create_core_attrs(struct temp_data *tdata, +static int create_core_attrs(struct temp_data *tdata, struct device *dev, int attr_no) { int err, i; @@ -401,7 +401,7 @@ static int __cpuinit create_core_attrs(struct temp_data *tdata, } -static int __cpuinit chk_ucode_version(unsigned int cpu) +static int chk_ucode_version(unsigned int cpu) { struct cpuinfo_x86 *c = &cpu_data(cpu); @@ -417,7 +417,7 @@ static int __cpuinit chk_ucode_version(unsigned int cpu) return 0; } -static struct platform_device __cpuinit *coretemp_get_pdev(unsigned int cpu) +static struct platform_device *coretemp_get_pdev(unsigned int cpu) { u16 phys_proc_id = TO_PHYS_ID(cpu); struct pdev_entry *p; @@ -434,7 +434,7 @@ static struct platform_device __cpuinit *coretemp_get_pdev(unsigned int cpu) return NULL; } -static struct temp_data __cpuinit *init_temp_data(unsigned int cpu, +static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag) { struct temp_data *tdata; @@ -453,7 +453,7 @@ static struct temp_data __cpuinit *init_temp_data(unsigned int cpu, return tdata; } -static int __cpuinit create_core_data(struct platform_device *pdev, +static int create_core_data(struct platform_device *pdev, unsigned int cpu, int pkg_flag) { struct temp_data *tdata; @@ -524,7 +524,7 @@ static int __cpuinit create_core_data(struct platform_device *pdev, return err; } -static void __cpuinit coretemp_add_core(unsigned int cpu, int pkg_flag) +static void coretemp_add_core(unsigned int cpu, int pkg_flag) { struct platform_device *pdev = coretemp_get_pdev(cpu); int err; @@ -609,7 +609,7 @@ static struct platform_driver coretemp_driver = { .remove = coretemp_remove, }; -static int __cpuinit coretemp_device_add(unsigned int cpu) +static int coretemp_device_add(unsigned int cpu) { int err; struct platform_device *pdev; @@ -653,7 +653,7 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) return err; } -static void __cpuinit coretemp_device_remove(unsigned int cpu) +static void coretemp_device_remove(unsigned int cpu) { struct pdev_entry *p, *n; u16 phys_proc_id = TO_PHYS_ID(cpu); @@ -669,7 +669,7 @@ static void __cpuinit coretemp_device_remove(unsigned int cpu) mutex_unlock(&pdev_list_mutex); } -static bool __cpuinit is_any_core_online(struct platform_data *pdata) +static bool is_any_core_online(struct platform_data *pdata) { int i; @@ -683,7 +683,7 @@ static bool __cpuinit is_any_core_online(struct platform_data *pdata) return false; } -static void __cpuinit get_core_online(unsigned int cpu) +static void get_core_online(unsigned int cpu) { struct cpuinfo_x86 *c = &cpu_data(cpu); struct platform_device *pdev = coretemp_get_pdev(cpu); @@ -725,7 +725,7 @@ static void __cpuinit get_core_online(unsigned int cpu) coretemp_add_core(cpu, 0); } -static void __cpuinit put_core_offline(unsigned int cpu) +static void put_core_offline(unsigned int cpu) { int i, indx; struct platform_data *pdata; @@ -773,7 +773,7 @@ static void __cpuinit put_core_offline(unsigned int cpu) coretemp_device_remove(cpu); } -static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb, +static int coretemp_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long) hcpu; diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c index 76f157b568ed7..65edf7da86edb 100644 --- a/drivers/hwmon/via-cputemp.c +++ b/drivers/hwmon/via-cputemp.c @@ -221,7 +221,7 @@ struct pdev_entry { static LIST_HEAD(pdev_list); static DEFINE_MUTEX(pdev_list_mutex); -static int __cpuinit via_cputemp_device_add(unsigned int cpu) +static int via_cputemp_device_add(unsigned int cpu) { int err; struct platform_device *pdev; @@ -262,7 +262,7 @@ static int __cpuinit via_cputemp_device_add(unsigned int cpu) return err; } -static void __cpuinit via_cputemp_device_remove(unsigned int cpu) +static void via_cputemp_device_remove(unsigned int cpu) { struct pdev_entry *p; @@ -279,7 +279,7 @@ static void __cpuinit via_cputemp_device_remove(unsigned int cpu) mutex_unlock(&pdev_list_mutex); } -static int __cpuinit via_cputemp_cpu_callback(struct notifier_block *nfb, +static int via_cputemp_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long) hcpu; diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index f26ff9e9a55fd..e5ca0fbd41028 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -630,7 +630,7 @@ static void __init gic_dist_init(struct gic_chip_data *gic) mb(); } -static void __cpuinit gic_cpu_init(struct gic_chip_data *gic) +static void gic_cpu_init(struct gic_chip_data *gic) { void __iomem *dist_base = gic_data_dist_base(gic); void __iomem *base = gic_data_cpu_base(gic); @@ -990,7 +990,7 @@ static int gic_irq_domain_xlate(struct irq_domain *d, } #ifdef CONFIG_SMP -static int __cpuinit gic_secondary_init(struct notifier_block *nfb, +static int gic_secondary_init(struct notifier_block *nfb, unsigned long action, void *hcpu) { if (action == CPU_STARTING || action == CPU_STARTING_FROZEN) @@ -1002,7 +1002,7 @@ static int __cpuinit gic_secondary_init(struct notifier_block *nfb, * Notifier for enabling the GIC CPU interface. Set an arbitrarily high * priority because the GIC needs to be up before the ARM generic timers. */ -static struct notifier_block __cpuinitdata gic_cpu_notifier = { +static struct notifier_block gic_cpu_notifier = { .notifier_call = gic_secondary_init, .priority = 100, }; diff --git a/drivers/oprofile/timer_int.c b/drivers/oprofile/timer_int.c index 93404f72dfa81..235659af2c425 100644 --- a/drivers/oprofile/timer_int.c +++ b/drivers/oprofile/timer_int.c @@ -74,7 +74,7 @@ static void oprofile_hrtimer_stop(void) put_online_cpus(); } -static int __cpuinit oprofile_cpu_notify(struct notifier_block *self, +static int oprofile_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { long cpu = (long) hcpu; diff --git a/drivers/xen/xen-acpi-cpuhotplug.c b/drivers/xen/xen-acpi-cpuhotplug.c index 18c742bec91bf..b7d5d95d8abf9 100644 --- a/drivers/xen/xen-acpi-cpuhotplug.c +++ b/drivers/xen/xen-acpi-cpuhotplug.c @@ -89,7 +89,7 @@ static int xen_acpi_processor_enable(struct acpi_device *device) return 0; } -static int __cpuinit xen_acpi_processor_add(struct acpi_device *device) +static int xen_acpi_processor_add(struct acpi_device *device) { int ret; struct acpi_processor *pr; diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 0b4303a6c4a35..730c2b28637a8 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -129,13 +129,13 @@ enum { /* Need to know about CPUs going up/down? */ #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) #define cpu_notifier(fn, pri) { \ - static struct notifier_block fn##_nb __cpuinitdata = \ + static struct notifier_block fn##_nb = \ { .notifier_call = fn, .priority = pri }; \ register_cpu_notifier(&fn##_nb); \ } #define __cpu_notifier(fn, pri) { \ - static struct notifier_block fn##_nb __cpuinitdata = \ + static struct notifier_block fn##_nb = \ { .notifier_call = fn, .priority = pri }; \ __register_cpu_notifier(&fn##_nb); \ } diff --git a/include/linux/init.h b/include/linux/init.h index 861814710d523..20d992b73d72e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -94,12 +94,12 @@ #define __exit __section(.exit.text) __exitused __cold notrace /* Used for HOTPLUG_CPU */ -#define __cpuinit __section(.cpuinit.text) __cold notrace -#define __cpuinitdata __section(.cpuinit.data) -#define __cpuinitconst __constsection(.cpuinit.rodata) -#define __cpuexit __section(.cpuexit.text) __exitused __cold notrace -#define __cpuexitdata __section(.cpuexit.data) -#define __cpuexitconst __constsection(.cpuexit.rodata) +#define __cpuinit __cold +#define __cpuinitdata +#define __cpuinitconst +#define __cpuexit __exitused __cold +#define __cpuexitdata +#define __cpuexitconst /* Used for MEMORY_HOTPLUG */ #define __meminit __section(.meminit.text) __cold notrace diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 619d3240d25a3..96f3bf382621a 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -820,7 +820,7 @@ static inline void perf_restore_debug_store(void) { } */ #define perf_cpu_notifier(fn) \ do { \ - static struct notifier_block fn##_nb __cpuinitdata = \ + static struct notifier_block fn##_nb = \ { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ unsigned long cpu = smp_processor_id(); \ unsigned long flags; \ diff --git a/init/calibrate.c b/init/calibrate.c index fda0a7b0f06c0..fe85c605c7d7b 100644 --- a/init/calibrate.c +++ b/init/calibrate.c @@ -31,7 +31,7 @@ __setup("lpj=", lpj_setup); #define DELAY_CALIBRATION_TICKS ((HZ < 100) ? 1 : (HZ/100)) #define MAX_DIRECT_CALIBRATION_RETRIES 5 -static unsigned long __cpuinit calibrate_delay_direct(void) +static unsigned long calibrate_delay_direct(void) { unsigned long pre_start, start, post_start; unsigned long pre_end, end, post_end; @@ -166,7 +166,7 @@ static unsigned long __cpuinit calibrate_delay_direct(void) return 0; } #else -static unsigned long __cpuinit calibrate_delay_direct(void) {return 0;} +static unsigned long calibrate_delay_direct(void) {return 0;} #endif /* @@ -180,7 +180,7 @@ static unsigned long __cpuinit calibrate_delay_direct(void) {return 0;} */ #define LPS_PREC 8 -static unsigned long __cpuinit calibrate_delay_converge(void) +static unsigned long calibrate_delay_converge(void) { /* First stage - slowly accelerate to find initial bounds */ unsigned long lpj, lpj_base, ticks, loopadd, loopadd_base, chop_limit; @@ -254,12 +254,12 @@ static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 }; * Architectures should override this function if a faster calibration * method is available. */ -unsigned long __attribute__((weak)) __cpuinit calibrate_delay_is_known(void) +unsigned long __attribute__((weak)) calibrate_delay_is_known(void) { return 0; } -void __cpuinit calibrate_delay(void) +void calibrate_delay(void) { unsigned long lpj; static bool printed; diff --git a/kernel/cpu.c b/kernel/cpu.c index 2c505f7009040..7eb31dac55e90 100755 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -390,7 +390,7 @@ EXPORT_SYMBOL(cpu_down); #endif /*CONFIG_HOTPLUG_CPU*/ /* Requires cpu_add_remove_lock to be held */ -static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen) +static int _cpu_up(unsigned int cpu, int tasks_frozen) { int ret, nr_calls = 0; void *hcpu = (void *)(long)cpu; @@ -444,7 +444,7 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen) return ret; } -int __cpuinit cpu_up(unsigned int cpu) +int cpu_up(unsigned int cpu) { int err = 0; @@ -649,7 +649,7 @@ core_initcall(cpu_hotplug_pm_sync_init); * It must be called by the arch code on the new cpu, before the new cpu * enables interrupts and before the "boot" cpu returns from __cpu_up(). */ -void __cpuinit notify_cpu_starting(unsigned int cpu) +void notify_cpu_starting(unsigned int cpu) { unsigned long val = CPU_STARTING; diff --git a/kernel/events/core.c b/kernel/events/core.c index dcaacbbf659bd..0e0995eee20e1 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -7660,7 +7660,7 @@ static void __init perf_event_init_all_cpus(void) } } -static void __cpuinit perf_event_init_cpu(int cpu) +static void perf_event_init_cpu(int cpu) { struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu); @@ -7792,7 +7792,7 @@ static struct notifier_block perf_reboot_notifier = { .priority = INT_MIN, }; -static int __cpuinit +static int perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (long)hcpu; diff --git a/kernel/fork.c b/kernel/fork.c index 8ceeb0147f1c3..cc7ac29907d89 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1617,7 +1617,7 @@ static inline void init_idle_pids(struct pid_link *links) } } -struct task_struct * __cpuinit fork_idle(int cpu) +struct task_struct * fork_idle(int cpu) { struct task_struct *task; task = copy_process(CLONE_VM, 0, 0, NULL, &init_struct_pid, 0); diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 47067de1d7d0f..47eb289e38d88 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1671,7 +1671,7 @@ SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, /* * Functions related to boot-time initialization: */ -static void __cpuinit init_hrtimers_cpu(int cpu) +static void init_hrtimers_cpu(int cpu) { struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu); int i; @@ -1752,7 +1752,7 @@ static void migrate_hrtimers(int scpu) #endif /* CONFIG_HOTPLUG_CPU */ -static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self, +static int hrtimer_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { int scpu = (long)hcpu; @@ -1785,7 +1785,7 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata hrtimers_nb = { +static struct notifier_block hrtimers_nb = { .notifier_call = hrtimer_cpu_notify, }; diff --git a/kernel/printk.c b/kernel/printk.c index a478b1bc445c5..3d822879db92e 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -2312,13 +2312,13 @@ void resume_console(void) console_unlock(); } -static void __cpuinit console_flush(struct work_struct *work) +static void console_flush(struct work_struct *work) { console_lock(); console_unlock(); } -static __cpuinitdata DECLARE_WORK(console_cpu_notify_work, console_flush); +static DECLARE_WORK(console_cpu_notify_work, console_flush); /** * console_cpu_notify - print deferred console messages after CPU hotplug @@ -2334,7 +2334,7 @@ static __cpuinitdata DECLARE_WORK(console_cpu_notify_work, console_flush); * Special handling must be done for cases invoked from an atomic context, * as we can't be taking the console semaphore here. */ -static int __cpuinit console_cpu_notify(struct notifier_block *self, +static int console_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { switch (action) { diff --git a/kernel/profile.c b/kernel/profile.c index 594dff58c6078..4c0cb955f33c9 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -331,7 +331,7 @@ static void do_profile_hits(int type, void *__pc, unsigned int nr_hits) put_cpu(); } -static int __cpuinit profile_cpu_callback(struct notifier_block *info, +static int profile_cpu_callback(struct notifier_block *info, unsigned long action, void *__cpu) { int node, cpu = (unsigned long)__cpu; diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index e1f3a8c967243..ceaa5d55671fc 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c @@ -1514,7 +1514,7 @@ rcu_torture_shutdown(void *arg) * Execute random CPU-hotplug operations at the interval specified * by the onoff_interval. */ -static int __cpuinit +static int rcu_torture_onoff(void *arg) { int cpu; @@ -1596,7 +1596,7 @@ rcu_torture_onoff(void *arg) return 0; } -static int __cpuinit +static int rcu_torture_onoff_init(void) { int ret; @@ -1639,7 +1639,7 @@ static void rcu_torture_onoff_cleanup(void) * CPU-stall kthread. It waits as specified by stall_cpu_holdoff, then * induces a CPU stall for the time specified by stall_cpu. */ -static int __cpuinit rcu_torture_stall(void *args) +static int rcu_torture_stall(void *args) { unsigned long stop_at; diff --git a/kernel/rcutree.c b/kernel/rcutree.c index c5cc4f1bce80f..20a56ced31015 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -2996,7 +2996,7 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) * can accept some slop in the rsp->completed access due to the fact * that this CPU cannot possibly have any RCU callbacks in flight yet. */ -static void __cpuinit +static void rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptible) { unsigned long flags; @@ -3049,7 +3049,7 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptible) mutex_unlock(&rsp->onoff_mutex); } -static void __cpuinit rcu_prepare_cpu(int cpu) +static void rcu_prepare_cpu(int cpu) { struct rcu_state *rsp; @@ -3061,7 +3061,7 @@ static void __cpuinit rcu_prepare_cpu(int cpu) /* * Handle CPU online/offline notification events. */ -static int __cpuinit rcu_cpu_notify(struct notifier_block *self, +static int rcu_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { long cpu = (long)hcpu; diff --git a/kernel/rcutree.h b/kernel/rcutree.h index b07ec0473883d..f362084a9c90b 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h @@ -523,10 +523,10 @@ static void invoke_rcu_callbacks_kthread(void); static bool rcu_is_callbacks_kthread(void); #ifdef CONFIG_RCU_BOOST static void rcu_preempt_do_callbacks(void); -static int __cpuinit rcu_spawn_one_boost_kthread(struct rcu_state *rsp, +static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, struct rcu_node *rnp); #endif /* #ifdef CONFIG_RCU_BOOST */ -static void __cpuinit rcu_prepare_kthreads(int cpu); +static void rcu_prepare_kthreads(int cpu); static void rcu_prepare_for_idle_init(int cpu); static void rcu_cleanup_after_idle(int cpu); static void rcu_prepare_for_idle(int cpu); diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index a43c43e2a003a..dcb83d759ac30 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h @@ -1327,7 +1327,7 @@ static void rcu_preempt_boost_start_gp(struct rcu_node *rnp) * already exist. We only create this kthread for preemptible RCU. * Returns zero if all is well, a negated errno otherwise. */ -static int __cpuinit rcu_spawn_one_boost_kthread(struct rcu_state *rsp, +static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, struct rcu_node *rnp) { int rnp_index = rnp - &rsp->node[0]; @@ -1482,7 +1482,7 @@ static int __init rcu_spawn_kthreads(void) } early_initcall(rcu_spawn_kthreads); -static void __cpuinit rcu_prepare_kthreads(int cpu) +static void rcu_prepare_kthreads(int cpu) { struct rcu_data *rdp = per_cpu_ptr(rcu_state->rda, cpu); struct rcu_node *rnp = rdp->mynode; @@ -1524,7 +1524,7 @@ static int __init rcu_scheduler_really_started(void) } early_initcall(rcu_scheduler_really_started); -static void __cpuinit rcu_prepare_kthreads(int cpu) +static void rcu_prepare_kthreads(int cpu) { } diff --git a/kernel/relay.c b/kernel/relay.c index b91488ba2e5a7..5001c9887db1a 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -516,7 +516,7 @@ static void setup_callbacks(struct rchan *chan, * * Returns the success/failure of the operation. (%NOTIFY_OK, %NOTIFY_BAD) */ -static int __cpuinit relay_hotcpu_callback(struct notifier_block *nb, +static int relay_hotcpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) { diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 32f3e87bf3c14..a82d69e9c3f80 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6776,7 +6776,7 @@ void show_state_filter(unsigned long state_filter) debug_show_all_locks(); } -void __cpuinit init_idle_bootup_task(struct task_struct *idle) +void init_idle_bootup_task(struct task_struct *idle) { idle->sched_class = &idle_sched_class; } @@ -6789,7 +6789,7 @@ void __cpuinit init_idle_bootup_task(struct task_struct *idle) * NOTE: this function does not set the idle thread's NEED_RESCHED * flag, to make booting more robust. */ -void __cpuinit init_idle(struct task_struct *idle, int cpu) +void init_idle(struct task_struct *idle, int cpu) { struct rq *rq = cpu_rq(cpu); unsigned long flags; @@ -7289,7 +7289,7 @@ static void set_rq_offline(struct rq *rq) * migration_call - callback that gets triggered when a CPU is added. * Here we can start up the necessary migration thread for the new CPU. */ -static int __cpuinit +static int migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) { int cpu = (long)hcpu; @@ -7350,12 +7350,12 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) * happens before everything else. This has to be lower priority than * the notifier in the perf_event subsystem, though. */ -static struct notifier_block __cpuinitdata migration_notifier = { +static struct notifier_block migration_notifier = { .notifier_call = migration_call, .priority = CPU_PRI_MIGRATION, }; -static int __cpuinit sched_cpu_active(struct notifier_block *nfb, +static int sched_cpu_active(struct notifier_block *nfb, unsigned long action, void *hcpu) { switch (action & ~CPU_TASKS_FROZEN) { @@ -7367,7 +7367,7 @@ static int __cpuinit sched_cpu_active(struct notifier_block *nfb, } } -static int __cpuinit sched_cpu_inactive(struct notifier_block *nfb, +static int sched_cpu_inactive(struct notifier_block *nfb, unsigned long action, void *hcpu) { switch (action & ~CPU_TASKS_FROZEN) { diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 60d836e5ecb88..7952f5252de59 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8161,7 +8161,7 @@ void nohz_balance_enter_idle(int cpu) set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)); } -static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb, +static int sched_ilb_notifier(struct notifier_block *nfb, unsigned long action, void *hcpu) { switch (action & ~CPU_TASKS_FROZEN) { diff --git a/kernel/smp.c b/kernel/smp.c index dec409c83ddba..8954914bf56fd 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -76,7 +76,7 @@ hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu) return NOTIFY_OK; } -static struct notifier_block __cpuinitdata hotplug_cfd_notifier = { +static struct notifier_block hotplug_cfd_notifier = { .notifier_call = hotplug_cfd, }; diff --git a/kernel/smpboot.c b/kernel/smpboot.c index 7020eecb398bd..8d590db6d9e2a 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c @@ -24,7 +24,7 @@ */ static DEFINE_PER_CPU(struct task_struct *, idle_threads); -struct task_struct * __cpuinit idle_thread_get(unsigned int cpu) +struct task_struct * idle_thread_get(unsigned int cpu) { struct task_struct *tsk = per_cpu(idle_threads, cpu); diff --git a/kernel/softirq.c b/kernel/softirq.c index 96a4c2828ce65..9de0f2730c080 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -712,7 +712,7 @@ static void takeover_tasklets(unsigned int cpu) } #endif /* CONFIG_HOTPLUG_CPU */ -static int __cpuinit cpu_callback(struct notifier_block *nfb, +static int cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { @@ -727,7 +727,7 @@ static int __cpuinit cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata cpu_nfb = { +static struct notifier_block cpu_nfb = { .notifier_call = cpu_callback }; diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 228eba5ccc72e..c0e1b0e56d3e5 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -331,7 +331,7 @@ static int __init tick_nohz_full_setup(char *str) } __setup("nohz_full=", tick_nohz_full_setup); -static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb, +static int tick_nohz_cpu_down_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { diff --git a/kernel/timer.c b/kernel/timer.c index d7a26c8defdbe..a2946533d6498 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1559,11 +1559,11 @@ signed long __sched schedule_timeout_uninterruptible(signed long timeout) } EXPORT_SYMBOL(schedule_timeout_uninterruptible); -static int __cpuinit init_timers_cpu(int cpu) +static int init_timers_cpu(int cpu) { int j; struct tvec_base *base; - static char __cpuinitdata tvec_base_done[NR_CPUS + 1]; + static char tvec_base_done[NR_CPUS + 1]; if (!tvec_base_done[cpu]) { static char boot_done; @@ -1646,7 +1646,7 @@ static void migrate_timer_list(struct tvec_base *new_base, struct list_head *hea } } -static void __cpuinit migrate_timers(int cpu) +static void migrate_timers(int cpu) { struct tvec_base *old_base; struct tvec_base *new_base; @@ -1679,7 +1679,7 @@ static void __cpuinit migrate_timers(int cpu) } #endif /* CONFIG_HOTPLUG_CPU */ -static int __cpuinit timer_cpu_notify(struct notifier_block *self, +static int timer_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { long cpu = (long)hcpu; @@ -1704,7 +1704,7 @@ static int __cpuinit timer_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata timers_nb = { +static struct notifier_block timers_nb = { .notifier_call = timer_cpu_notify, }; diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 5b740b40e27b9..07d3f4dfce3b3 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4726,7 +4726,7 @@ static void restore_unbound_workers_cpumask(struct worker_pool *pool, int cpu) * Workqueues should be brought up before normal priority CPU notifiers. * This will be registered high priority CPU notifier. */ -static int __cpuinit workqueue_cpu_up_callback(struct notifier_block *nfb, +static int workqueue_cpu_up_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { @@ -4779,7 +4779,7 @@ static int __cpuinit workqueue_cpu_up_callback(struct notifier_block *nfb, * Workqueues should be brought down after normal priority CPU notifiers. * This will be registered as low priority CPU notifier. */ -static int __cpuinit workqueue_cpu_down_callback(struct notifier_block *nfb, +static int workqueue_cpu_down_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { diff --git a/lib/earlycpio.c b/lib/earlycpio.c index 8078ef49cb793..7aa7ce250c94d 100644 --- a/lib/earlycpio.c +++ b/lib/earlycpio.c @@ -63,7 +63,7 @@ enum cpio_fields { * the match returned an empty filename string. */ -struct cpio_data __cpuinit find_cpio_data(const char *path, void *data, +struct cpio_data find_cpio_data(const char *path, void *data, size_t len, long *offset) { const size_t cpio_header_len = 8*C_NFIELDS - 2; diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index ba6085d9c7411..867f2da6d697d 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c @@ -158,7 +158,7 @@ static void compute_batch_value(void) percpu_counter_batch = max(32, nr*2); } -static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb, +static int percpu_counter_hotcpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) { #ifdef CONFIG_HOTPLUG_CPU diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 904244a74e43b..356caf075c918 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2565,7 +2565,7 @@ static void mem_cgroup_drain_pcp_counter(struct mem_cgroup *memcg, int cpu) spin_unlock(&memcg->pcp_counter_lock); } -static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb, +static int memcg_cpu_hotplug_callback(struct notifier_block *nb, unsigned long action, void *hcpu) { diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 7474cf43110cd..e0ec4b74f5ecd 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1761,7 +1761,7 @@ void writeback_set_ratelimit(void) ratelimit_pages = 16; } -static int __cpuinit +static int ratelimit_handler(struct notifier_block *self, unsigned long action, void *hcpu) { @@ -1776,7 +1776,7 @@ ratelimit_handler(struct notifier_block *self, unsigned long action, } } -static struct notifier_block __cpuinitdata ratelimit_nb = { +static struct notifier_block ratelimit_nb = { .notifier_call = ratelimit_handler, .next = NULL, }; diff --git a/mm/slab.c b/mm/slab.c index bd88411595b9b..a1b22c71c666c 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -787,7 +787,7 @@ static void next_reap_node(void) * the CPUs getting into lockstep and contending for the global cache chain * lock. */ -static void __cpuinit start_cpu_timer(int cpu) +static void start_cpu_timer(int cpu) { struct delayed_work *reap_work = &per_cpu(slab_reap_work, cpu); @@ -1180,7 +1180,7 @@ static int init_cache_node_node(int node) return 0; } -static void __cpuinit cpuup_canceled(long cpu) +static void cpuup_canceled(long cpu) { struct kmem_cache *cachep; struct kmem_cache_node *n = NULL; @@ -1245,7 +1245,7 @@ static void __cpuinit cpuup_canceled(long cpu) } } -static int __cpuinit cpuup_prepare(long cpu) +static int cpuup_prepare(long cpu) { struct kmem_cache *cachep; struct kmem_cache_node *n = NULL; @@ -1328,7 +1328,7 @@ static int __cpuinit cpuup_prepare(long cpu) return -ENOMEM; } -static int __cpuinit cpuup_callback(struct notifier_block *nfb, +static int cpuup_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { long cpu = (long)hcpu; @@ -1384,7 +1384,7 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb, return notifier_from_errno(err); } -static struct notifier_block __cpuinitdata cpucache_notifier = { +static struct notifier_block cpucache_notifier = { &cpuup_callback, NULL, 0 }; diff --git a/mm/slub.c b/mm/slub.c index 411d812471437..6d3b32f081b4d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3769,7 +3769,7 @@ int __kmem_cache_create(struct kmem_cache *s, unsigned long flags) * Use the cpu notifier to insure that the cpu slabs are flushed when * necessary. */ -static int __cpuinit slab_cpuup_callback(struct notifier_block *nfb, +static int slab_cpuup_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { long cpu = (long)hcpu; @@ -3795,7 +3795,7 @@ static int __cpuinit slab_cpuup_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata slab_notifier = { +static struct notifier_block slab_notifier = { .notifier_call = slab_cpuup_callback }; diff --git a/mm/vmstat.c b/mm/vmstat.c index c4a665630d4de..8f3e015b42759 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1281,7 +1281,7 @@ static void vmstat_update(struct work_struct *w) round_jiffies_relative(sysctl_stat_interval)); } -static void __cpuinit start_cpu_timer(int cpu) +static void start_cpu_timer(int cpu) { struct delayed_work *work = &per_cpu(vmstat_work, cpu); @@ -1293,7 +1293,7 @@ static void __cpuinit start_cpu_timer(int cpu) * Use the cpu notifier to insure that the thresholds are recalculated * when necessary. */ -static int __cpuinit vmstat_cpuup_callback(struct notifier_block *nfb, +static int vmstat_cpuup_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { @@ -1325,7 +1325,7 @@ static int __cpuinit vmstat_cpuup_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata vmstat_notifier = +static struct notifier_block vmstat_notifier = { &vmstat_cpuup_callback, NULL, 0 }; #endif diff --git a/net/core/flow.c b/net/core/flow.c index f74230f808675..9a2151f5d5935 100644 --- a/net/core/flow.c +++ b/net/core/flow.c @@ -403,7 +403,7 @@ void flow_cache_flush_deferred(void) schedule_work(&flow_cache_flush_work); } -static int __cpuinit flow_cache_cpu_prepare(struct flow_cache *fc, int cpu) +static int flow_cache_cpu_prepare(struct flow_cache *fc, int cpu) { struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu); size_t sz = sizeof(struct hlist_head) * flow_cache_hash_size(fc); @@ -421,7 +421,7 @@ static int __cpuinit flow_cache_cpu_prepare(struct flow_cache *fc, int cpu) return 0; } -static int __cpuinit flow_cache_cpu(struct notifier_block *nfb, +static int flow_cache_cpu(struct notifier_block *nfb, unsigned long action, void *hcpu) { diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 4fe76ff214c2a..cd5b8ec9be045 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -621,7 +621,7 @@ static void iucv_disable(void) put_online_cpus(); } -static int __cpuinit iucv_cpu_notify(struct notifier_block *self, +static int iucv_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { cpumask_t cpumask; diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 2fa73ee7942f3..dd907ee6e2ac9 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -868,23 +868,23 @@ static void check_section(const char *modname, struct elf_info *elf, #define ALL_INIT_DATA_SECTIONS \ ".init.setup$", ".init.rodata$", \ - ".cpuinit.rodata$", ".meminit.rodata$", \ - ".init.data$", ".cpuinit.data$", ".meminit.data$" + ".meminit.rodata$", \ + ".init.data$", ".meminit.data$" #define ALL_EXIT_DATA_SECTIONS \ - ".exit.data$", ".cpuexit.data$", ".memexit.data$" + ".exit.data$", ".memexit.data$" #define ALL_INIT_TEXT_SECTIONS \ - ".init.text$", ".cpuinit.text$", ".meminit.text$" + ".init.text$", ".meminit.text$" #define ALL_EXIT_TEXT_SECTIONS \ - ".exit.text$", ".cpuexit.text$", ".memexit.text$" + ".exit.text$", ".memexit.text$" #define ALL_PCI_INIT_SECTIONS \ ".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \ ".pci_fixup_enable$", ".pci_fixup_resume$", \ ".pci_fixup_resume_early$", ".pci_fixup_suspend$" -#define ALL_XXXINIT_SECTIONS CPU_INIT_SECTIONS, MEM_INIT_SECTIONS -#define ALL_XXXEXIT_SECTIONS CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS +#define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS +#define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS @@ -893,11 +893,9 @@ static void check_section(const char *modname, struct elf_info *elf, #define TEXT_SECTIONS ".text$" #define INIT_SECTIONS ".init.*" -#define CPU_INIT_SECTIONS ".cpuinit.*" #define MEM_INIT_SECTIONS ".meminit.*" #define EXIT_SECTIONS ".exit.*" -#define CPU_EXIT_SECTIONS ".cpuexit.*" #define MEM_EXIT_SECTIONS ".memexit.*" /* init data sections */ @@ -985,48 +983,20 @@ const struct sectioncheck sectioncheck[] = { .mismatch = DATA_TO_ANY_EXIT, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, }, -/* Do not reference init code/data from cpuinit/meminit code/data */ +/* Do not reference init code/data from meminit code/data */ { .fromsec = { ALL_XXXINIT_SECTIONS, NULL }, .tosec = { INIT_SECTIONS, NULL }, .mismatch = XXXINIT_TO_SOME_INIT, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, }, -/* Do not reference cpuinit code/data from meminit code/data */ -{ - .fromsec = { MEM_INIT_SECTIONS, NULL }, - .tosec = { CPU_INIT_SECTIONS, NULL }, - .mismatch = XXXINIT_TO_SOME_INIT, - .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, -}, -/* Do not reference meminit code/data from cpuinit code/data */ -{ - .fromsec = { CPU_INIT_SECTIONS, NULL }, - .tosec = { MEM_INIT_SECTIONS, NULL }, - .mismatch = XXXINIT_TO_SOME_INIT, - .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, -}, -/* Do not reference exit code/data from cpuexit/memexit code/data */ +/* Do not reference exit code/data from memexit code/data */ { .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, .tosec = { EXIT_SECTIONS, NULL }, .mismatch = XXXEXIT_TO_SOME_EXIT, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, }, -/* Do not reference cpuexit code/data from memexit code/data */ -{ - .fromsec = { MEM_EXIT_SECTIONS, NULL }, - .tosec = { CPU_EXIT_SECTIONS, NULL }, - .mismatch = XXXEXIT_TO_SOME_EXIT, - .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, -}, -/* Do not reference memexit code/data from cpuexit code/data */ -{ - .fromsec = { CPU_EXIT_SECTIONS, NULL }, - .tosec = { MEM_EXIT_SECTIONS, NULL }, - .mismatch = XXXEXIT_TO_SOME_EXIT, - .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, -}, /* Do not use exit code/data from init code */ { .fromsec = { ALL_INIT_SECTIONS, NULL }, @@ -1095,7 +1065,7 @@ static const struct sectioncheck *section_mismatch( * Pattern 2: * Many drivers utilise a *driver container with references to * add, remove, probe functions etc. - * These functions may often be marked __cpuinit and we do not want to + * These functions may often be marked and we do not want to * warn here. * the pattern is identified by: * tosec = init or exit section @@ -1255,7 +1225,6 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr, /* * Convert a section name to the function/data attribute * .init.text => __init - * .cpuinit.data => __cpudata * .memexitconst => __memconst * etc. * From 419b6cd17ba98e1865ef89f8cf7f0b24c294d19b Mon Sep 17 00:00:00 2001 From: benschhold Date: Sun, 13 Nov 2016 19:55:31 +0100 Subject: [PATCH 07/75] Makefile: ggc 6 wno errors --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e1b3a5560bfb1..2e9fb8d925834 100755 --- a/Makefile +++ b/Makefile @@ -239,8 +239,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ else echo sh; fi ; fi) -HOSTCC = gcc -HOSTCXX = g++ +HOSTCC = ccache gcc +HOSTCXX = ccache g++ HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 HOSTCXXFLAGS = -O2 @@ -378,7 +378,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -Werror-implicit-function-declaration \ -Wno-format-security \ -fno-delete-null-pointer-checks \ - -std=gnu89 + -std=gnu89 -Wno-unused-const-variable -Wno-misleading-indentation \ + -Wno-memset-transposed-args -Wno-bool-compare -Wno-logical-not-parentheses \ + -Wno-switch-bool KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL := From e283333a2c9e1117bfe65996ff3c321d635285b6 Mon Sep 17 00:00:00 2001 From: benschhold Date: Sun, 13 Nov 2016 19:55:56 +0100 Subject: [PATCH 08/75] MSM Hotplug change default settingx --- drivers/soc/qcom/msm_hotplug.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/soc/qcom/msm_hotplug.c b/drivers/soc/qcom/msm_hotplug.c index 793da34a3b3d6..e2cc65e574e19 100644 --- a/drivers/soc/qcom/msm_hotplug.c +++ b/drivers/soc/qcom/msm_hotplug.c @@ -110,21 +110,21 @@ #define MSM_HOTPLUG_VERSION "2.4" #define MSM_HOTPLUG "msm_hotplug" -#define HOTPLUG_ENABLED 0 +#define HOTPLUG_ENABLED 1 #define DEFAULT_UPDATE_RATE 200 #define START_DELAY 20000 #define DEFAULT_HISTORY_SIZE 10 #define DEFAULT_DOWN_LOCK_DUR 1000 -#define DEFAULT_MIN_CPUS_ONLINE 2 +#define DEFAULT_MIN_CPUS_ONLINE 1 #define DEFAULT_MAX_CPUS_ONLINE LITTLE_CORES #define DEFAULT_MAX_CPUS_ONLINE_SUSP 2 -#define DEFAULT_OFFLINE_LOAD 0 +#define DEFAULT_OFFLINE_LOAD 5 #define DEFAULT_MIN_CPUS_ONLINE_BIG 1 #define DEFAULT_MAX_CPUS_ONLINE_BIG BIG_CORES #define DEFAULT_OFFLINE_LOAD_BIG 20 -#define DEFAULT_ONLINE_LOAD_BIG 80 +#define DEFAULT_ONLINE_LOAD_BIG 70 #define DEFAULT_KICK_IN_LOAD_BIG 70 -#define DEFAULT_FAST_LANE_LOAD 95 +#define DEFAULT_FAST_LANE_LOAD 90 #define DEFAULT_BIG_CORE_UP_DELAY 200 #define DEFAULT_IO_IS_BUSY false From 3f11b46ae7dde4e8299ef0cc379b8ea44bac8d34 Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 1 Apr 2016 11:23:34 +0200 Subject: [PATCH 09/75] OP2 add the possibility to change the value for low power mode --- drivers/power/battery_current_limit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/power/battery_current_limit.c b/drivers/power/battery_current_limit.c index d6eb437d2f4b8..49452cec47f09 100755 --- a/drivers/power/battery_current_limit.c +++ b/drivers/power/battery_current_limit.c @@ -196,7 +196,8 @@ static struct work_struct bcl_hotplug_work; static DEFINE_MUTEX(bcl_hotplug_mutex); static bool bcl_hotplug_enabled; static uint32_t battery_soc_val = 100; -static uint32_t soc_low_threshold; +static uint32_t soc_low_threshold = 0; +module_param_named(low_battery_value, soc_low_threshold, int, 0664); static struct power_supply bcl_psy; static const char bcl_psy_name[] = "bcl"; static cpumask_var_t bcl_cpu_online_mask; @@ -1557,8 +1558,6 @@ static int probe_bcl_periph_prop(struct bcl_context *bcl) bcl->vbat_high_thresh.trip_value, ibat_probe_exit); BCL_FETCH_DT_U32(ibat_node, key, "qcom,vph-low-threshold-uv", ret, bcl->vbat_low_thresh.trip_value, ibat_probe_exit); - BCL_FETCH_DT_U32(ibat_node, key, "qcom,soc-low-threshold", ret, - soc_low_threshold, ibat_probe_exit); bcl->vbat_high_thresh.trip_notify = bcl->vbat_low_thresh.trip_notify = bcl_periph_vbat_notify; bcl->vbat_high_thresh.trip_data From 8df2f1e24ec442899c2e4cfa46d4857a6f44777c Mon Sep 17 00:00:00 2001 From: Dan Elkouby Date: Sun, 6 Mar 2016 11:19:48 +0200 Subject: [PATCH 10/75] tri_state_key: allow more key codes for extra modes Change-Id: I2ab8557a9d10b88ef5d0bf0aa55e00b8fb67200a --- drivers/input/misc/tri_state_key.c | 40 +++++++++++------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/input/misc/tri_state_key.c b/drivers/input/misc/tri_state_key.c index ebc4655b4f9e0..5a104f29029fd 100755 --- a/drivers/input/misc/tri_state_key.c +++ b/drivers/input/misc/tri_state_key.c @@ -36,23 +36,14 @@ 4�ź�3������ 1 0 | Normal */ -typedef enum { - MODE_UNKNOWN, - MODE_MUTE, - MODE_DO_NOT_DISTURB, - MODE_NORMAL, - MODE_MAX_NUM -} tri_mode_t; - -#define MODE_TOTAL_SILENCE 600 -#define MODE_ALARMS_ONLY 601 -#define MODE_PRIORITY_ONLY 602 -#define MODE_NONE 603 + +#define KEYCODE_BASE 600 +#define TOTAL_KEYCODES 6 static int current_mode = 0; -static int keyCode_slider_top = MODE_ALARMS_ONLY; -static int keyCode_slider_middle = MODE_PRIORITY_ONLY; -static int keyCode_slider_bottom = MODE_NONE; +static int keyCode_slider_top = KEYCODE_BASE + 1; +static int keyCode_slider_middle = KEYCODE_BASE + 2; +static int keyCode_slider_bottom = KEYCODE_BASE + 3; struct switch_dev_data { //tri_mode_t last_type; @@ -103,17 +94,17 @@ static void switch_dev_work(struct work_struct *work) mutex_lock(&sem); if(!gpio_get_value(switch_data->key2_gpio)) { - mode = MODE_NORMAL; + mode = 3; keyCode = keyCode_slider_bottom; } else if(gpio_get_value(switch_data->key1_gpio)) { - mode = MODE_DO_NOT_DISTURB; + mode = 2; keyCode = keyCode_slider_middle; } else { - mode = MODE_MUTE; + mode = 1; keyCode = keyCode_slider_top; } if (current_mode != mode) { @@ -319,7 +310,7 @@ static ssize_t keyCode_top_write(struct file *file, const char __user *page, siz if (sscanf(buf, "%d", &data) != 1) return t; - if (data < 600 || data > 603) + if (data < KEYCODE_BASE || data >= (KEYCODE_BASE + TOTAL_KEYCODES)) return t; keyCode_slider_top = data; @@ -363,7 +354,7 @@ static ssize_t keyCode_middle_write(struct file *file, const char __user *page, if (sscanf(buf, "%d", &data) != 1) return t; - if (data < 600 || data > 603) + if (data < KEYCODE_BASE || data >= (KEYCODE_BASE + TOTAL_KEYCODES)) return t; keyCode_slider_middle = data; @@ -407,7 +398,7 @@ static ssize_t keyCode_bottom_write(struct file *file, const char __user *page, if (sscanf(buf, "%d", &data) != 1) return t; - if (data < 600 || data > 603) + if (data < KEYCODE_BASE || data >= (KEYCODE_BASE + TOTAL_KEYCODES)) return t; keyCode_slider_bottom = data; @@ -437,6 +428,7 @@ static int tristate_dev_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct proc_dir_entry *procdir; int error=0; + int i; //void __iomem *cfg_reg; @@ -464,10 +456,8 @@ static int tristate_dev_probe(struct platform_device *pdev) switch_data->input->name = DRV_NAME; switch_data->input->dev.parent = &pdev->dev; set_bit(EV_KEY, switch_data->input->evbit); - set_bit(MODE_TOTAL_SILENCE, switch_data->input->keybit); - set_bit(MODE_ALARMS_ONLY, switch_data->input->keybit); - set_bit(MODE_PRIORITY_ONLY, switch_data->input->keybit); - set_bit(MODE_NONE, switch_data->input->keybit); + for (i = KEYCODE_BASE; i < KEYCODE_BASE + TOTAL_KEYCODES; i++) + set_bit(i, switch_data->input->keybit); input_set_drvdata(switch_data->input, switch_data); error = input_register_device(switch_data->input); if (error) { From 40e41a3ead428e8006fcc7cf37b83d881a40fcc8 Mon Sep 17 00:00:00 2001 From: benschhold Date: Sun, 13 Nov 2016 20:01:02 +0100 Subject: [PATCH 11/75] kernel display name inline --- arch/arm64/configs/cm_oneplus2_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index cbc12f5ca60f1..a3c2551a17bda 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -1,4 +1,4 @@ -CONFIG_LOCALVERSION="-perf" +CONFIG_LOCALVERSION="-inline" CONFIG_SYSVIPC=y CONFIG_AUDIT=y CONFIG_NO_HZ=y From 41e075ed0a8423555c3f8863517f9beca1c25a79 Mon Sep 17 00:00:00 2001 From: benschhold Date: Mon, 14 Nov 2016 11:51:36 +0100 Subject: [PATCH 12/75] disable modules Change-Id: I3b04467f710ec7c43dc62617bcf31ffc3f73df09 --- arch/arm64/configs/cm_oneplus2_defconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index a3c2551a17bda..61bc7de188759 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -522,9 +522,9 @@ CONFIG_MSM_SCM=y CONFIG_MSM_SHARED_HEAP_ACCESS=y CONFIG_MSM_SYSTEM_HEALTH_MONITOR=y CONFIG_QCOM_EARLY_RANDOM=y -CONFIG_MSM_CORE_CTL_HELPER=y -CONFIG_MSM_PERFORMANCE=y -CONFIG_ONEPLUS_HCUBE=m +CONFIG_MSM_CORE_CTL_HELPER=n +CONFIG_MSM_PERFORMANCE=n +CONFIG_ONEPLUS_HCUBE=n CONFIG_KERNEL_TEXT_MPU_PROT=y CONFIG_PARAM_READ_WRITE=y CONFIG_EXT4_FS=y From c4d1ab7e124f2af7adc3f721b57290348d2890d3 Mon Sep 17 00:00:00 2001 From: benschhold Date: Mon, 14 Nov 2016 11:51:51 +0100 Subject: [PATCH 13/75] msm hotplug off by default Change-Id: I672b4dc2b8b0cc35a7c656d6a28bee55802b353a --- drivers/soc/qcom/msm_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/msm_hotplug.c b/drivers/soc/qcom/msm_hotplug.c index e2cc65e574e19..ab07a4012ce1e 100644 --- a/drivers/soc/qcom/msm_hotplug.c +++ b/drivers/soc/qcom/msm_hotplug.c @@ -110,7 +110,7 @@ #define MSM_HOTPLUG_VERSION "2.4" #define MSM_HOTPLUG "msm_hotplug" -#define HOTPLUG_ENABLED 1 +#define HOTPLUG_ENABLED 0 #define DEFAULT_UPDATE_RATE 200 #define START_DELAY 20000 #define DEFAULT_HISTORY_SIZE 10 From 351a4f0a01ce51c27890378410153c2aed88033c Mon Sep 17 00:00:00 2001 From: benschhold Date: Wed, 16 Nov 2016 18:20:10 +0100 Subject: [PATCH 14/75] correct that --- drivers/input/misc/fpc1020_tee.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/input/misc/fpc1020_tee.c b/drivers/input/misc/fpc1020_tee.c index 08aaf58e643f4..750c0d43a428c 100755 --- a/drivers/input/misc/fpc1020_tee.c +++ b/drivers/input/misc/fpc1020_tee.c @@ -980,24 +980,22 @@ static void __cpuinit msm_hotplug_resume_call(struct work_struct *msm_hotplug_re static DECLARE_WORK(msm_hotplug_resume_call_work, msm_hotplug_resume_call); #endif -static irqreturn_t fpc1020_irq_handler(int irq, void *handle) -{ - struct fpc1020_data *fpc1020 = handle; - //dev_info(fpc1020->dev, "%s\n", __func__); - - /* Make sure 'wakeup_enabled' is updated before using it - ** since this is interrupt context (other thread...) */ - smp_rmb(); -/* - if (fpc1020->wakeup_enabled ) { - wake_lock_timeout(&fpc1020->ttw_wl, msecs_to_jiffies(FPC_TTW_HOLD_TIME)); - } -*/ + static irqreturn_t fpc1020_irq_handler(int irq, void *handle) + { + struct fpc1020_data *fpc1020 = handle; + dev_dbg(fpc1020->dev, "%s\n", __func__); + + /* Make sure 'wakeup_enabled' is updated before using it + ** since this is interrupt context (other thread...) */ + smp_rmb(); + + if (fpc1020->wakeup_enabled) { + wake_lock_timeout(&fpc1020->ttw_wl, msecs_to_jiffies(FPC_TTW_HOLD_TIME)); #ifdef CONFIG_MSM_HOTPLUG if (msm_enabled && msm_hotplug_scr_suspended && !msm_hotplug_fingerprint_called) { msm_hotplug_fingerprint_called = true; - schedule_work(&msm_hotplug_resume_call_work); + schedule_work(&msm_hotplug_resume_call_work); } #endif From e6f76f69fb7ae0944d14d2a57b6b66df66f62898 Mon Sep 17 00:00:00 2001 From: andip71 Date: Sat, 16 Jul 2016 21:43:16 -0700 Subject: [PATCH 15/75] input: synaptics: s1302: Stop keypad when touchscreen is in use All credits to Sultanxda When the user's finger is on the touchscreen, don't process any keypad button presses, as an unintended button press will cause poor UX. Register an input handler to check when there are fingers on the touchscreen (via BTN_TOOL_FINGER) to disable/enable the keypad accordingly. --- .../touchscreen/synaptics_driver_s1302.c | 81 ++++++++++++++++++- .../touchscreen/synaptics_driver_s3320.c | 1 + 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/synaptics_driver_s1302.c b/drivers/input/touchscreen/synaptics_driver_s1302.c index c3d544ed2e363..6b7128e3dfe16 100644 --- a/drivers/input/touchscreen/synaptics_driver_s1302.c +++ b/drivers/input/touchscreen/synaptics_driver_s1302.c @@ -299,6 +299,8 @@ struct synaptics_ts_data { char fw_name[TP_FW_NAME_MAX_LEN]; char fw_id[12]; char manu_name[12]; + + bool stop_keypad; }; /* static int tc_hw_pwron(struct synaptics_ts_data *ts) @@ -753,10 +755,12 @@ static void synaptics_ts_report(struct synaptics_ts_data *ts ) if( inte & 0x10) { #ifdef VENDOR_EDIT //WayneChang, 2015/12/29, add flag to enable virtual key if(!virtual_key_enable){ - int_key(ts); + if (!ts->stop_keypad) + int_key(ts); } #else - int_key(ts); + if (!ts->stop_keypad) + int_key(ts); #endif } END: @@ -1508,6 +1512,74 @@ static int synaptics_parse_dts(struct device *dev, struct synaptics_ts_data *ts) } return rc; } + +static void synaptics_input_event(struct input_handle *handle, + unsigned int type, unsigned int code, int value) +{ + struct synaptics_ts_data *ts = tc_g; + + if (code != BTN_TOOL_FINGER) + return; + + /* Disable capacitive keys when user's finger is on touchscreen */ + ts->stop_keypad = value; +} + +static int synaptics_input_connect(struct input_handler *handler, + struct input_dev *dev, const struct input_device_id *id) +{ + struct input_handle *handle; + int ret; + + handle = kzalloc(sizeof(*handle), GFP_KERNEL); + if (!handle) + return -ENOMEM; + + handle->dev = dev; + handle->handler = handler; + handle->name = "s1302_handle"; + + ret = input_register_handle(handle); + if (ret) + goto err2; + + ret = input_open_device(handle); + if (ret) + goto err1; + + return 0; + +err1: + input_unregister_handle(handle); +err2: + kfree(handle); + return ret; +} + +static void synaptics_input_disconnect(struct input_handle *handle) +{ + input_close_device(handle); + input_unregister_handle(handle); + kfree(handle); +} + +static const struct input_device_id synaptics_input_ids[] = { + { + .flags = INPUT_DEVICE_ID_MATCH_KEYBIT, + .keybit = { [BIT_WORD(BTN_TOOL_FINGER)] = + BIT_MASK(BTN_TOOL_FINGER) }, + }, + { }, +}; + +static struct input_handler synaptics_input_handler = { + .event = synaptics_input_event, + .connect = synaptics_input_connect, + .disconnect = synaptics_input_disconnect, + .name = "syna_input_handler", + .id_table = synaptics_input_ids, +}; + static int synaptics_ts_probe(struct i2c_client *client, const struct i2c_device_id *id) { #ifdef CONFIG_SYNAPTIC_RED @@ -1626,6 +1698,11 @@ static int synaptics_ts_probe(struct i2c_client *client, const struct i2c_device register_remote_device_s1302(premote_data); } #endif + + ret = input_register_handler(&synaptics_input_handler); + if (ret) + TPD_ERR("%s: Failed to register input handler\n", __func__); + TPDTM_DMESG("synaptics_ts_probe s1302: normal end\n"); return 0; diff --git a/drivers/input/touchscreen/synaptics_driver_s3320.c b/drivers/input/touchscreen/synaptics_driver_s3320.c index 46bebde16319f..b4da0043db327 100644 --- a/drivers/input/touchscreen/synaptics_driver_s3320.c +++ b/drivers/input/touchscreen/synaptics_driver_s3320.c @@ -2366,6 +2366,7 @@ static int synaptics_input_init(struct synaptics_ts_data *ts) #ifdef SUPPORT_GESTURE set_bit(KEY_F4 , ts->input_dev->keybit);//doulbe-tap resume + set_bit(BTN_TOOL_FINGER, ts->input_dev->keybit); #ifdef VENDOR_EDIT set_bit(KEY_DOUBLE_TAP, ts->input_dev->keybit); set_bit(KEY_GESTURE_CIRCLE, ts->input_dev->keybit); From 85c81b40515d045d90858e9a0ed9826cb053f638 Mon Sep 17 00:00:00 2001 From: andip71 Date: Sat, 16 Jul 2016 21:58:45 -0700 Subject: [PATCH 16/75] misc: fpc1020: Ignore home key presses when touchscreen is in use All credits to Sultanxda Ported to OnePlus2 by Lord Boeffla (aka andip71) When the user's finger is on the touchscreen, don't process any home key button presses, as an unintended button press will cause poor UX. Ignore home key presses when the Synaptics s1302 driver is ignoring keypad presses. Signed-off-by: Sultanxda Signed-off-by: flar2 --- drivers/input/misc/fpc1020_tee.c | 14 +++++++++++--- drivers/input/touchscreen/synaptics_driver_s1302.c | 7 +++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/fpc1020_tee.c b/drivers/input/misc/fpc1020_tee.c index 750c0d43a428c..c07150ed636ff 100755 --- a/drivers/input/misc/fpc1020_tee.c +++ b/drivers/input/misc/fpc1020_tee.c @@ -300,16 +300,24 @@ static DEVICE_ATTR(irq, S_IRUSR | S_IWUSR, irq_get, irq_ack); #ifdef VENDOR_EDIT //WayneChang, 2015/12/02, add for key to abs, simulate key in abs through virtual key system extern bool virtual_key_enable; #endif +extern bool s1302_is_keypad_stopped(void); static ssize_t report_home_set(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct fpc1020_data *fpc1020 = dev_get_drvdata(dev); - + + bool ignore_keypad; + + if (s1302_is_keypad_stopped() || virtual_key_enable) + ignore_keypad = true; + else + ignore_keypad = false; + if (!strncmp(buf, "down", strlen("down"))) { #ifdef VENDOR_EDIT //WayneChang, 2015/12/02, add for key to abs, simulate key in abs through virtual key system - if(!virtual_key_enable){ + if(!ignore_keypad){ input_report_key(fpc1020->input_dev, KEY_HOME, 1); input_sync(fpc1020->input_dev); @@ -319,7 +327,7 @@ static ssize_t report_home_set(struct device *dev, else if (!strncmp(buf, "up", strlen("up"))) { #ifdef VENDOR_EDIT //WayneChang, 2015/12/02, add for key to abs, simulate key in abs through virtual key system - if(!virtual_key_enable){ + if(!ignore_keypad){ input_report_key(fpc1020->input_dev, KEY_HOME, 0); input_sync(fpc1020->input_dev); diff --git a/drivers/input/touchscreen/synaptics_driver_s1302.c b/drivers/input/touchscreen/synaptics_driver_s1302.c index 6b7128e3dfe16..a0244a095f5e7 100644 --- a/drivers/input/touchscreen/synaptics_driver_s1302.c +++ b/drivers/input/touchscreen/synaptics_driver_s1302.c @@ -1513,6 +1513,13 @@ static int synaptics_parse_dts(struct device *dev, struct synaptics_ts_data *ts) return rc; } +bool s1302_is_keypad_stopped(void) +{ + struct synaptics_ts_data *ts = tc_g; + + return ts->stop_keypad; +} + static void synaptics_input_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) { From 5a119cc7ed145b41091cedccc0bd75a723f721e5 Mon Sep 17 00:00:00 2001 From: myfluxi Date: Wed, 1 Jan 2014 11:31:16 +0100 Subject: [PATCH 17/75] msm: kgsl: Report correct GPU frequency in sysfs Change-Id: I1aac90d0554b9de0511ffb78042177a5a23855ce Signed-off-by: AudioGod --- drivers/gpu/msm/kgsl_pwrctrl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/msm/kgsl_pwrctrl.c b/drivers/gpu/msm/kgsl_pwrctrl.c index 607bc5c647552..bda746b136b3a 100644 --- a/drivers/gpu/msm/kgsl_pwrctrl.c +++ b/drivers/gpu/msm/kgsl_pwrctrl.c @@ -749,12 +749,19 @@ static ssize_t kgsl_pwrctrl_gpuclk_show(struct device *dev, struct device_attribute *attr, char *buf) { + unsigned long freq; struct kgsl_device *device = kgsl_device_from_dev(dev); struct kgsl_pwrctrl *pwr; if (device == NULL) return 0; pwr = &device->pwrctrl; - return snprintf(buf, PAGE_SIZE, "%ld\n", kgsl_pwrctrl_active_freq(pwr)); + + if (device->state == KGSL_STATE_SLUMBER) + freq = pwr->pwrlevels[pwr->num_pwrlevels - 1].gpu_freq; + else + freq = kgsl_pwrctrl_active_freq(pwr); + + return snprintf(buf, PAGE_SIZE, "%lu\n", freq); } static ssize_t kgsl_pwrctrl_idle_timer_store(struct device *dev, From e9c284e06ddb9f676229e8ba6e67e26f807f84f2 Mon Sep 17 00:00:00 2001 From: yank555-lu Date: Sun, 14 Dec 2014 17:42:48 +0100 Subject: [PATCH 18/75] scripts: remove localversion "+" from kernel version strings Change-Id: I4dccc07bd5dcf5dfb8373772d707b1148e9bedd1 --- scripts/setlocalversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 8fcc5ce057265..09ad65a0c1615 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -184,7 +184,7 @@ else # LOCALVERSION= is not specified if test "${LOCALVERSION+set}" != "set"; then scm=$(scm_version --short) - res="$res${scm:++}" + res="$res" fi fi From b3a0d0f1922177f0cd3595ccfb6f16053108c38e Mon Sep 17 00:00:00 2001 From: arter97 Date: Thu, 11 Jun 2015 00:13:36 +0900 Subject: [PATCH 19/75] Introduce Adreno idler for devfreq-based Adreno devices Adreno idler by arter97 - Idling algorithm, an efficient workaround for msm-adreno-tz's overheads. Main goal is to lower the power consumptions while maintaining high-performance. Since msm-adreno-tz tends to *not* use the lowest frequency even on idle, Adreno idler replaces msm-adreno-tz's algorithm when it comes to calculating idle frequency(mostly by ondemand's method). The higher frequencies are not touched with this algorithm, so high-demanding games will (most likely) not suffer from worsened performance. The additional idle_lasttime detects if last 500ms was idle before ramping down the frequency to prevent micro-lags on scrolling or playing games. Signed-off-by: arter97 --- drivers/devfreq/Kconfig | 17 +++- drivers/devfreq/Makefile | 1 + drivers/devfreq/adreno_idler.c | 122 +++++++++++++++++++++++ drivers/devfreq/governor_msm_adreno_tz.c | 19 ++++ 4 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 drivers/devfreq/adreno_idler.c diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index c6c98558840ca..1150208de71e2 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -132,10 +132,19 @@ config DEVFREQ_GOV_SPDM_HYP bool "MSM SPDM Hypervisor Governor" depends on ARCH_MSM help - Hypervisor based governor for CPU bandwidth voting - for MSM chipsets. - Sets the frequency using a "on-demand" algorithm. - This governor is unlikely to be useful for other devices. + Hypervisor based governor for CPU bandwidth voting + for MSM chipsets. + Sets the frequency using a "on-demand" algorithm. + This governor is unlikely to be useful for other devices. + +config ADRENO_IDLER + tristate "MSM Adreno idler" + depends on DEVFREQ_GOV_MSM_ADRENO_TZ + help + Uses a different calculation method on top of Adreno TZ + just for calculating frequency for idle to reduce the + wasted power coming from stock Adreno TZ while + maintaining high-performance. comment "DEVFREQ Drivers" diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile index e65cfd2f90efe..34c8a42036d48 100644 --- a/drivers/devfreq/Makefile +++ b/drivers/devfreq/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o obj-$(CONFIG_DEVFREQ_GOV_CPUFREQ) += governor_cpufreq.o obj-$(CONFIG_DEVFREQ_GOV_MSM_ADRENO_TZ) += governor_msm_adreno_tz.o +obj-$(CONFIG_ADRENO_IDLER) += adreno_idler.o obj-$(CONFIG_DEVFREQ_GOV_MSM_CPUFREQ) += governor_msm_cpufreq.o obj-$(CONFIG_ARCH_MSM_KRAIT) += krait-l2pm.o obj-$(CONFIG_MSM_BIMC_BWMON) += bimc-bwmon.o diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c new file mode 100644 index 0000000000000..bf61fc88021cb --- /dev/null +++ b/drivers/devfreq/adreno_idler.c @@ -0,0 +1,122 @@ +/* + * Author: Park Ju Hyung aka arter97 + * + * Copyright 2015 Park Ju Hyung + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +/* + * Adreno idler - Idling algorithm, + * an efficient workaround for msm-adreno-tz's overheads. + * + * Main goal is to lower the power consumptions while maintaining high-performance. + * + * Since msm-adreno-tz tends to *not* use the lowest frequency even on idle, + * Adreno idler replaces msm-adreno-tz's algorithm when it comes to + * calculating idle frequency(mostly by ondemand's method). + * The higher frequencies are not touched with this algorithm, so high-demanding + * games will (most likely) not suffer from worsened performance. + * + * The additional idle_lasttime detects if last 500ms was idle before + * ramping down the frequency to prevent micro-lags on scrolling or playing games. + */ + +#include +#include +#include + +#define ADRENO_IDLER_MAJOR_VERSION 1 +#define ADRENO_IDLER_MINOR_VERSION 0 + +/* stats.busy_time threshold for determining if the given workload is idle. + Any workload higher than this will be treated as non-idle workload, + meaning the higher it gets, the slower & low-power it would get. */ +static int idleworkload = 5000; +module_param_named(adreno_idler_idleworkload, idleworkload, int, 0664); + +/* Time to wait for entering idle, measured in milliseconds. + This implementation is to prevent micro-lags on scrolling or playing games, + meaning the lower it gets, the slower & low-power it would get. */ +static int idlewaitms = 500; +module_param_named(adreno_idler_idlewaitms, idlewaitms, int, 0664); + +/* Taken from ondemand */ +static int downdifferenctial = 20; +module_param_named(adreno_idler_downdifferenctial, downdifferenctial, int, 0664); + +/* Master switch to activate whole routine */ +static int adreno_idler_active = 1; +module_param_named(adreno_idler_active, adreno_idler_active, int, 0664); + +static inline int64_t get_time_inms(void) { + int64_t tinms; + struct timespec cur_time = current_kernel_time(); + tinms = cur_time.tv_sec * MSEC_PER_SEC; + tinms += cur_time.tv_nsec / NSEC_PER_MSEC; + return tinms; +} +static int64_t idle_lasttime = 0; + +int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, + unsigned long *freq) +{ + if (!adreno_idler_active) + return 0; + + if (stats.busy_time < idleworkload) { + /* busy_time >= idleworkload should be considered as a non-idle workload. */ + if (!idle_lasttime) + idle_lasttime = get_time_inms(); + if (*freq == devfreq->profile->freq_table[devfreq->profile->max_state - 1]) { + /* frequency is already at its lowest. + No need to calculate things, so bail out. */ + return 1; + } + if (idle_lasttime + idlewaitms <= get_time_inms() && + stats.busy_time * 100 < stats.total_time * downdifferenctial) { + /* We are idle for idlewaitms! Ramp down the frequency now. */ + *freq = devfreq->profile->freq_table[devfreq->profile->max_state - 1]; + return 1; + } + } else { + /* This is the case where msm-adreno-tz don't use the lowest frequency. + Mimic this behavior by bumping up the frequency. */ + idle_lasttime = 0; + *freq = devfreq->profile->freq_table[devfreq->profile->max_state - 2]; + /* Do not return 1 here and allow rest of the algorithm to + figure out the appropriate frequency for current workload. + It can even set it back to lowest frequency. */ + } + return 0; +} +EXPORT_SYMBOL(adreno_idler); + +static int __init adreno_idler_init(void) +{ + pr_info("adreno_idler: version %d.%d by arter97\n", + ADRENO_IDLER_MAJOR_VERSION, + ADRENO_IDLER_MINOR_VERSION); + + return 0; +} +subsys_initcall(adreno_idler_init); + +static void __exit adreno_idler_exit(void) +{ + return; +} +module_exit(adreno_idler_exit); + +MODULE_AUTHOR("Park Ju Hyung "); +MODULE_DESCRIPTION("'adreno_idler - A powersaver for Adreno TZ" + "Control idle algorithm for Adreno GPU series"); +MODULE_LICENSE("GPL"); diff --git a/drivers/devfreq/governor_msm_adreno_tz.c b/drivers/devfreq/governor_msm_adreno_tz.c index e4337d19361b1..0f4ece8d83c6d 100644 --- a/drivers/devfreq/governor_msm_adreno_tz.c +++ b/drivers/devfreq/governor_msm_adreno_tz.c @@ -176,6 +176,11 @@ static int tz_init(struct devfreq_msm_adreno_tz_data *priv, return ret; } +#ifdef CONFIG_ADRENO_IDLER +extern int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, + unsigned long *freq); +#endif + static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, u32 *flag) { @@ -193,7 +198,21 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, return result; } + /* Prevent overflow */ + if (stats.busy_time >= (1 << 24) || stats.total_time >= (1 << 24)) { + stats.busy_time >>= 7; + stats.total_time >>= 7; + } + *freq = stats.current_frequency; + +#ifdef CONFIG_ADRENO_IDLER + if (adreno_idler(stats, devfreq, freq)) { + /* adreno_idler has asked to bail out now */ + return 0; + } +#endif + priv->bin.total_time += stats.total_time; priv->bin.busy_time += stats.busy_time; From bc2f80f87c046375feccc48358fbededad58b5a5 Mon Sep 17 00:00:00 2001 From: arter97 Date: Thu, 11 Jun 2015 22:00:15 +0900 Subject: [PATCH 20/75] adreno_idler: switch to count based instead of time based Asking for current time on every poll(which is usually 10ms) is very inefficient. Switch to count based. The new default for idlewait is set to 20, so every 20 events before must be all idle before Adreno idler ramps down the frequency. Signed-off-by: arter97 --- drivers/devfreq/adreno_idler.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index bf61fc88021cb..e946f5be4df7b 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -43,11 +43,13 @@ static int idleworkload = 5000; module_param_named(adreno_idler_idleworkload, idleworkload, int, 0664); -/* Time to wait for entering idle, measured in milliseconds. +/* Numbers to wait before entering idle. + The idlewait'th events before must be all idle before Adreno idler ramps + down the frequency. This implementation is to prevent micro-lags on scrolling or playing games, meaning the lower it gets, the slower & low-power it would get. */ -static int idlewaitms = 500; -module_param_named(adreno_idler_idlewaitms, idlewaitms, int, 0664); +static int idlewait = 20; +module_param_named(adreno_idler_idlewait, idlewait, int, 0664); /* Taken from ondemand */ static int downdifferenctial = 20; @@ -57,14 +59,7 @@ module_param_named(adreno_idler_downdifferenctial, downdifferenctial, int, 0664) static int adreno_idler_active = 1; module_param_named(adreno_idler_active, adreno_idler_active, int, 0664); -static inline int64_t get_time_inms(void) { - int64_t tinms; - struct timespec cur_time = current_kernel_time(); - tinms = cur_time.tv_sec * MSEC_PER_SEC; - tinms += cur_time.tv_nsec / NSEC_PER_MSEC; - return tinms; -} -static int64_t idle_lasttime = 0; +static unsigned int idlecount = 0; int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, unsigned long *freq) @@ -74,23 +69,23 @@ int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, if (stats.busy_time < idleworkload) { /* busy_time >= idleworkload should be considered as a non-idle workload. */ - if (!idle_lasttime) - idle_lasttime = get_time_inms(); + idlecount++; if (*freq == devfreq->profile->freq_table[devfreq->profile->max_state - 1]) { /* frequency is already at its lowest. No need to calculate things, so bail out. */ return 1; } - if (idle_lasttime + idlewaitms <= get_time_inms() && + if (idlecount >= idlewait && stats.busy_time * 100 < stats.total_time * downdifferenctial) { /* We are idle for idlewaitms! Ramp down the frequency now. */ *freq = devfreq->profile->freq_table[devfreq->profile->max_state - 1]; + idlecount--; return 1; } } else { /* This is the case where msm-adreno-tz don't use the lowest frequency. Mimic this behavior by bumping up the frequency. */ - idle_lasttime = 0; + idlecount = 0; *freq = devfreq->profile->freq_table[devfreq->profile->max_state - 2]; /* Do not return 1 here and allow rest of the algorithm to figure out the appropriate frequency for current workload. From c2aa46b14635b6ea01d47a62e401d4cd6a5638f2 Mon Sep 17 00:00:00 2001 From: arter97 Date: Thu, 11 Jun 2015 22:01:45 +0900 Subject: [PATCH 21/75] adreno_idler: remove frequency bump Allow msm-adreno-tz to figure out the appropriate frequency for the current workload. We don't need to bump up the frequency within the Adreno idler's routine. This should give some extra plus to power savings. Bump up to version 1.1. Signed-off-by: arter97 --- drivers/devfreq/adreno_idler.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index e946f5be4df7b..3a5a089b60b98 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -35,7 +35,7 @@ #include #define ADRENO_IDLER_MAJOR_VERSION 1 -#define ADRENO_IDLER_MINOR_VERSION 0 +#define ADRENO_IDLER_MINOR_VERSION 1 /* stats.busy_time threshold for determining if the given workload is idle. Any workload higher than this will be treated as non-idle workload, @@ -83,10 +83,7 @@ int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, return 1; } } else { - /* This is the case where msm-adreno-tz don't use the lowest frequency. - Mimic this behavior by bumping up the frequency. */ idlecount = 0; - *freq = devfreq->profile->freq_table[devfreq->profile->max_state - 2]; /* Do not return 1 here and allow rest of the algorithm to figure out the appropriate frequency for current workload. It can even set it back to lowest frequency. */ From 2244c0f12c463a700e2cab53664d0e82795701bc Mon Sep 17 00:00:00 2001 From: arter97 Date: Thu, 11 Jun 2015 22:17:18 +0900 Subject: [PATCH 22/75] adreno_idler: fix-up type definitions Signed-off-by: arter97 --- drivers/devfreq/adreno_idler.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index 3a5a089b60b98..4d97965db0b04 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -40,24 +40,24 @@ /* stats.busy_time threshold for determining if the given workload is idle. Any workload higher than this will be treated as non-idle workload, meaning the higher it gets, the slower & low-power it would get. */ -static int idleworkload = 5000; -module_param_named(adreno_idler_idleworkload, idleworkload, int, 0664); +static unsigned long idleworkload = 5000; +module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); /* Numbers to wait before entering idle. The idlewait'th events before must be all idle before Adreno idler ramps down the frequency. This implementation is to prevent micro-lags on scrolling or playing games, meaning the lower it gets, the slower & low-power it would get. */ -static int idlewait = 20; -module_param_named(adreno_idler_idlewait, idlewait, int, 0664); +static unsigned int idlewait = 20; +module_param_named(adreno_idler_idlewait, idlewait, uint, 0664); /* Taken from ondemand */ -static int downdifferenctial = 20; -module_param_named(adreno_idler_downdifferenctial, downdifferenctial, int, 0664); +static unsigned int downdifferenctial = 20; +module_param_named(adreno_idler_downdifferenctial, downdifferenctial, uint, 0664); /* Master switch to activate whole routine */ -static int adreno_idler_active = 1; -module_param_named(adreno_idler_active, adreno_idler_active, int, 0664); +static bool adreno_idler_active = true; +module_param_named(adreno_idler_active, adreno_idler_active, bool, 0664); static unsigned int idlecount = 0; From 83e8f5d3a011953d559754850c81e698e2178caa Mon Sep 17 00:00:00 2001 From: arter97 Date: Sun, 14 Jun 2015 03:37:30 +0900 Subject: [PATCH 23/75] adreno_idler: fix-up some comments Signed-off-by: arter97 --- drivers/devfreq/adreno_idler.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index 4d97965db0b04..bdfad4da2d1bb 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -25,9 +25,6 @@ * calculating idle frequency(mostly by ondemand's method). * The higher frequencies are not touched with this algorithm, so high-demanding * games will (most likely) not suffer from worsened performance. - * - * The additional idle_lasttime detects if last 500ms was idle before - * ramping down the frequency to prevent micro-lags on scrolling or playing games. */ #include @@ -38,16 +35,18 @@ #define ADRENO_IDLER_MINOR_VERSION 1 /* stats.busy_time threshold for determining if the given workload is idle. - Any workload higher than this will be treated as non-idle workload, - meaning the higher it gets, the slower & low-power it would get. */ + Any workload higher than this will be treated as a non-idle workload. + Adreno idler will more actively try to ramp down the frequency + if this is set to a higher value. */ static unsigned long idleworkload = 5000; module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); -/* Numbers to wait before entering idle. - The idlewait'th events before must be all idle before Adreno idler ramps - down the frequency. - This implementation is to prevent micro-lags on scrolling or playing games, - meaning the lower it gets, the slower & low-power it would get. */ +/* Number of events to wait before ramping down the frequency. + The idlewait'th events before current one must be all idle before + Adreno idler ramps down the frequency. + This implementation is to prevent micro-lags on scrolling or playing games. + Adreno idler will more actively try to ramp down the frequency + if this is set to a lower value. */ static unsigned int idlewait = 20; module_param_named(adreno_idler_idlewait, idlewait, uint, 0664); @@ -55,7 +54,7 @@ module_param_named(adreno_idler_idlewait, idlewait, uint, 0664); static unsigned int downdifferenctial = 20; module_param_named(adreno_idler_downdifferenctial, downdifferenctial, uint, 0664); -/* Master switch to activate whole routine */ +/* Master switch to activate the whole routine */ static bool adreno_idler_active = true; module_param_named(adreno_idler_active, adreno_idler_active, bool, 0664); @@ -71,13 +70,13 @@ int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, /* busy_time >= idleworkload should be considered as a non-idle workload. */ idlecount++; if (*freq == devfreq->profile->freq_table[devfreq->profile->max_state - 1]) { - /* frequency is already at its lowest. + /* Frequency is already at its lowest. No need to calculate things, so bail out. */ return 1; } if (idlecount >= idlewait && stats.busy_time * 100 < stats.total_time * downdifferenctial) { - /* We are idle for idlewaitms! Ramp down the frequency now. */ + /* We are idle for (idlewait + 1)'th time! Ramp down the frequency now. */ *freq = devfreq->profile->freq_table[devfreq->profile->max_state - 1]; idlecount--; return 1; @@ -86,7 +85,7 @@ int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, idlecount = 0; /* Do not return 1 here and allow rest of the algorithm to figure out the appropriate frequency for current workload. - It can even set it back to lowest frequency. */ + It can even set it back to the lowest frequency. */ } return 0; } From bbf9cc51acd26519930ea4eefbabf01d5c418f8d Mon Sep 17 00:00:00 2001 From: arter97 Date: Sun, 14 Jun 2015 19:37:45 +0900 Subject: [PATCH 24/75] adreno_idler: fix typos :) Signed-off-by: arter97 --- drivers/devfreq/adreno_idler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index bdfad4da2d1bb..0e6cd27b1b1c0 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -51,8 +51,8 @@ static unsigned int idlewait = 20; module_param_named(adreno_idler_idlewait, idlewait, uint, 0664); /* Taken from ondemand */ -static unsigned int downdifferenctial = 20; -module_param_named(adreno_idler_downdifferenctial, downdifferenctial, uint, 0664); +static unsigned int downdifferential = 20; +module_param_named(adreno_idler_downdifferential, downdifferential, uint, 0664); /* Master switch to activate the whole routine */ static bool adreno_idler_active = true; @@ -75,7 +75,7 @@ int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, return 1; } if (idlecount >= idlewait && - stats.busy_time * 100 < stats.total_time * downdifferenctial) { + stats.busy_time * 100 < stats.total_time * downdifferential) { /* We are idle for (idlewait + 1)'th time! Ramp down the frequency now. */ *freq = devfreq->profile->freq_table[devfreq->profile->max_state - 1]; idlecount--; From bb1df92fef6a701032022f60b30164af19c2bdff Mon Sep 17 00:00:00 2001 From: Joe Maples Date: Thu, 30 Jun 2016 21:33:52 +0000 Subject: [PATCH 25/75] adreno idler: Ramp down more agressively Signed-off-by: Joe Maples --- drivers/devfreq/adreno_idler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index 0e6cd27b1b1c0..b3aa89c88a87c 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -47,7 +47,7 @@ module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); This implementation is to prevent micro-lags on scrolling or playing games. Adreno idler will more actively try to ramp down the frequency if this is set to a lower value. */ -static unsigned int idlewait = 20; +static unsigned int idlewait = 15; module_param_named(adreno_idler_idlewait, idlewait, uint, 0664); /* Taken from ondemand */ From c87177cc4a98f450bcd0755ca808b6fd9a511980 Mon Sep 17 00:00:00 2001 From: benschhold Date: Mon, 26 Sep 2016 10:00:27 +0200 Subject: [PATCH 26/75] defconfig:adreno idler Change-Id: I4f1744727e4ec078262bd9886dda106a3a97fab2 --- arch/arm64/configs/cm_oneplus2_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index 61bc7de188759..396b31ca36543 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -585,3 +585,4 @@ CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y CONFIG_CRYPTO_CRC32_ARM64=y CONFIG_QMI_ENCDEC=y CONFIG_MSM_HOTPLUG=y +CONFIG_ADRENO_IDLER=y From 44a4dc6cfc3f8e88d46d3bb319f5720105e093ed Mon Sep 17 00:00:00 2001 From: auras76 Date: Sun, 10 Apr 2016 14:46:54 +0200 Subject: [PATCH 27/75] sound/soc/codecs: Faux Sound control for WCD9330 TomTom codec driver Faux Sound control adapted for the wcd9330 driver. Signed-off-by: flar2 Change-Id: I881d8a1e0f83abd4e9ac8472b86e8b30ec5813db --- arch/arm64/configs/cm_oneplus2_defconfig | 1 + sound/soc/codecs/Kconfig | 6 + sound/soc/codecs/Makefile | 6 +- sound/soc/codecs/sound_control_3_gpl.c | 279 +++++++++++++++++++++++ sound/soc/codecs/wcd9330.c | 27 ++- 5 files changed, 316 insertions(+), 3 deletions(-) create mode 100644 sound/soc/codecs/sound_control_3_gpl.c diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index 396b31ca36543..e08e59d634357 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -586,3 +586,4 @@ CONFIG_CRYPTO_CRC32_ARM64=y CONFIG_QMI_ENCDEC=y CONFIG_MSM_HOTPLUG=y CONFIG_ADRENO_IDLER=y +CONFIG_SOUND_CONTROL_HAX_3_GPL=y diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 9e25c1ba8d56e..14bda114f9070 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -559,3 +559,9 @@ config SND_SOC_MSM_HDMI_CODEC_RX help HDMI audio drivers should be built only if the platform supports hdmi panel. + +config SOUND_CONTROL_HAX_3_GPL + tristate "new wcd93xx sound control hax" + default y + help + FauxSound WCD93xx chipset sound control hacks 3.0 for deeper hax diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 47a8decc23663..b78991c93ab5d 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -38,6 +38,7 @@ snd-soc-max9768-objs := max9768.o snd-soc-max98088-objs := max98088.o snd-soc-max98090-objs := max98090.o snd-soc-max98095-objs := max98095.o +snd-soc-max98925-objs := max98925.o snd-soc-max9850-objs := max9850.o snd-soc-mc13783-objs := mc13783.o snd-soc-ml26124-objs := ml26124.o @@ -273,10 +274,13 @@ obj-$(CONFIG_SND_SOC_MSM_STUB) += snd-soc-msm-stub.o # Amp obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o +obj-$(CONFIG_SND_SOC_MAX98925) += snd-soc-max98925.o obj-$(CONFIG_SND_SOC_TPA6130A2) += snd-soc-tpa6130a2.o #ifdef VENDOR_EDIT #tfa9890 snd-soc-tfa9890-objs := tfa9890/tfa98xx.o tfa9890/tfa_dsp.o tfa9890/tfa_container.o obj-y += snd-soc-tfa9890.o -#endif \ No newline at end of file +#endif + +obj-$(CONFIG_SOUND_CONTROL_HAX_3_GPL) += sound_control_3_gpl.o \ No newline at end of file diff --git a/sound/soc/codecs/sound_control_3_gpl.c b/sound/soc/codecs/sound_control_3_gpl.c new file mode 100644 index 0000000000000..86c1c468af7ca --- /dev/null +++ b/sound/soc/codecs/sound_control_3_gpl.c @@ -0,0 +1,279 @@ +/* + * Author: Paul Reioux aka Faux123 + * + * WCD93xx sound control module + * Copyright 2013 Paul Reioux + * + * Adapted to WCD9330 TomTom codec driver + * Pafcholini + * Thanks to Thehacker911 for the tip + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#include +#include +#include +#include + +#define SOUND_CONTROL_MAJOR_VERSION 3 +#define SOUND_CONTROL_MINOR_VERSION 0 + +extern struct snd_soc_codec *fauxsound_codec_ptr; + +unsigned int tomtom_read(struct snd_soc_codec *codec, unsigned int reg); +int tomtom_write(struct snd_soc_codec *codec, unsigned int reg, + unsigned int value); + +static bool calc_checksum(unsigned int a, unsigned int b, unsigned int c) +{ + unsigned char chksum = 0; + + chksum = ~((a & 0xff) + (b & 0xff)); + + if (chksum == (c & 0xff)) { + return true; + } else { + return false; + } +} + +static ssize_t cam_mic_gain_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + return sprintf(buf, "%u", + tomtom_read(fauxsound_codec_ptr, + TOMTOM_A_CDC_TX6_VOL_CTL_GAIN)); + +} + +static ssize_t cam_mic_gain_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + unsigned int lval, chksum; + + sscanf(buf, "%u %u", &lval, &chksum); + + if (calc_checksum(lval, 0, chksum)) { + tomtom_write(fauxsound_codec_ptr, + TOMTOM_A_CDC_TX6_VOL_CTL_GAIN, lval); + } + return count; +} + +static ssize_t mic_gain_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + return sprintf(buf, "%u", + tomtom_read(fauxsound_codec_ptr, + TOMTOM_A_CDC_TX7_VOL_CTL_GAIN)); +} + +static ssize_t mic_gain_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + unsigned int lval, chksum; + + sscanf(buf, "%u %u", &lval, &chksum); + + if (calc_checksum(lval, 0, chksum)) { + tomtom_write(fauxsound_codec_ptr, + TOMTOM_A_CDC_TX7_VOL_CTL_GAIN, lval); + } + return count; + +} + +static ssize_t speaker_gain_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + return sprintf(buf, "%u %u", + tomtom_read(fauxsound_codec_ptr, + TOMTOM_A_CDC_RX7_VOL_CTL_B2_CTL), + tomtom_read(fauxsound_codec_ptr, + TOMTOM_A_CDC_RX7_VOL_CTL_B2_CTL)); + +} + +static ssize_t speaker_gain_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + unsigned int lval, rval, chksum; + + sscanf(buf, "%u %u %u", &lval, &rval, &chksum); + + if (calc_checksum(lval, rval, chksum)) { + tomtom_write(fauxsound_codec_ptr, + TOMTOM_A_CDC_RX7_VOL_CTL_B2_CTL, lval); + tomtom_write(fauxsound_codec_ptr, + TOMTOM_A_CDC_RX7_VOL_CTL_B2_CTL, rval); + } + return count; +} + +static ssize_t headphone_gain_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + return sprintf(buf, "%u %u", + tomtom_read(fauxsound_codec_ptr, + TOMTOM_A_CDC_RX1_VOL_CTL_B2_CTL), + tomtom_read(fauxsound_codec_ptr, + TOMTOM_A_CDC_RX2_VOL_CTL_B2_CTL)); +} + +static ssize_t headphone_gain_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + unsigned int lval, rval, chksum; + + sscanf(buf, "%u %u %u", &lval, &rval, &chksum); + + if (calc_checksum(lval, rval, chksum)) { + tomtom_write(fauxsound_codec_ptr, + TOMTOM_A_CDC_RX1_VOL_CTL_B2_CTL, lval); + tomtom_write(fauxsound_codec_ptr, + TOMTOM_A_CDC_RX2_VOL_CTL_B2_CTL, rval); + } + return count; +} + +static ssize_t headphone_pa_gain_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + return sprintf(buf, "%u %u", + tomtom_read(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_L_GAIN), + tomtom_read(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_R_GAIN)); +} + +static ssize_t headphone_pa_gain_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + unsigned int lval, rval, chksum; + unsigned int gain, status; + unsigned int out; + + sscanf(buf, "%u %u %u", &lval, &rval, &chksum); + + if (calc_checksum(lval, rval, chksum)) { + gain = tomtom_read(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_L_GAIN); + out = (gain & 0xf0) | lval; + tomtom_write(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_L_GAIN, out); + + status = tomtom_read(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_L_STATUS); + out = (status & 0x0f) | (lval << 4); + tomtom_write(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_L_STATUS, out); + + gain = tomtom_read(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_R_GAIN); + out = (gain & 0xf0) | rval; + tomtom_write(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_R_GAIN, out); + + status = tomtom_read(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_R_STATUS); + out = (status & 0x0f) | (rval << 4); + tomtom_write(fauxsound_codec_ptr, TOMTOM_A_RX_HPH_R_STATUS, out); + } + return count; +} + +static ssize_t sound_control_version_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) +{ + return sprintf(buf, "version: %u.%u\n", + SOUND_CONTROL_MAJOR_VERSION, + SOUND_CONTROL_MINOR_VERSION); +} + +static struct kobj_attribute cam_mic_gain_attribute = + __ATTR(gpl_cam_mic_gain, + 0666, + cam_mic_gain_show, + cam_mic_gain_store); + +static struct kobj_attribute mic_gain_attribute = + __ATTR(gpl_mic_gain, + 0666, + mic_gain_show, + mic_gain_store); + +static struct kobj_attribute speaker_gain_attribute = + __ATTR(gpl_speaker_gain, + 0666, + speaker_gain_show, + speaker_gain_store); + +static struct kobj_attribute headphone_gain_attribute = + __ATTR(gpl_headphone_gain, + 0666, + headphone_gain_show, + headphone_gain_store); + +static struct kobj_attribute headphone_pa_gain_attribute = + __ATTR(gpl_headphone_pa_gain, + 0666, + headphone_pa_gain_show, + headphone_pa_gain_store); + +static struct kobj_attribute sound_control_version_attribute = + __ATTR(gpl_sound_control_version, + 0444, + sound_control_version_show, NULL); + +static struct attribute *sound_control_attrs[] = + { + &cam_mic_gain_attribute.attr, + &mic_gain_attribute.attr, + &speaker_gain_attribute.attr, + &headphone_gain_attribute.attr, + &headphone_pa_gain_attribute.attr, + &sound_control_version_attribute.attr, + NULL, + }; + +static struct attribute_group sound_control_attr_group = + { + .attrs = sound_control_attrs, + }; + +static struct kobject *sound_control_kobj; + +static int sound_control_init(void) +{ + int sysfs_result; + + sound_control_kobj = + kobject_create_and_add("sound_control_3", kernel_kobj); + + if (!sound_control_kobj) { + pr_err("%s sound_control_kobj create failed!\n", + __FUNCTION__); + return -ENOMEM; + } + + sysfs_result = sysfs_create_group(sound_control_kobj, + &sound_control_attr_group); + + if (sysfs_result) { + pr_info("%s sysfs create failed!\n", __FUNCTION__); + kobject_put(sound_control_kobj); + } + return sysfs_result; +} + +static void sound_control_exit(void) +{ + if (sound_control_kobj != NULL) + kobject_put(sound_control_kobj); +} + +module_init(sound_control_init); +module_exit(sound_control_exit); +MODULE_LICENSE("GPL and additional rights"); +MODULE_AUTHOR("Paul Reioux "); +MODULE_DESCRIPTION("Sound Control Module 3.x"); diff --git a/sound/soc/codecs/wcd9330.c b/sound/soc/codecs/wcd9330.c index 12130f6ccf8ae..ea4aee0a7e3f1 100644 --- a/sound/soc/codecs/wcd9330.c +++ b/sound/soc/codecs/wcd9330.c @@ -5505,7 +5505,10 @@ static int tomtom_volatile(struct snd_soc_codec *ssc, unsigned int reg) return 0; } -static int tomtom_write(struct snd_soc_codec *codec, unsigned int reg, +#ifndef CONFIG_SOUND_CONTROL_HAX_3_GPL +static +#endif +int tomtom_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) { int ret; @@ -5530,7 +5533,14 @@ static int tomtom_write(struct snd_soc_codec *codec, unsigned int reg, } else return wcd9xxx_reg_write(&wcd9xxx->core_res, reg, value); } -static unsigned int tomtom_read(struct snd_soc_codec *codec, +#ifdef CONFIG_SOUND_CONTROL_HAX_3_GPL +EXPORT_SYMBOL(tomtom_write); +#endif + +#ifndef CONFIG_SOUND_CONTROL_HAX_3_GPL +static +#endif +unsigned int tomtom_read(struct snd_soc_codec *codec, unsigned int reg) { unsigned int val; @@ -5562,6 +5572,9 @@ static unsigned int tomtom_read(struct snd_soc_codec *codec, return val; } } +#ifdef CONFIG_SOUND_CONTROL_HAX_3_GPL +EXPORT_SYMBOL(tomtom_read); +#endif static int tomtom_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) @@ -8909,6 +8922,11 @@ static int tomtom_cpe_initialize(struct snd_soc_codec *codec) return 0; } +#ifdef CONFIG_SOUND_CONTROL_HAX_3_GPL +struct snd_soc_codec *fauxsound_codec_ptr; +EXPORT_SYMBOL(fauxsound_codec_ptr); +#endif + static int tomtom_codec_probe(struct snd_soc_codec *codec) { struct wcd9xxx *control; @@ -8921,6 +8939,11 @@ static int tomtom_codec_probe(struct snd_soc_codec *codec) void *ptr = NULL; struct wcd9xxx_core_resource *core_res; +#ifdef CONFIG_SOUND_CONTROL_HAX_3_GPL + pr_info("tomtom codec probe...\n"); + fauxsound_codec_ptr = codec; +#endif + codec->control_data = dev_get_drvdata(codec->dev->parent); control = codec->control_data; From aa10f3bbff5fe3fba929370781aad6445c982a98 Mon Sep 17 00:00:00 2001 From: AudioGod Date: Sat, 7 Nov 2015 01:24:25 +0530 Subject: [PATCH 28/75] Disable crc check for 30% extra performance in IO Signed-off-by: AudioGod --- drivers/mmc/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index aa2ec382575ef..2e4c2eea37fb2 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -69,7 +69,7 @@ static const unsigned freqs[] = { 400000, 300000, 200000, 100000 }; * performance cost, and for other reasons may not always be desired. * So we allow it it to be disabled. */ -bool use_spi_crc = 1; +bool use_spi_crc = 0; module_param(use_spi_crc, bool, 0); /* From 3ea93ab08e596e6e7a4e2a90b7254c20236cae2e Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 9 Sep 2016 09:56:38 +0200 Subject: [PATCH 29/75] Underclock Change-Id: I011f9c6fbcc23f1d9c1f189b926bc125ff15ae50 --- arch/arm/boot/dts/qcom/msm8994-regulator.dtsi | 8 ++++---- arch/arm/boot/dts/qcom/msm8994-v2.dtsi | 14 +++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/qcom/msm8994-regulator.dtsi b/arch/arm/boot/dts/qcom/msm8994-regulator.dtsi index c1975c3575804..9fa9b759f8aa0 100644 --- a/arch/arm/boot/dts/qcom/msm8994-regulator.dtsi +++ b/arch/arm/boot/dts/qcom/msm8994-regulator.dtsi @@ -717,8 +717,8 @@ qcom,cpr-voltage-scaling-factor-max = <0 0 2000 2000>; qcom,cpr-quot-adjust-scaling-factor-max = <0 2000 2000 2000>; qcom,cpr-corner-frequency-map = - <1 300000000>, /* SVS Fmin for SVS2 */ - <2 300000000>, + <1 302400000>, /* SVS Fmin for SVS2 */ + <2 302400000>, <3 384000000>, <4 460800000>, <5 600000000>, @@ -950,8 +950,8 @@ qcom,cpr-voltage-scaling-factor-max = <0 0 2000 2000>; qcom,cpr-quot-adjust-scaling-factor-max = <0 2000 2000 2000>; qcom,cpr-corner-frequency-map = - <1 300000000>, /* SVS Fmin for "SVS2" */ - <2 300000000>, + <1 302400000>, /* SVS Fmin for "SVS2" */ + <2 302400000>, <3 384000000>, <4 480000000>, <5 633600000>, diff --git a/arch/arm/boot/dts/qcom/msm8994-v2.dtsi b/arch/arm/boot/dts/qcom/msm8994-v2.dtsi index a55f94a83941e..af67f88d56a2e 100644 --- a/arch/arm/boot/dts/qcom/msm8994-v2.dtsi +++ b/arch/arm/boot/dts/qcom/msm8994-v2.dtsi @@ -73,6 +73,7 @@ vdd-dig-supply = <&pm8994_s2_corner_ao>; qcom,a53-speedbin0-v0 = < 0 0>, + < 302400000 1>, < 384000000 3>, < 460800000 4>, < 600000000 5>, @@ -86,6 +87,7 @@ < 1555200000 13>; qcom,a57-speedbin0-v0 = < 0 0>, + < 302400000 5>, < 384000000 5>, < 480000000 5>, < 633600000 5>, @@ -102,6 +104,7 @@ < 1958400000 17>; qcom,a57-speedbin1-v0 = < 0 0>, + < 302400000 5>, < 384000000 5>, < 480000000 5>, < 633600000 5>, @@ -116,6 +119,7 @@ < 1766400000 15>; qcom,cci-speedbin0-v0 = < 0 0>, + < 302400000 4>, < 300000000 4>, < 384000000 5>, < 537600000 7>, @@ -126,7 +130,7 @@ &cci_cache { freq-tbl-khz = - < 300000 >, + < 302400 >, < 384000 >, < 537600 >, < 600000 >, @@ -136,6 +140,7 @@ &msm_cpufreq { qcom,cpufreq-table-0 = + < 302400 >, < 384000 >, < 460800 >, < 600000 >, @@ -149,6 +154,7 @@ < 1555200 >; qcom,cpufreq-table-4 = + < 302400 >, < 384000 >, < 480000 >, < 633600 >, @@ -168,6 +174,7 @@ &devfreq_cpufreq { cpubw-cpufreq { cpu-to-dev-map-0 = + < 302400 1525 >, < 384000 1525 >, < 460800 1525 >, < 600000 1525 >, @@ -180,6 +187,7 @@ < 1478400 11863 >, < 1555200 11863 >; cpu-to-dev-map-4 = + < 302400 1525 >, < 384000 1525 >, < 480000 2288 >, < 633600 2288 >, @@ -199,6 +207,7 @@ mincpubw-cpufreq { target-dev = <&mincpubw>; cpu-to-dev-map-0 = + < 302400 1525 >, < 384000 1525 >, < 460800 1525 >, < 600000 1525 >, @@ -211,6 +220,7 @@ < 1478400 1525 >, < 1555200 1525 >; cpu-to-dev-map-4 = + < 302400 1525 >, < 384000 1525 >, < 480000 1525 >, < 633600 1525 >, @@ -229,6 +239,7 @@ cci-cpufreq { cpu-to-dev-map-0 = + < 302400 300000 >, < 384000 300000 >, < 460800 300000 >, < 600000 300000 >, @@ -241,6 +252,7 @@ < 1478400 787200 >, < 1555200 787200 >; cpu-to-dev-map-4 = + < 302400 300000 >, < 384000 300000 >, < 480000 300000 >, < 633600 384000 >, From 7aef917879ee55f9c68ee9d6db5717310792794c Mon Sep 17 00:00:00 2001 From: benschhold Date: Wed, 16 Nov 2016 18:32:38 +0100 Subject: [PATCH 30/75] call it minimalistic --- arch/arm64/configs/cm_oneplus2_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index e08e59d634357..c0803dfd45e2a 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -1,4 +1,4 @@ -CONFIG_LOCALVERSION="-inline" +CONFIG_LOCALVERSION="-minimalistic" CONFIG_SYSVIPC=y CONFIG_AUDIT=y CONFIG_NO_HZ=y From d7b09b2f11c58610d81523a02685781b0d8e94ae Mon Sep 17 00:00:00 2001 From: benschhold Date: Wed, 16 Nov 2016 19:06:30 +0100 Subject: [PATCH 31/75] Revert "correct that" This reverts commit 001bc227f82ae7c0e1d80a9d287927fdeb02bbbd. --- drivers/input/misc/fpc1020_tee.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/input/misc/fpc1020_tee.c b/drivers/input/misc/fpc1020_tee.c index c07150ed636ff..46898e593d895 100755 --- a/drivers/input/misc/fpc1020_tee.c +++ b/drivers/input/misc/fpc1020_tee.c @@ -988,22 +988,24 @@ static void __cpuinit msm_hotplug_resume_call(struct work_struct *msm_hotplug_re static DECLARE_WORK(msm_hotplug_resume_call_work, msm_hotplug_resume_call); #endif - static irqreturn_t fpc1020_irq_handler(int irq, void *handle) - { - struct fpc1020_data *fpc1020 = handle; - dev_dbg(fpc1020->dev, "%s\n", __func__); - - /* Make sure 'wakeup_enabled' is updated before using it - ** since this is interrupt context (other thread...) */ - smp_rmb(); - - if (fpc1020->wakeup_enabled) { - wake_lock_timeout(&fpc1020->ttw_wl, msecs_to_jiffies(FPC_TTW_HOLD_TIME)); +static irqreturn_t fpc1020_irq_handler(int irq, void *handle) +{ + struct fpc1020_data *fpc1020 = handle; + //dev_info(fpc1020->dev, "%s\n", __func__); + + /* Make sure 'wakeup_enabled' is updated before using it + ** since this is interrupt context (other thread...) */ + smp_rmb(); +/* + if (fpc1020->wakeup_enabled ) { + wake_lock_timeout(&fpc1020->ttw_wl, msecs_to_jiffies(FPC_TTW_HOLD_TIME)); + } +*/ #ifdef CONFIG_MSM_HOTPLUG if (msm_enabled && msm_hotplug_scr_suspended && !msm_hotplug_fingerprint_called) { msm_hotplug_fingerprint_called = true; - schedule_work(&msm_hotplug_resume_call_work); + schedule_work(&msm_hotplug_resume_call_work); } #endif From 2c304725a4fe99994654bac35982d9c1dbaff746 Mon Sep 17 00:00:00 2001 From: benschhold Date: Wed, 16 Nov 2016 19:10:25 +0100 Subject: [PATCH 32/75] correct that --- drivers/input/misc/fpc1020_tee.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/fpc1020_tee.c b/drivers/input/misc/fpc1020_tee.c index 46898e593d895..b8b3977ecee9f 100755 --- a/drivers/input/misc/fpc1020_tee.c +++ b/drivers/input/misc/fpc1020_tee.c @@ -996,11 +996,9 @@ static irqreturn_t fpc1020_irq_handler(int irq, void *handle) /* Make sure 'wakeup_enabled' is updated before using it ** since this is interrupt context (other thread...) */ smp_rmb(); -/* + if (fpc1020->wakeup_enabled ) { wake_lock_timeout(&fpc1020->ttw_wl, msecs_to_jiffies(FPC_TTW_HOLD_TIME)); - } -*/ #ifdef CONFIG_MSM_HOTPLUG if (msm_enabled && msm_hotplug_scr_suspended && !msm_hotplug_fingerprint_called) { @@ -1008,6 +1006,9 @@ static irqreturn_t fpc1020_irq_handler(int irq, void *handle) schedule_work(&msm_hotplug_resume_call_work); } #endif + } + + wake_lock_timeout(&fpc1020->ttw_wl, msecs_to_jiffies(FPC_TTW_HOLD_TIME));//changhua add for KeyguardUpdateMonitor: fingerprint acquired, grabbing fp wakelock sysfs_notify(&fpc1020->dev->kobj, NULL, dev_attr_irq.attr.name); From c6d1d2ab4d59118c72405e6a17b402b672759f46 Mon Sep 17 00:00:00 2001 From: benschhold Date: Sun, 14 Feb 2016 11:38:33 +0100 Subject: [PATCH 33/75] KCAL support --- drivers/video/msm/mdss/Kconfig | 7 + drivers/video/msm/mdss/Makefile | 1 + drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c | 484 ++++++++++++++++++++ 3 files changed, 492 insertions(+) create mode 100644 drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c diff --git a/drivers/video/msm/mdss/Kconfig b/drivers/video/msm/mdss/Kconfig index 3029d0ef7498b..f1cb76dadd4de 100644 --- a/drivers/video/msm/mdss/Kconfig +++ b/drivers/video/msm/mdss/Kconfig @@ -62,3 +62,10 @@ config FB_MSM_MDSS_XLOG_DEBUG features to: Dump MDSS registers during driver errors, panic driver during fatal errors and enable some display-driver logging into an internal buffer (this avoids logging overhead). + +config FB_MSM_MDSS_KCAL_CTRL + depends on FB_MSM_MDSS + bool "MDSS color control" + ---help--- + Enable sysfs for post-processing control of mdss-mdp5 display + controllers in MDSS. diff --git a/drivers/video/msm/mdss/Makefile b/drivers/video/msm/mdss/Makefile index 05acf92c25ef6..8b423631f114d 100644 --- a/drivers/video/msm/mdss/Makefile +++ b/drivers/video/msm/mdss/Makefile @@ -53,3 +53,4 @@ obj-$(CONFIG_FB_MSM_MDSS) += mdss_fb.o mdss_util.o obj-$(CONFIG_COMPAT) += mdss_compat_utils.o obj-$(CONFIG_FB_MSM_MDSS) += mdss_livedisplay.o +obj-$(CONFIG_FB_MSM_MDSS_KCAL_CTRL) += mdss_mdp_kcal_ctrl.o diff --git a/drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c b/drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c new file mode 100644 index 0000000000000..fa38f7627856c --- /dev/null +++ b/drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. + * Copyright (c) 2013, LGE Inc. All rights reserved + * Copyright (c) 2014 savoca + * Copyright (c) 2014 Paul Reioux + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include "mdss_mdp.h" + +#define DEF_PCC 0x100 +#define DEF_PA 0xff +#define PCC_ADJ 0x80 + +struct kcal_lut_data { + int red; + int green; + int blue; + int minimum; + int enable; + int invert; + int sat; + int hue; + int val; + int cont; +}; + +static int mdss_mdp_kcal_display_commit(void) +{ + int i; + int ret = 0; + struct mdss_mdp_ctl *ctl; + struct mdss_data_type *mdata = mdss_mdp_get_mdata(); + + for (i = 0; i < mdata->nctl; i++) { + ctl = mdata->ctl_off + i; + /* pp setup requires mfd */ + if (mdss_mdp_ctl_is_power_on(ctl) && ctl->mfd && + ctl->mfd->index == 0) { + ret = mdss_mdp_pp_setup(ctl); + if (ret) + pr_err("%s: setup failed: %d\n", __func__, ret); + } + } + + return ret; +} + +static void mdss_mdp_kcal_update_pcc(struct kcal_lut_data *lut_data) +{ + u32 copyback = 0; + struct mdp_pcc_cfg_data pcc_config; + + memset(&pcc_config, 0, sizeof(struct mdp_pcc_cfg_data)); + + lut_data->red = lut_data->red < lut_data->minimum ? + lut_data->minimum : lut_data->red; + lut_data->green = lut_data->green < lut_data->minimum ? + lut_data->minimum : lut_data->green; + lut_data->blue = lut_data->blue < lut_data->minimum ? + lut_data->minimum : lut_data->blue; + + pcc_config.block = MDP_LOGICAL_BLOCK_DISP_0; + pcc_config.ops = lut_data->enable ? + MDP_PP_OPS_WRITE | MDP_PP_OPS_ENABLE : + MDP_PP_OPS_WRITE | MDP_PP_OPS_DISABLE; + pcc_config.r.r = lut_data->red * PCC_ADJ; + pcc_config.g.g = lut_data->green * PCC_ADJ; + pcc_config.b.b = lut_data->blue * PCC_ADJ; + + if (lut_data->invert) { + pcc_config.r.c = pcc_config.g.c = + pcc_config.b.c = 0x7ff8; + pcc_config.r.r |= (0xffff << 16); + pcc_config.g.g |= (0xffff << 16); + pcc_config.b.b |= (0xffff << 16); + } + + mdss_mdp_pcc_config(&pcc_config, ©back); +} + +static void mdss_mdp_kcal_read_pcc(struct kcal_lut_data *lut_data) +{ + u32 copyback = 0; + struct mdp_pcc_cfg_data pcc_config; + + memset(&pcc_config, 0, sizeof(struct mdp_pcc_cfg_data)); + + pcc_config.block = MDP_LOGICAL_BLOCK_DISP_0; + pcc_config.ops = MDP_PP_OPS_READ; + + mdss_mdp_pcc_config(&pcc_config, ©back); + + /* LiveDisplay disables pcc when using default values and regs + * are zeroed on pp resume, so throw these values out. + */ + if (!pcc_config.r.r && !pcc_config.g.g && !pcc_config.b.b) + return; + + lut_data->red = (pcc_config.r.r & 0xffff) / PCC_ADJ; + lut_data->green = (pcc_config.g.g & 0xffff) / PCC_ADJ; + lut_data->blue = (pcc_config.b.b & 0xffff) / PCC_ADJ; +} + +static void mdss_mdp_kcal_update_pa(struct kcal_lut_data *lut_data) +{ + u32 copyback = 0; + struct mdp_pa_cfg_data pa_config; + struct mdp_pa_v2_cfg_data pa_v2_config; + struct mdss_data_type *mdata = mdss_mdp_get_mdata(); + + if (mdata->mdp_rev < MDSS_MDP_HW_REV_103) { + memset(&pa_config, 0, sizeof(struct mdp_pa_cfg_data)); + + pa_config.block = MDP_LOGICAL_BLOCK_DISP_0; + pa_config.pa_data.flags = lut_data->enable ? + MDP_PP_OPS_WRITE | MDP_PP_OPS_ENABLE : + MDP_PP_OPS_WRITE | MDP_PP_OPS_DISABLE; + pa_config.pa_data.hue_adj = lut_data->hue; + pa_config.pa_data.sat_adj = lut_data->sat; + pa_config.pa_data.val_adj = lut_data->val; + pa_config.pa_data.cont_adj = lut_data->cont; + + mdss_mdp_pa_config(&pa_config, ©back); + } else { + memset(&pa_v2_config, 0, sizeof(struct mdp_pa_v2_cfg_data)); + + pa_v2_config.block = MDP_LOGICAL_BLOCK_DISP_0; + pa_v2_config.pa_v2_data.flags = lut_data->enable ? + MDP_PP_OPS_WRITE | MDP_PP_OPS_ENABLE : + MDP_PP_OPS_WRITE | MDP_PP_OPS_DISABLE; + pa_v2_config.pa_v2_data.flags |= MDP_PP_PA_HUE_ENABLE; + pa_v2_config.pa_v2_data.flags |= MDP_PP_PA_HUE_MASK; + pa_v2_config.pa_v2_data.flags |= MDP_PP_PA_SAT_ENABLE; + pa_v2_config.pa_v2_data.flags |= MDP_PP_PA_SAT_MASK; + pa_v2_config.pa_v2_data.flags |= MDP_PP_PA_VAL_ENABLE; + pa_v2_config.pa_v2_data.flags |= MDP_PP_PA_VAL_MASK; + pa_v2_config.pa_v2_data.flags |= MDP_PP_PA_CONT_ENABLE; + pa_v2_config.pa_v2_data.flags |= MDP_PP_PA_CONT_MASK; + pa_v2_config.pa_v2_data.global_hue_adj = lut_data->hue; + pa_v2_config.pa_v2_data.global_sat_adj = lut_data->sat; + pa_v2_config.pa_v2_data.global_val_adj = lut_data->val; + pa_v2_config.pa_v2_data.global_cont_adj = lut_data->cont; + + mdss_mdp_pa_v2_config(&pa_v2_config, ©back); + } +} + +static ssize_t kcal_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + int kcal_r, kcal_g, kcal_b, r; + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + r = sscanf(buf, "%d %d %d", &kcal_r, &kcal_g, &kcal_b); + if ((r != 3) || (kcal_r < 1 || kcal_r > 256) || + (kcal_g < 1 || kcal_g > 256) || (kcal_b < 1 || kcal_b > 256)) + return -EINVAL; + + lut_data->red = kcal_r; + lut_data->green = kcal_g; + lut_data->blue = kcal_b; + + mdss_mdp_kcal_update_pcc(lut_data); + mdss_mdp_kcal_display_commit(); + + return count; +} + +static ssize_t kcal_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + mdss_mdp_kcal_read_pcc(lut_data); + + return scnprintf(buf, PAGE_SIZE, "%d %d %d\n", + lut_data->red, lut_data->green, lut_data->blue); +} + +static ssize_t kcal_min_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + int kcal_min, r; + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + r = kstrtoint(buf, 10, &kcal_min); + if ((r) || (kcal_min < 1 || kcal_min > 256)) + return -EINVAL; + + lut_data->minimum = kcal_min; + + mdss_mdp_kcal_update_pcc(lut_data); + mdss_mdp_kcal_display_commit(); + + return count; +} + +static ssize_t kcal_min_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%d\n", lut_data->minimum); +} + +static ssize_t kcal_enable_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + int kcal_enable, r; + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + r = kstrtoint(buf, 10, &kcal_enable); + if ((r) || (kcal_enable != 0 && kcal_enable != 1) || + (lut_data->enable == kcal_enable)) + return -EINVAL; + + lut_data->enable = kcal_enable; + + mdss_mdp_kcal_update_pcc(lut_data); + mdss_mdp_kcal_update_pa(lut_data); + mdss_mdp_kcal_display_commit(); + + return count; +} + +static ssize_t kcal_enable_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%d\n", lut_data->enable); +} + +static ssize_t kcal_invert_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + int kcal_invert, r; + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + r = kstrtoint(buf, 10, &kcal_invert); + if ((r) || (kcal_invert != 0 && kcal_invert != 1) || + (lut_data->invert == kcal_invert)) + return -EINVAL; + + lut_data->invert = kcal_invert; + + mdss_mdp_kcal_update_pcc(lut_data); + mdss_mdp_kcal_display_commit(); + + return count; +} + +static ssize_t kcal_invert_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%d\n", lut_data->invert); +} + +static ssize_t kcal_sat_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + int kcal_sat, r; + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + r = kstrtoint(buf, 10, &kcal_sat); + if ((r) || ((kcal_sat < 224 || kcal_sat > 383) && kcal_sat != 128)) + return -EINVAL; + + lut_data->sat = kcal_sat; + + mdss_mdp_kcal_update_pa(lut_data); + mdss_mdp_kcal_display_commit(); + + return count; +} + +static ssize_t kcal_sat_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%d\n", lut_data->sat); +} + +static ssize_t kcal_hue_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + int kcal_hue, r; + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + r = kstrtoint(buf, 10, &kcal_hue); + if ((r) || (kcal_hue < 0 || kcal_hue > 1536)) + return -EINVAL; + + lut_data->hue = kcal_hue; + + mdss_mdp_kcal_update_pa(lut_data); + mdss_mdp_kcal_display_commit(); + + return count; +} + +static ssize_t kcal_hue_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%d\n", lut_data->hue); +} + +static ssize_t kcal_val_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + int kcal_val, r; + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + r = kstrtoint(buf, 10, &kcal_val); + if ((r) || (kcal_val < 128 || kcal_val > 383)) + return -EINVAL; + + lut_data->val = kcal_val; + + mdss_mdp_kcal_update_pa(lut_data); + mdss_mdp_kcal_display_commit(); + + return count; +} + +static ssize_t kcal_val_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%d\n", lut_data->val); +} + +static ssize_t kcal_cont_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + int kcal_cont, r; + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + r = kstrtoint(buf, 10, &kcal_cont); + if ((r) || (kcal_cont < 128 || kcal_cont > 383)) + return -EINVAL; + + lut_data->cont = kcal_cont; + + mdss_mdp_kcal_update_pa(lut_data); + mdss_mdp_kcal_display_commit(); + + return count; +} + +static ssize_t kcal_cont_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct kcal_lut_data *lut_data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%d\n", lut_data->cont); +} + +static DEVICE_ATTR(kcal, S_IWUSR | S_IRUGO, kcal_show, kcal_store); +static DEVICE_ATTR(kcal_min, S_IWUSR | S_IRUGO, kcal_min_show, kcal_min_store); +static DEVICE_ATTR(kcal_enable, S_IWUSR | S_IRUGO, kcal_enable_show, + kcal_enable_store); +static DEVICE_ATTR(kcal_invert, S_IWUSR | S_IRUGO, kcal_invert_show, + kcal_invert_store); +static DEVICE_ATTR(kcal_sat, S_IWUSR | S_IRUGO, kcal_sat_show, kcal_sat_store); +static DEVICE_ATTR(kcal_hue, S_IWUSR | S_IRUGO, kcal_hue_show, kcal_hue_store); +static DEVICE_ATTR(kcal_val, S_IWUSR | S_IRUGO, kcal_val_show, kcal_val_store); +static DEVICE_ATTR(kcal_cont, S_IWUSR | S_IRUGO, kcal_cont_show, + kcal_cont_store); + +static int kcal_ctrl_probe(struct platform_device *pdev) +{ + int ret; + struct kcal_lut_data *lut_data; + + lut_data = devm_kzalloc(&pdev->dev, sizeof(*lut_data), GFP_KERNEL); + if (!lut_data) { + pr_err("%s: failed to allocate memory for lut_data\n", + __func__); + return -ENOMEM; + } + + platform_set_drvdata(pdev, lut_data); + + lut_data->enable = 0x1; + lut_data->red = DEF_PCC; + lut_data->green = DEF_PCC; + lut_data->blue = DEF_PCC; + lut_data->minimum = 0x23; + lut_data->invert = 0x0; + lut_data->hue = 0x0; + lut_data->sat = DEF_PA; + lut_data->val = DEF_PA; + lut_data->cont = DEF_PA; + + mdss_mdp_kcal_update_pcc(lut_data); + mdss_mdp_kcal_update_pa(lut_data); + mdss_mdp_kcal_display_commit(); + + ret = device_create_file(&pdev->dev, &dev_attr_kcal); + ret |= device_create_file(&pdev->dev, &dev_attr_kcal_min); + ret |= device_create_file(&pdev->dev, &dev_attr_kcal_enable); + ret |= device_create_file(&pdev->dev, &dev_attr_kcal_invert); + ret |= device_create_file(&pdev->dev, &dev_attr_kcal_sat); + ret |= device_create_file(&pdev->dev, &dev_attr_kcal_hue); + ret |= device_create_file(&pdev->dev, &dev_attr_kcal_val); + ret |= device_create_file(&pdev->dev, &dev_attr_kcal_cont); + if (ret) { + pr_err("%s: unable to create sysfs entries\n", __func__); + return ret; + } + + return 0; +} + +static int kcal_ctrl_remove(struct platform_device *pdev) +{ + device_remove_file(&pdev->dev, &dev_attr_kcal); + device_remove_file(&pdev->dev, &dev_attr_kcal_min); + device_remove_file(&pdev->dev, &dev_attr_kcal_enable); + device_remove_file(&pdev->dev, &dev_attr_kcal_invert); + device_remove_file(&pdev->dev, &dev_attr_kcal_sat); + device_remove_file(&pdev->dev, &dev_attr_kcal_hue); + device_remove_file(&pdev->dev, &dev_attr_kcal_val); + device_remove_file(&pdev->dev, &dev_attr_kcal_cont); + + return 0; +} + +static struct platform_driver kcal_ctrl_driver = { + .probe = kcal_ctrl_probe, + .remove = kcal_ctrl_remove, + .driver = { + .name = "kcal_ctrl", + }, +}; + +static struct platform_device kcal_ctrl_device = { + .name = "kcal_ctrl", +}; + +static int __init kcal_ctrl_init(void) +{ + if (platform_driver_register(&kcal_ctrl_driver)) + return -ENODEV; + + if (platform_device_register(&kcal_ctrl_device)) + return -ENODEV; + + pr_info("%s: registered\n", __func__); + + return 0; +} + +static void __exit kcal_ctrl_exit(void) +{ + platform_device_unregister(&kcal_ctrl_device); + platform_driver_unregister(&kcal_ctrl_driver); +} + +module_init(kcal_ctrl_init); +module_exit(kcal_ctrl_exit); From fd14cd6f83fbd958a4460845aee877fb02eee0c6 Mon Sep 17 00:00:00 2001 From: benschhold Date: Sat, 19 Nov 2016 09:23:51 +0100 Subject: [PATCH 34/75] Defconfig KCAL Change-Id: Ib103f3a4c076e8b4d39cfb69846151c39d3e81f8 --- arch/arm64/configs/cm_oneplus2_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index c0803dfd45e2a..8253e1adecf0a 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -587,3 +587,4 @@ CONFIG_QMI_ENCDEC=y CONFIG_MSM_HOTPLUG=y CONFIG_ADRENO_IDLER=y CONFIG_SOUND_CONTROL_HAX_3_GPL=y +CONFIG_FB_MSM_MDSS_KCAL_CTRL=y From 8f914fd95e595d110bcbe54050d88ecf3c18ca5f Mon Sep 17 00:00:00 2001 From: DespairFactor Date: Mon, 14 Mar 2016 01:42:08 -0400 Subject: [PATCH 35/75] cpufreq: add despair governor Change-Id: Ic4ec1e4a7c095b73f556827eb6fd3cbcc4b3efb0 --- arch/arm64/configs/cm_oneplus2_defconfig | 1 + drivers/cpufreq/Kconfig | 9 + drivers/cpufreq/Makefile | 1 + drivers/cpufreq/cpufreq_despair.c | 460 +++++++++++++++++++++++ drivers/cpufreq/cpufreq_governor.h | 6 + 5 files changed, 477 insertions(+) create mode 100644 drivers/cpufreq/cpufreq_despair.c diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index 8253e1adecf0a..025a409fb4ee5 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -63,6 +63,7 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=y CONFIG_CPU_FREQ_GOV_USERSPACE=y CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_INTERACTIVE=y +CONFIG_CPU_FREQ_GOV_DESPAIR=y CONFIG_CPU_BOOST=y CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index 29afa37aa4c12..988addcbf199a 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -118,6 +118,11 @@ config CPU_FREQ_DEFAULT_GOV_INTERACTIVE loading your cpufreq low-level hardware driver, using the 'interactive' governor for latency-sensitive workloads. +config CPU_FREQ_DEFAULT_GOV_DESPAIR + bool "despair" + select CPU_FREQ_GOV_DESPAIR + help + endchoice config CPU_FREQ_GOV_PERFORMANCE @@ -216,6 +221,10 @@ config CPU_FREQ_GOV_CONSERVATIVE If in doubt, say N. +config CPU_FREQ_GOV_DESPAIR + tristate "'despair' cpufreq governor" + depends on CPU_FREQ + config CPU_BOOST tristate "Event base short term CPU freq boost" depends on CPU_FREQ diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index 14e19a6a2626e..9adb291a34010 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -12,6 +12,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o obj-$(CONFIG_CPU_FREQ_GOV_INTERACTIVE) += cpufreq_interactive.o obj-$(CONFIG_CPU_FREQ_GOV_COMMON) += cpufreq_governor.o obj-$(CONFIG_CPU_BOOST) += cpu-boost.o +obj-$(CONFIG_CPU_FREQ_GOV_DESPAIR) += cpufreq_despair.o obj-$(CONFIG_GENERIC_CPUFREQ_CPU0) += cpufreq-cpu0.o diff --git a/drivers/cpufreq/cpufreq_despair.c b/drivers/cpufreq/cpufreq_despair.c new file mode 100644 index 0000000000000..527849731dc4b --- /dev/null +++ b/drivers/cpufreq/cpufreq_despair.c @@ -0,0 +1,460 @@ +/* + * drivers/cpufreq/cpufreq_conservative.c + * + * Copyright (C) 2001 Russell King + * (C) 2003 Venkatesh Pallipadi . + * Jun Nakajima + * (C) 2009 Alexander Clouter + * 2015 Matthew Alex + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include "cpufreq_governor.h" + +/* Conservative governor macros */ +#define DEF_FREQUENCY_UP_THRESHOLD (95) +#define DEF_FREQUENCY_DOWN_THRESHOLD (35) +#define DEF_FREQUENCY_TWOSTEP_THRESHOLD (65) +#define DEF_FREQUENCY_STEP (5) +#define DEF_SAMPLING_DOWN_FACTOR (1) +#define MAX_SAMPLING_DOWN_FACTOR (10) +#define MICRO_FREQUENCY_MIN_SAMPLE_RATE (20000) + +static DEFINE_PER_CPU(struct cs_cpu_dbs_info_s, cs_cpu_dbs_info); + +static inline unsigned int get_freq_target(struct cs_dbs_tuners *cs_tuners, + unsigned int freq_mult) +{ + unsigned int freq_target = (cs_tuners->freq_step * freq_mult) / 100; + + /* max freq cannot be less than 100. But who knows... */ + if (unlikely(freq_target == 0)) + freq_target = DEF_FREQUENCY_STEP; + + return freq_target; +} + +/* + * Every sampling_rate, we check, if current idle time is less than 20% + * (default), then we try to increase frequency. Every sampling_rate * + * sampling_down_factor, we check, if current idle time is more than 80% + * (default), then we try to decrease frequency + * + * Any frequency increase takes it to the maximum frequency. Frequency reduction + * happens at minimum steps of 5% (default) of maximum frequency + */ +static void cs_check_cpu(int cpu, unsigned int load) +{ + struct cs_cpu_dbs_info_s *dbs_info = &per_cpu(cs_cpu_dbs_info, cpu); + struct cpufreq_policy *policy = dbs_info->cdbs.cur_policy; + struct dbs_data *dbs_data = policy->governor_data; + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + u64 now; + + cpufreq_notify_utilization(policy, load); + + /* + * break out if we 'cannot' reduce the speed as the user might + * want freq_step to be zero + */ + if (cs_tuners->freq_step == 0) + return; + + now = ktime_to_us(ktime_get()); + + /* Check for frequency increase */ + if (load > DEF_FREQUENCY_TWOSTEP_THRESHOLD) { + if (load >= cs_tuners->up_threshold) + dbs_info->down_skip = 0; + + /* if we are already at full speed then break out early */ + if (policy->cur == policy->max) + return; + + if (load < cs_tuners->up_threshold && cs_tuners->twostep_counter++ < 2) { + cs_tuners->twostep_time = now; + dbs_info->requested_freq += get_freq_target(cs_tuners, policy->max >> 1); + } else { + if (load >= cs_tuners->up_threshold) + dbs_info->requested_freq += get_freq_target(cs_tuners, policy->max); + + cs_tuners->twostep_counter = 0; + } + + if (dbs_info->requested_freq > policy->max) + dbs_info->requested_freq = policy->max; + + if (dbs_info->requested_freq == policy->cur) + return; + + __cpufreq_driver_target(policy, dbs_info->requested_freq, + CPUFREQ_RELATION_H); + return; + } + + /* if sampling_down_factor is active break out early */ + if (++dbs_info->down_skip < cs_tuners->sampling_down_factor) + return; + dbs_info->down_skip = 0; + + /* Check for frequency decrease */ + if (load < cs_tuners->down_threshold) { + unsigned int freq_target; + /* + * we're scaling down, so reset the counter if + * the conditions are met + */ + if (cs_tuners->twostep_counter) { + if ((now - cs_tuners->twostep_time) >= 150000) + cs_tuners->twostep_counter = 0; + } + + /* + * if we cannot reduce the frequency anymore, break out early + */ + if (policy->cur == policy->min) + return; + + freq_target = get_freq_target(cs_tuners, policy->max); + if (dbs_info->requested_freq > freq_target) + dbs_info->requested_freq -= freq_target; + else + dbs_info->requested_freq = policy->min; + + __cpufreq_driver_target(policy, dbs_info->requested_freq, + CPUFREQ_RELATION_L); + return; + } +} + +static void cs_dbs_timer(struct work_struct *work) +{ + struct cs_cpu_dbs_info_s *dbs_info = container_of(work, + struct cs_cpu_dbs_info_s, cdbs.work.work); + unsigned int cpu = dbs_info->cdbs.cur_policy->cpu; + struct cs_cpu_dbs_info_s *core_dbs_info = &per_cpu(cs_cpu_dbs_info, + cpu); + struct dbs_data *dbs_data = dbs_info->cdbs.cur_policy->governor_data; + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + int delay = delay_for_sampling_rate(cs_tuners->sampling_rate); + bool modify_all = true; + + mutex_lock(&core_dbs_info->cdbs.timer_mutex); + if (!need_load_eval(&core_dbs_info->cdbs, cs_tuners->sampling_rate)) + modify_all = false; + else + dbs_check_cpu(dbs_data, cpu); + + gov_queue_work(dbs_data, dbs_info->cdbs.cur_policy, delay, modify_all); + mutex_unlock(&core_dbs_info->cdbs.timer_mutex); +} + +static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, + void *data) +{ + struct cpufreq_freqs *freq = data; + struct cs_cpu_dbs_info_s *dbs_info = + &per_cpu(cs_cpu_dbs_info, freq->cpu); + struct cpufreq_policy *policy; + + if (!dbs_info->enable) + return 0; + + policy = dbs_info->cdbs.cur_policy; + + /* + * we only care if our internally tracked freq moves outside the 'valid' + * ranges of frequency available to us otherwise we do not change it + */ + if (dbs_info->requested_freq > policy->max + || dbs_info->requested_freq < policy->min) + dbs_info->requested_freq = freq->new; + + return 0; +} + +/************************** sysfs interface ************************/ +static struct common_dbs_data cs_dbs_cdata; + +static ssize_t store_sampling_down_factor(struct dbs_data *dbs_data, + const char *buf, size_t count) +{ + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + unsigned int input; + int ret; + ret = sscanf(buf, "%u", &input); + + if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1) + return -EINVAL; + + cs_tuners->sampling_down_factor = input; + return count; +} + +static ssize_t store_sampling_rate(struct dbs_data *dbs_data, const char *buf, + size_t count) +{ + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + unsigned int input; + int ret; + ret = sscanf(buf, "%u", &input); + + if (ret != 1) + return -EINVAL; + + cs_tuners->sampling_rate = max(input, dbs_data->min_sampling_rate); + return count; +} + +static ssize_t store_up_threshold(struct dbs_data *dbs_data, const char *buf, + size_t count) +{ + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + unsigned int input; + int ret; + ret = sscanf(buf, "%u", &input); + + if (ret != 1 || input > 100 || input <= cs_tuners->down_threshold) + return -EINVAL; + + cs_tuners->up_threshold = input; + return count; +} + +static ssize_t store_down_threshold(struct dbs_data *dbs_data, const char *buf, + size_t count) +{ + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + unsigned int input; + int ret; + ret = sscanf(buf, "%u", &input); + + /* cannot be lower than 11 otherwise freq will not fall */ + if (ret != 1 || input < 11 || input > 100 || + input >= cs_tuners->up_threshold) + return -EINVAL; + + cs_tuners->down_threshold = input; + return count; +} + +static ssize_t store_ignore_nice_load(struct dbs_data *dbs_data, + const char *buf, size_t count) +{ + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + unsigned int input, j; + int ret; + + ret = sscanf(buf, "%u", &input); + if (ret != 1) + return -EINVAL; + + if (input > 1) + input = 1; + + if (input == cs_tuners->ignore_nice_load) /* nothing to do */ + return count; + + cs_tuners->ignore_nice_load = input; + + /* we need to re-evaluate prev_cpu_idle */ + for_each_online_cpu(j) { + struct cs_cpu_dbs_info_s *dbs_info; + dbs_info = &per_cpu(cs_cpu_dbs_info, j); + dbs_info->cdbs.prev_cpu_idle = get_cpu_idle_time(j, + &dbs_info->cdbs.prev_cpu_wall, 0); + if (cs_tuners->ignore_nice_load) + dbs_info->cdbs.prev_cpu_nice = + kcpustat_cpu(j).cpustat[CPUTIME_NICE]; + } + return count; +} + +static ssize_t store_freq_step(struct dbs_data *dbs_data, const char *buf, + size_t count) +{ + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + unsigned int input; + int ret; + ret = sscanf(buf, "%u", &input); + + if (ret != 1) + return -EINVAL; + + if (input > 100) + input = 100; + + /* + * no need to test here if freq_step is zero as the user might actually + * want this, they would be crazy though :) + */ + cs_tuners->freq_step = input; + return count; +} + +static ssize_t store_twostep_threshold(struct dbs_data *dbs_data, const char *buf, + size_t count) +{ + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + unsigned int input; + int ret; + ret = sscanf(buf, "%u", &input); + + if (ret != 1) + return -EINVAL; + + if (input < 0) + input = 0; + + cs_tuners->twostep_threshold = input; + return count; +} + +show_store_one(cs, sampling_rate); +show_store_one(cs, sampling_down_factor); +show_store_one(cs, up_threshold); +show_store_one(cs, down_threshold); +show_store_one(cs, ignore_nice_load); +show_store_one(cs, freq_step); +declare_show_sampling_rate_min(cs); +show_store_one(cs, twostep_threshold); + +gov_sys_pol_attr_rw(sampling_rate); +gov_sys_pol_attr_rw(sampling_down_factor); +gov_sys_pol_attr_rw(up_threshold); +gov_sys_pol_attr_rw(down_threshold); +gov_sys_pol_attr_rw(ignore_nice_load); +gov_sys_pol_attr_rw(freq_step); +gov_sys_pol_attr_ro(sampling_rate_min); +gov_sys_pol_attr_rw(twostep_threshold); + +static struct attribute *dbs_attributes_gov_sys[] = { + &sampling_rate_min_gov_sys.attr, + &sampling_rate_gov_sys.attr, + &sampling_down_factor_gov_sys.attr, + &up_threshold_gov_sys.attr, + &down_threshold_gov_sys.attr, + &ignore_nice_load_gov_sys.attr, + &freq_step_gov_sys.attr, + &twostep_threshold_gov_sys.attr, + NULL +}; + +static struct attribute_group cs_attr_group_gov_sys = { + .attrs = dbs_attributes_gov_sys, + .name = "despair", +}; + +static struct attribute *dbs_attributes_gov_pol[] = { + &sampling_rate_min_gov_pol.attr, + &sampling_rate_gov_pol.attr, + &sampling_down_factor_gov_pol.attr, + &up_threshold_gov_pol.attr, + &down_threshold_gov_pol.attr, + &ignore_nice_load_gov_pol.attr, + &freq_step_gov_pol.attr, + &twostep_threshold_gov_pol.attr, + NULL +}; + +static struct attribute_group cs_attr_group_gov_pol = { + .attrs = dbs_attributes_gov_pol, + .name = "despair", +}; + +/************************** sysfs end ************************/ + +static int cs_init(struct dbs_data *dbs_data) +{ + struct cs_dbs_tuners *tuners; + + tuners = kzalloc(sizeof(*tuners), GFP_KERNEL); + if (!tuners) { + pr_err("%s: kzalloc failed\n", __func__); + return -ENOMEM; + } + + tuners->up_threshold = DEF_FREQUENCY_UP_THRESHOLD; + tuners->down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD; + tuners->sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR; + tuners->ignore_nice_load = 0; + tuners->freq_step = DEF_FREQUENCY_STEP; + tuners->twostep_counter = 0; + tuners->twostep_threshold=DEF_FREQUENCY_TWOSTEP_THRESHOLD; + + dbs_data->tuners = tuners; + dbs_data->min_sampling_rate = MICRO_FREQUENCY_MIN_SAMPLE_RATE; + mutex_init(&dbs_data->mutex); + return 0; +} + +static void cs_exit(struct dbs_data *dbs_data) +{ + kfree(dbs_data->tuners); +} + +define_get_cpu_dbs_routines(cs_cpu_dbs_info); + +static struct notifier_block cs_cpufreq_notifier_block = { + .notifier_call = dbs_cpufreq_notifier, +}; + +static struct cs_ops cs_ops = { + .notifier_block = &cs_cpufreq_notifier_block, +}; + +static struct common_dbs_data cs_dbs_cdata = { + .governor = GOV_CONSERVATIVE, + .attr_group_gov_sys = &cs_attr_group_gov_sys, + .attr_group_gov_pol = &cs_attr_group_gov_pol, + .get_cpu_cdbs = get_cpu_cdbs, + .get_cpu_dbs_info_s = get_cpu_dbs_info_s, + .gov_dbs_timer = cs_dbs_timer, + .gov_check_cpu = cs_check_cpu, + .gov_ops = &cs_ops, + .init = cs_init, + .exit = cs_exit, +}; + +static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy, + unsigned int event) +{ + return cpufreq_governor_dbs(policy, &cs_dbs_cdata, event); +} + +#ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_DESPAIR +static +#endif +struct cpufreq_governor cpufreq_gov_despair = { + .name = "despair", + .governor = cs_cpufreq_governor_dbs, + .max_transition_latency = TRANSITION_LATENCY_LIMIT, + .owner = THIS_MODULE, +}; + +static int __init cpufreq_gov_dbs_init(void) +{ + return cpufreq_register_governor(&cpufreq_gov_despair); +} + +static void __exit cpufreq_gov_dbs_exit(void) +{ + cpufreq_unregister_governor(&cpufreq_gov_despair); +} + +MODULE_AUTHOR("Alexander Clouter "); +MODULE_DESCRIPTION("'cpufreq_despair' - A dynamic cpufreq governor for " + "Low Latency Frequency Transition capable processors " + "optimised for use in a battery environment"); +MODULE_LICENSE("GPL"); + +#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_DESPAIR +fs_initcall(cpufreq_gov_dbs_init); +#else +module_init(cpufreq_gov_dbs_init); +#endif +module_exit(cpufreq_gov_dbs_exit); diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h index b5f2b8618949d..32a9101ffe111 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h @@ -179,6 +179,12 @@ struct cs_dbs_tuners { unsigned int up_threshold; unsigned int down_threshold; unsigned int freq_step; + unsigned int input_boost_freq; + unsigned int input_boost_duration; + unsigned int twostep_threshold; + unsigned int min_load; + unsigned int twostep_counter; + u64 twostep_time; }; /* Common Governor data across policies */ From 9a68372f8319a0db2a2b3f0f60eb008adcae22f3 Mon Sep 17 00:00:00 2001 From: franciscofranco Date: Sun, 28 Dec 2014 16:47:50 +0000 Subject: [PATCH 36/75] cpufreq: add an helper to get/set cpu utilization to be used by mako_hotplug Change-Id: I7b2ccbac821360888d6c9a21cf93a1a833a6ac7c Signed-off-by: franciscofranco --- drivers/cpufreq/cpufreq.c | 34 ++++++++++++++++++++++++++++++++++ include/linux/cpufreq.h | 6 ++++++ 2 files changed, 40 insertions(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 49a45b728016f..4e1f7d794f103 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -342,6 +342,19 @@ void cpufreq_notify_transition(struct cpufreq_policy *policy, } EXPORT_SYMBOL_GPL(cpufreq_notify_transition); +/** + * cpufreq_notify_utilization - notify CPU userspace about CPU utilization + * change + * + * This function is called everytime the CPU load is evaluated by the + * ondemand governor. It notifies userspace of cpu load changes via sysfs. + */ +void cpufreq_notify_utilization(struct cpufreq_policy *policy, + unsigned int util) +{ + if (policy) + policy->util = util; +} /********************************************************************* * SYSFS INTERFACE * @@ -1452,6 +1465,27 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); } +/** + * cpufreq_quick_get_util - get the CPU utilization from policy->util + * @cpu: CPU number + * + * This is the last known util, without actually getting it from the driver. + * Return value will be same as what is shown in util in sysfs. + */ +unsigned int cpufreq_quick_get_util(unsigned int cpu) +{ + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); + unsigned int ret_util = 0; + + if (policy) { + ret_util = policy->util; + cpufreq_cpu_put(policy); + } + + return ret_util; +} +EXPORT_SYMBOL(cpufreq_quick_get_util); + /** * cpufreq_quick_get - get the CPU frequency (in kHz) from policy->cur * @cpu: CPU number diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index d3c1819dc0d48..f7fc2e4449b4b 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -100,6 +100,8 @@ struct cpufreq_policy { * __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT); */ struct rw_semaphore rwsem; + + unsigned int util; }; /* Only for ACPI */ @@ -135,6 +137,7 @@ void cpufreq_sysfs_remove_file(const struct attribute *attr); unsigned int cpufreq_get(unsigned int cpu); unsigned int cpufreq_quick_get(unsigned int cpu); unsigned int cpufreq_quick_get_max(unsigned int cpu); +unsigned int cpufreq_quick_get_util(unsigned int cpu); void disable_cpufreq(void); u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy); @@ -258,6 +261,9 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); const char *cpufreq_get_current_driver(void); +void cpufreq_notify_utilization(struct cpufreq_policy *policy, + unsigned int load); + static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) { From dcef518e85e41b6ca37b88a6c9826a359a510cd1 Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 9 Dec 2016 11:12:09 +0100 Subject: [PATCH 37/75] Revert "camera: sensor: Remove OIS burst write" This reverts commit 468bb14a97a3bf6309c965abd7d58007285ca809. --- .../platform/msm/camera_v2/sensor/ois/msm_ois.c | 15 +++++++++++++++ include/media/msm_cam_sensor.h | 7 +++++++ include/media/msm_camsensor_sdk.h | 3 +++ 3 files changed, 25 insertions(+) diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/msm_ois.c b/drivers/media/platform/msm/camera_v2/sensor/ois/msm_ois.c index 06a6ad3500007..1372cb09b3fad 100644 --- a/drivers/media/platform/msm/camera_v2/sensor/ois/msm_ois.c +++ b/drivers/media/platform/msm/camera_v2/sensor/ois/msm_ois.c @@ -91,6 +91,18 @@ static int32_t msm_ois_write_settings(struct msm_ois_ctrl_t *o_ctrl, if (rc < 0) return rc; break; +#ifdef VENDOR_EDIT // ois burst write + case MSM_CAMERA_I2C_SEQ_DATA: + o_ctrl->i2c_client.addr_type = settings[i].addr_type; + rc = o_ctrl->i2c_client.i2c_func_tbl-> + i2c_write_seq(&o_ctrl->i2c_client, + settings[i].reg_addr, + settings[i].reg_data_seq, + settings[i].reg_data_seq_size); + if (rc < 0) + return rc; + break; +#endif default: pr_err("Unsupport data type: %d\n", @@ -221,6 +233,7 @@ static int32_t msm_ois_control(struct msm_ois_ctrl_t *o_ctrl, cci_client->retries = 3; cci_client->id_map = 0; cci_client->cci_i2c_master = o_ctrl->cci_master; + cci_client->i2c_freq_mode = set_info->ois_params.i2c_freq_mode; } else { o_ctrl->i2c_client.client->addr = set_info->ois_params.i2c_addr; @@ -586,6 +599,8 @@ static long msm_ois_subdev_do_ioctl( u32->cfg.set_info.ois_params.setting_size; ois_data.cfg.set_info.ois_params.i2c_addr = u32->cfg.set_info.ois_params.i2c_addr; + ois_data.cfg.set_info.ois_params.i2c_freq_mode = + u32->cfg.set_info.ois_params.i2c_freq_mode; ois_data.cfg.set_info.ois_params.i2c_addr_type = u32->cfg.set_info.ois_params.i2c_addr_type; ois_data.cfg.set_info.ois_params.i2c_data_type = diff --git a/include/media/msm_cam_sensor.h b/include/media/msm_cam_sensor.h index b067217b678ff..35aefacac40ad 100644 --- a/include/media/msm_cam_sensor.h +++ b/include/media/msm_cam_sensor.h @@ -447,12 +447,18 @@ struct reg_settings_ois_t { enum msm_camera_i2c_data_type data_type; enum msm_ois_i2c_operation i2c_operation; uint32_t delay; +#ifdef VENDOR_EDIT // ois burst write + #define OIS_REG_DATA_SEQ_MAX 128 + unsigned char reg_data_seq[OIS_REG_DATA_SEQ_MAX]; + uint32_t reg_data_seq_size; +#endif }; struct msm_ois_params_t { uint16_t data_size; uint16_t setting_size; uint32_t i2c_addr; + enum i2c_freq_mode_t i2c_freq_mode; enum msm_camera_i2c_reg_addr_type i2c_addr_type; enum msm_camera_i2c_data_type i2c_data_type; struct reg_settings_ois_t *settings; @@ -728,6 +734,7 @@ struct msm_ois_params_t32 { uint16_t data_size; uint16_t setting_size; uint32_t i2c_addr; + enum i2c_freq_mode_t i2c_freq_mode; enum msm_camera_i2c_reg_addr_type i2c_addr_type; enum msm_camera_i2c_data_type i2c_data_type; compat_uptr_t settings; diff --git a/include/media/msm_camsensor_sdk.h b/include/media/msm_camsensor_sdk.h index 83ec905b04363..785eae95d46aa 100644 --- a/include/media/msm_camsensor_sdk.h +++ b/include/media/msm_camsensor_sdk.h @@ -82,6 +82,9 @@ enum msm_camera_i2c_data_type { //added by zhangxiaowei@camera 20150310 for qcom OIS architecture MSM_CAMERA_I2C_NO_DATA, // #endif /*VENDOR_EDIT*/ +#ifdef VENDOR_EDIT // ois burst write + MSM_CAMERA_I2C_SEQ_DATA, +#endif MSM_CAMERA_I2C_DATA_TYPE_MAX, }; From cac33d111c3ae84f1f3484307fffe355b2744de8 Mon Sep 17 00:00:00 2001 From: franciscofranco Date: Wed, 21 Nov 2012 23:45:56 -0800 Subject: [PATCH 38/75] Added fsync on/off support. Signed-off-by: Francisco Franco Signed-off-by: flar2 --- fs/sync.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/fs/sync.c b/fs/sync.c index 905f3f6b3d856..3bffb89a41f36 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -17,6 +18,9 @@ #include #include "internal.h" +bool fsync_enabled = true; +module_param(fsync_enabled, bool, 0755); + #define VALID_FLAGS (SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| \ SYNC_FILE_RANGE_WAIT_AFTER) @@ -152,6 +156,9 @@ SYSCALL_DEFINE1(syncfs, int, fd) struct super_block *sb; int ret; + if (!fsync_enabled) + return 0; + if (!f.file) return -EBADF; sb = f.file->f_dentry->d_sb; @@ -177,6 +184,9 @@ SYSCALL_DEFINE1(syncfs, int, fd) */ int vfs_fsync_range(struct file *file, loff_t start, loff_t end, int datasync) { + if (!fsync_enabled) + return 0; + if (!file->f_op || !file->f_op->fsync) return -EINVAL; return file->f_op->fsync(file, start, end, datasync); @@ -193,6 +203,9 @@ EXPORT_SYMBOL(vfs_fsync_range); */ int vfs_fsync(struct file *file, int datasync) { + if (!fsync_enabled) + return 0; + return vfs_fsync_range(file, 0, LLONG_MAX, datasync); } EXPORT_SYMBOL(vfs_fsync); @@ -201,6 +214,9 @@ static int do_fsync(unsigned int fd, int datasync) { struct fd f = fdget(fd); int ret = -EBADF; + + if (!fsync_enabled) + return 0; if (f.file) { ret = vfs_fsync(f.file, datasync); @@ -211,11 +227,17 @@ static int do_fsync(unsigned int fd, int datasync) SYSCALL_DEFINE1(fsync, unsigned int, fd) { + if (!fsync_enabled) + return 0; + return do_fsync(fd, 0); } SYSCALL_DEFINE1(fdatasync, unsigned int, fd) { + if (!fsync_enabled) + return 0; + return do_fsync(fd, 1); } @@ -229,6 +251,9 @@ SYSCALL_DEFINE1(fdatasync, unsigned int, fd) */ int generic_write_sync(struct file *file, loff_t pos, loff_t count) { + if (!fsync_enabled) + return 0; + if (!(file->f_flags & O_DSYNC) && !IS_SYNC(file->f_mapping->host)) return 0; return vfs_fsync_range(file, pos, pos + count - 1, @@ -292,6 +317,9 @@ SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes, loff_t endbyte; /* inclusive */ umode_t i_mode; + if (!fsync_enabled) + return 0; + ret = -EINVAL; if (flags & ~VALID_FLAGS) goto out; From eca9c7b1c2074d251b2ee1706c9232071b114dee Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 25 Nov 2016 16:39:56 +0100 Subject: [PATCH 39/75] Overclock Change-Id: I26542a68f08442cac7d1aa2e6133a7d422e8b7d6 --- arch/arm/boot/dts/qcom/msm8994-regulator.dtsi | 188 ++++++++++-------- arch/arm/boot/dts/qcom/msm8994-v2.dtsi | 79 ++++++-- drivers/clk/qcom/clock-cpu-8994.c | 10 +- 3 files changed, 172 insertions(+), 105 deletions(-) diff --git a/arch/arm/boot/dts/qcom/msm8994-regulator.dtsi b/arch/arm/boot/dts/qcom/msm8994-regulator.dtsi index 9fa9b759f8aa0..2cf9c2e076955 100644 --- a/arch/arm/boot/dts/qcom/msm8994-regulator.dtsi +++ b/arch/arm/boot/dts/qcom/msm8994-regulator.dtsi @@ -619,7 +619,7 @@ regulator-name = "apc0_corner"; qcom,cpr-fuse-corners = <4>; regulator-min-microvolt = <1>; - regulator-max-microvolt = <13>; + regulator-max-microvolt = <16>; qcom,cpr-voltage-ceiling = <900000 900000 1000000 1180000>; qcom,cpr-voltage-floor = <700000 700000 780000 835000>; @@ -647,7 +647,7 @@ qcom,cpr-apc-volt-step = <5000>; qcom,cpr-fuse-row = <137 0>; - qcom,cpr-fuse-target-quot = <39 39 47 55>; + qcom,cpr-fuse-target-quot = <31 39 47 55>; qcom,cpr-fuse-target-quot-size = <8 8 8 8>; qcom,cpr-fuse-target-quot-scale = <0 10>, @@ -668,7 +668,7 @@ <57 55 4 0>; qcom,cpr-fuse-redun-sel = <140 61 3 1 0>; qcom,cpr-fuse-redun-row = <1000 0>; - qcom,cpr-fuse-redun-target-quot = <8 8 16 24>; + qcom,cpr-fuse-redun-target-quot = <0 8 16 24>; qcom,cpr-fuse-redun-ro-sel = <44 44 44 44>; qcom,cpr-fuse-redun-init-voltage = <1000 32 6 0>, @@ -679,17 +679,17 @@ qcom,cpr-init-voltage-ref = <800000 900000 1000000 1225000>; qcom,cpr-init-voltage-step = <10000>; - qcom,cpr-corner-map = <1 2 2 2 3 3 3 4 4 4 4 4 4>; + qcom,cpr-corner-map = <1 2 2 2 3 3 3 4 4 4 4 4 4 4 4 4>; qcom,cpr-voltage-ceiling-override = <0xFFFFFFFF 0 900000 900000 900000 900000 1000000 1000000 1000000 1115000 1115000 1180000 1180000 1180000 - 1180000>; + 1180000 1180000 1180000 1200000>; qcom,cpr-voltage-floor-override = <0xFFFFFFFF 0 700000 700000 700000 725000 780000 800000 825000 835000 850000 915000 970000 980000 - 1000000>; + 1000000 1000000 1000000 1020000>; qcom,cpr-fuse-version-map = <0xffffffff 0xffffffff 1 0 0 0 0>, @@ -729,9 +729,12 @@ <10 1248000000>, <11 1344000000>, <12 1478400000>, - <13 1555200000>; + <13 1555200000>, + <14 1632000000>, + <15 1708800000>, + <16 1804800000>; qcom,cpr-speed-bin-max-corners = - <0xFFFFFFFF 0 1 4 7 13>; + <0xFFFFFFFF 0 1 4 7 15 16>; qcom,cpr-enable; }; @@ -743,7 +746,7 @@ regulator-name = "apc1_corner"; qcom,cpr-fuse-corners = <4>; regulator-min-microvolt = <1>; - regulator-max-microvolt = <17>; + regulator-max-microvolt = <23>; qcom,cpr-voltage-ceiling = <900000 900000 1000000 1225000>; qcom,cpr-voltage-floor = <700000 700000 750000 835000>; @@ -805,25 +808,29 @@ qcom,cpr-init-voltage-ref = <900000 900000 1000000 1225000>; qcom,cpr-init-voltage-step = <10000>; - qcom,cpr-corner-map = <1 2 2 2 2 3 3 3 4 4 4 4 4 4 4 4 4>; + qcom,cpr-corner-map = <1 2 2 2 2 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4>; qcom,cpr-voltage-ceiling-override = <0 0 900000 900000 900000 900000 900000 1000000 1000000 1000000 1160000 1160000 1160000 1160000 1160000 1225000 1225000 - 1225000 1225000>, + 1225000 1225000 1225000 1230000 1235000 + 1250000 1300000 1330000>, <1 0 900000 900000 900000 900000 900000 1000000 1000000 1000000 1160000 1160000 1160000 1160000 1160000 1225000 1225000 - 1225000 1225000>; + 1225000 1225000 1225000 1230000 1235000 + 1250000 1300000 1330000>; qcom,cpr-voltage-floor-override = <0 0 700000 700000 700000 700000 725000 750000 775000 795000 835000 860000 880000 895000 915000 935000 945000 - 950000 980000>, + 950000 980000 980000 985000 1000000 + 1010000 1025000 1030000>, <1 0 700000 700000 700000 700000 725000 750000 775000 795000 835000 860000 880000 895000 915000 935000 945000 - 950000 980000>; + 950000 980000 980000 985000 1000000 + 1010000 1025000 1030000>; qcom,cpr-fuse-version-map = <0 0xffffffff 1 6 6 6 6>, @@ -861,90 +868,90 @@ qcom,cpr-cpus = <&CPU4 &CPU5 &CPU6 &CPU7>; qcom,cpr-online-cpu-virtual-corner-init-voltage-adjustment = /* 1st fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 2nd fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 3rd fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 4th fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 5th fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 6th fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 7th fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000) (-30000)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000) (-10000)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; /* 4 CPUs online */ qcom,cpr-online-cpu-virtual-corner-quotient-adjustment = /* 1st fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18)>, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18)>, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-3) (-3) (-3) (-3) (-3) (-6) 0 (-6) (-6)>, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18) (-18) (-18) (-18) (-18) (-18) (-18)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18) (-18) (-18) (-18) (-18) (-18) (-18)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-3) (-3) (-3) (-3) (-3) (-6) 0 (-6) (-6) (-6) (-6) (-6) (-6) (-6) (-6)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 2nd fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18)>, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18)>, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-3) (-3) (-3) (-3) (-3) (-6) 0 (-6) (-6)>, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18) (-18) (-18) (-18) (-18) (-18) (-18)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18) (-18) (-18) (-18) (-18) (-18) (-18)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-3) (-3) (-3) (-3) (-3) (-6) 0 (-6) (-6) (-6) (-6) (-6) (-6) (-6) (-6)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 3rd fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21)>, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21) (-21) (-21) (-21) (-21) (-21) (-21)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 4th fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21)>, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21) (-21) (-21) (-21) (-21) (-21) (-21)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 5th fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21)>, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21) (-21) (-21) (-21) (-21) (-21) (-21)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 6th fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21)>, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21) (-21) (-21) (-21) (-21) (-21) (-21)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */ /* 7th fuse version tuple matched */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 0 CPUs online */ - <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63)>, /* 1 CPUs online */ - <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21)>, /* 2 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ - <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; /* 4 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 0 CPUs online */ + <0 0 0 0 0 0 0 0 (-21) (-21) (-21) (-31) (-31) (-42) 0 (-42) (-63) (-63) (-63) (-63) (-63) (-63) (-63)>, /* 1 CPUs online */ + <0 0 0 0 0 0 0 0 (-10) (-10) (-10) (-10) (-10) (-21) 0 (-21) (-21) (-21) (-21) (-21) (-21) (-21) (-21)>, /* 2 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */ + <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; /* 4 CPUs online */ qcom,cpr-online-cpu-init-voltage-as-ceiling; qcom,cpr-voltage-scaling-factor-max = <0 0 2000 2000>; @@ -966,9 +973,16 @@ <14 1728000000>, <15 1766400000>, <16 1824000000>, - <17 1958400000>; + <17 1958400000>, + <18 2016000000>, + <19 2054400000>, + <20 2092800000>, + <21 2131200000>, + <22 2150400000>, + <23 2208000000>; + qcom,cpr-speed-bin-max-corners = - <0 0 1 5 8 17>, + <0 0 1 5 8 18 23>, <1 0 1 5 8 15>; qcom,cpr-enable; }; @@ -1000,3 +1014,5 @@ regulator-name = "smbcharger_external_otg"; }; }; + + diff --git a/arch/arm/boot/dts/qcom/msm8994-v2.dtsi b/arch/arm/boot/dts/qcom/msm8994-v2.dtsi index af67f88d56a2e..e5ec381dd5f8b 100644 --- a/arch/arm/boot/dts/qcom/msm8994-v2.dtsi +++ b/arch/arm/boot/dts/qcom/msm8994-v2.dtsi @@ -84,8 +84,11 @@ < 1248000000 10>, < 1344000000 11>, < 1478400000 12>, - < 1555200000 13>; - qcom,a57-speedbin0-v0 = + < 1555200000 13>, + < 1632000000 14>, + < 1708800000 15>, + < 1804800000 16>; + qcom,a57-speedbin1-v0 = < 0 0>, < 302400000 5>, < 384000000 5>, @@ -101,8 +104,15 @@ < 1632000000 13>, < 1728000000 14>, < 1824000000 16>, - < 1958400000 17>; - qcom,a57-speedbin1-v0 = + < 1958400000 17>, + < 2016000000 18>, + < 2054400000 19>, + < 2092800000 20>, + < 2131200000 21>, + < 2150400000 22>, + < 2208000000 23>; + + qcom,a57-speedbin0-v0 = < 0 0>, < 302400000 5>, < 384000000 5>, @@ -116,7 +126,8 @@ < 1440000000 11>, < 1536000000 12>, < 1632000000 13>, - < 1766400000 15>; + < 1766400000 15>, + < 1804800000 16>; qcom,cci-speedbin0-v0 = < 0 0>, < 302400000 4>, @@ -151,7 +162,10 @@ < 1248000 >, < 1344000 >, < 1478400 >, - < 1555200 >; + < 1555200 >, + < 1632000 >, + < 1708800 >, + < 1804800 >; qcom,cpufreq-table-4 = < 302400 >, @@ -168,7 +182,13 @@ < 1632000 >, < 1728000 >, < 1824000 >, - < 1958400 >; + < 1958400 >, + < 2016000 >, + < 2054400 >, + < 2092800 >, + < 2131200 >, + < 2150400 >, + < 2208000 >; }; &devfreq_cpufreq { @@ -185,7 +205,10 @@ < 1248000 7904 >, < 1344000 9887 >, < 1478400 11863 >, - < 1555200 11863 >; + < 1555200 11863 >, + < 1632000 11863 >, + < 1708800 11863 >, + < 1804800 11863 >; cpu-to-dev-map-4 = < 302400 1525 >, < 384000 1525 >, @@ -201,7 +224,13 @@ < 1632000 9887 >, < 1728000 9887 >, < 1824000 11863 >, - < 1958400 11863 >; + < 1958400 11863 >, + < 2016000 11863 >, + < 2054400 11863 >, + < 2092800 11863 >, + < 2131200 11863 >, + < 2150400 11863 >, + < 2208000 11863 >; }; mincpubw-cpufreq { @@ -218,7 +247,10 @@ < 1248000 1525 >, < 1344000 1525 >, < 1478400 1525 >, - < 1555200 1525 >; + < 1555200 1525 >, + < 1632000 1525 >, + < 1708800 1525 >, + < 1804800 1525 >; cpu-to-dev-map-4 = < 302400 1525 >, < 384000 1525 >, @@ -234,7 +266,14 @@ < 1632000 1525 >, < 1728000 1525 >, < 1824000 1525 >, - < 1958400 7904 >; + < 1958400 7904 >, + < 2016000 7904 >, + < 2054400 7904 >, + < 2092800 7904 >, + < 2131200 7904 >, + < 2150400 7904 >, + < 2208000 7904 >; + }; cci-cpufreq { @@ -250,7 +289,10 @@ < 1248000 729600 >, < 1344000 787200 >, < 1478400 787200 >, - < 1555200 787200 >; + < 1555200 787200 >, + < 1632000 787200 >, + < 1708800 787200 >, + < 1804800 787200 >; cpu-to-dev-map-4 = < 302400 300000 >, < 384000 300000 >, @@ -266,7 +308,14 @@ < 1632000 787200 >, < 1728000 787200 >, < 1824000 787200 >, - < 1958400 787200 >; + < 1958400 787200 >, + < 2016000 787200 >, + < 2054400 787200 >, + < 2092800 787200 >, + < 2131200 787200 >, + < 2150400 787200 >, + < 2208000 787200 >; + }; }; @@ -366,7 +415,7 @@ qcom,bus-min = <0>; qcom,bus-max = <0>; }; - }; +}; /* * qcom,ocmem-bus-client defines @@ -438,3 +487,5 @@ }; #include "msm8994-v2-pm.dtsi" + + diff --git a/drivers/clk/qcom/clock-cpu-8994.c b/drivers/clk/qcom/clock-cpu-8994.c index 6eb346b754204..e0043959457f1 100644 --- a/drivers/clk/qcom/clock-cpu-8994.c +++ b/drivers/clk/qcom/clock-cpu-8994.c @@ -155,7 +155,7 @@ static DEFINE_VDD_REGULATORS(vdd_dig, VDD_DIG_NUM, 1, vdd_corner, NULL); */ DEFINE_CLK_DUMMY(a53_safe_parent, 199200000); -DEFINE_CLK_DUMMY(a57_safe_parent, 199200000); +DEFINE_CLK_DUMMY(a57_safe_parent, 240000000); DEFINE_FIXED_SLAVE_DIV_CLK(a53_safe_clk, 1, &a53_safe_parent.c); DEFINE_FIXED_SLAVE_DIV_CLK(a57_safe_clk, 1, &a57_safe_parent.c); @@ -191,13 +191,13 @@ static struct pll_clk a57_pll0 = { .test_ctl_lo_val = 0x00010000, }, .min_rate = 1209600000, - .max_rate = 1996800000, + .max_rate = 2400000000, .base = &vbases[C1_PLL_BASE], .c = { .parent = &xo_ao.c, .dbg_name = "a57_pll0", .ops = &clk_ops_variable_rate_pll, - VDD_DIG_FMAX_MAP2(LOW, 1593600000, NOMINAL, 1996800000), + VDD_DIG_FMAX_MAP2(LOW, 1593600000, NOMINAL, 2400000000), CLK_INIT(a57_pll0.c), }, }; @@ -229,13 +229,13 @@ static struct pll_clk a57_pll1 = { /* Necessary since we'll be setting a rate before handoff on V1 */ .src_rate = 19200000, .min_rate = 1209600000, - .max_rate = 1996800000, + .max_rate = 2400000000, .base = &vbases[C1_PLL_BASE], .c = { .parent = &xo_ao.c, .dbg_name = "a57_pll1", .ops = &clk_ops_variable_rate_pll, - VDD_DIG_FMAX_MAP2(LOW, 1593600000, NOMINAL, 1996800000), + VDD_DIG_FMAX_MAP2(LOW, 1593600000, NOMINAL, 2400000000), CLK_INIT(a57_pll1.c), }, }; From 2d9a55f10ff503843fa96bae7bf10307f9fec739 Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 25 Nov 2016 16:40:16 +0100 Subject: [PATCH 40/75] push to 4.7 Change-Id: I8b9e5e476d66a9d789d9e0eaa2fa361bbad84683 --- arch/arm64/configs/cm_oneplus2_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index 025a409fb4ee5..2aead7ad7ddc2 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -1,4 +1,4 @@ -CONFIG_LOCALVERSION="-minimalistic" +CONFIG_LOCALVERSION="-benschholds-custom-kernel-v4.7" CONFIG_SYSVIPC=y CONFIG_AUDIT=y CONFIG_NO_HZ=y From f447080f084484902c544893d2a4a924e110ed49 Mon Sep 17 00:00:00 2001 From: benschhold Date: Mon, 12 Dec 2016 19:02:33 +0100 Subject: [PATCH 41/75] push to 4.8 Change-Id: I06de6f918f07180a6cf618e521f6a78699a8be0c --- arch/arm64/configs/cm_oneplus2_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index 2aead7ad7ddc2..a226ca0059dd0 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -1,4 +1,4 @@ -CONFIG_LOCALVERSION="-benschholds-custom-kernel-v4.7" +CONFIG_LOCALVERSION="-benschholds-custom-kernel-v4.8" CONFIG_SYSVIPC=y CONFIG_AUDIT=y CONFIG_NO_HZ=y From 8c09c6d065f4bcfeeaea22250e1cf22d31d12c6b Mon Sep 17 00:00:00 2001 From: "www.anuprita804@gmail.com" Date: Fri, 30 Dec 2016 13:39:38 +0100 Subject: [PATCH 42/75] move to o3 --- Makefile | 6 +++--- exportthis | 9 +++++++++ oneplus2-build.sh | 6 ++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 exportthis create mode 100755 oneplus2-build.sh diff --git a/Makefile b/Makefile index 2e9fb8d925834..5fdcf66e3a5a4 100755 --- a/Makefile +++ b/Makefile @@ -241,8 +241,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ HOSTCC = ccache gcc HOSTCXX = ccache g++ -HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -HOSTCXXFLAGS = -O2 +HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O -fomit-frame-pointer -std=gnu89 +HOSTCXXFLAGS = -O3 # Decide whether to build built-in, modular, or both. # Normally, just do built-in. @@ -588,7 +588,7 @@ all: vmlinux ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) else -KBUILD_CFLAGS += -O2 +KBUILD_CFLAGS += -O3 endif include $(srctree)/arch/$(SRCARCH)/Makefile diff --git a/exportthis b/exportthis new file mode 100644 index 0000000000000..d11536270cc48 --- /dev/null +++ b/exportthis @@ -0,0 +1,9 @@ +TOOLCHAIN_DIR=/home/Suzu.memeYa/toolchain/bin +KERNEL_DIR=/home/Suzu.memeYa/android_kernel_oneplus_msm8994_custom +KERN_IMG=$KERNEL_DIR/arch/arm64/boot/Image.gz-dtb +export ARCH=arm64 export KBUILD_BUILD_USER="Suzumiya" +export KBUILD_BUILD_HOST="The_literary_club" +STRIP="home/Suzu.memeYa/toolchain/bin/aarch64-linux-android-strip" +export CCOMPILE=$CROSS_COMPILE +export CROSS_COMPILE=aarch64-linux-android- +export PATH=$PATH:/home/Suzu.memeYa/toolchain/bin diff --git a/oneplus2-build.sh b/oneplus2-build.sh new file mode 100755 index 0000000000000..186bb28d22f6f --- /dev/null +++ b/oneplus2-build.sh @@ -0,0 +1,6 @@ +rm -rf zipper/tools/Image.gz-dtb +rm -rf zipper/Bhenchod* +cp kernel/arch/arm64/boot/Image.gz-dtb zipper/tools/Image.gz-dtb +cd zipper +zip -r Haruhi-Kernel-v1-oneplus2-$(date +"%Y%m%d")-$(date +s).zip * +echo -e "Done" From 5c87281c262bbe9a639e7afe04b9f76e90a0a36d Mon Sep 17 00:00:00 2001 From: "www.anuprita804@gmail.com" Date: Fri, 30 Dec 2016 14:04:12 +0100 Subject: [PATCH 43/75] push to ofast --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5fdcf66e3a5a4..275b63ab01677 100755 --- a/Makefile +++ b/Makefile @@ -242,7 +242,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ HOSTCC = ccache gcc HOSTCXX = ccache g++ HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O -fomit-frame-pointer -std=gnu89 -HOSTCXXFLAGS = -O3 +HOSTCXXFLAGS = -Ofast # Decide whether to build built-in, modular, or both. # Normally, just do built-in. @@ -588,7 +588,7 @@ all: vmlinux ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) else -KBUILD_CFLAGS += -O3 +KBUILD_CFLAGS += -Ofast endif include $(srctree)/arch/$(SRCARCH)/Makefile From 98da7fc659fff967503f650ccc39bc0fe01c60fb Mon Sep 17 00:00:00 2001 From: "www.anuprita804@gmail.com" Date: Fri, 30 Dec 2016 14:09:49 +0100 Subject: [PATCH 44/75] fix derp --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 275b63ab01677..ff10cdc2b1c09 100755 --- a/Makefile +++ b/Makefile @@ -241,7 +241,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ HOSTCC = ccache gcc HOSTCXX = ccache g++ -HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O -fomit-frame-pointer -std=gnu89 +HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 HOSTCXXFLAGS = -Ofast # Decide whether to build built-in, modular, or both. @@ -648,7 +648,7 @@ endif KBUILD_CFLAGS += $(call cc-option, -fno-var-tracking-assignments) ifdef CONFIG_DEBUG_INFO -KBUILD_CFLAGS += -g +KBUILD_CFLAGS += KBUILD_AFLAGS += -gdwarf-2 endif From 91517994c4e5975fba94d0fcc8346ee51d9c1405 Mon Sep 17 00:00:00 2001 From: Joe Maples Date: Tue, 20 Dec 2016 19:14:10 +0000 Subject: [PATCH 45/75] adreno_idler: Add display state awareness Signed-off-by: Joe Maples --- drivers/devfreq/adreno_idler.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index b3aa89c88a87c..9d39d09593cfb 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -2,6 +2,7 @@ * Author: Park Ju Hyung aka arter97 * * Copyright 2015 Park Ju Hyung + * Copyright 2016 Joe Maples * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -29,6 +30,7 @@ #include #include +#include #include #define ADRENO_IDLER_MAJOR_VERSION 1 @@ -38,7 +40,7 @@ Any workload higher than this will be treated as a non-idle workload. Adreno idler will more actively try to ramp down the frequency if this is set to a higher value. */ -static unsigned long idleworkload = 5000; +static unsigned long idleworkload = 7000; module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); /* Number of events to wait before ramping down the frequency. @@ -66,6 +68,9 @@ int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, if (!adreno_idler_active) return 0; + /* Boolean to let us know if the display is on*/ + bool display_on = is_display_on(); + if (stats.busy_time < idleworkload) { /* busy_time >= idleworkload should be considered as a non-idle workload. */ idlecount++; @@ -81,6 +86,10 @@ int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, idlecount--; return 1; } + } else if (!display_on) { + /* GPU shouldn't be used for much while display is off, so ramp down the frequency */ + *freq = devfreq->profile->freq_table[devfreq->profile->max_state - 1]; + return 1; } else { idlecount = 0; /* Do not return 1 here and allow rest of the algorithm to From 7cfcb6c8ce00dba5578ff08f1dae658e70abf138 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Tue, 20 Dec 2016 22:24:01 -0700 Subject: [PATCH 46/75] adreno_idler: fix a declaration after statement warning I should just disable these but whatever. drivers/devfreq/adreno_idler.c: In function 'adreno_idler': drivers/devfreq/adreno_idler.c:72:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] bool display_on = is_display_on(); ^~~~ Signed-off-by: Nathan Chancellor --- drivers/devfreq/adreno_idler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index 9d39d09593cfb..a93be9350aeb6 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -65,12 +65,12 @@ static unsigned int idlecount = 0; int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq, unsigned long *freq) { - if (!adreno_idler_active) - return 0; - /* Boolean to let us know if the display is on*/ bool display_on = is_display_on(); + if (!adreno_idler_active) + return 0; + if (stats.busy_time < idleworkload) { /* busy_time >= idleworkload should be considered as a non-idle workload. */ idlecount++; From c4cea3289c7022488e0c993ca888c8a1af3bbaaa Mon Sep 17 00:00:00 2001 From: flar2 Date: Wed, 14 Dec 2016 23:25:48 -0500 Subject: [PATCH 47/75] mdss: LiveDisplay to kcal interface Why not just add pcc color interface from cm? Because I want kcal and pcc to be in sync. This adds the sysfs node for LiveDisplay but uses kcal to apply and store the values. --- drivers/video/msm/mdss/mdss_fb.c | 37 +++++++++++++++++++++ drivers/video/msm/mdss/mdss_mdp.h | 16 +++++++++ drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c | 36 ++++++++++++-------- 3 files changed, 76 insertions(+), 13 deletions(-) diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c index f0e42fbd4fcf0..9c8fda0afe4de 100755 --- a/drivers/video/msm/mdss/mdss_fb.c +++ b/drivers/video/msm/mdss/mdss_fb.c @@ -54,6 +54,7 @@ #include "mdss_mdp_splash_logo.h" #define CREATE_TRACE_POINTS #include "mdss_debug.h" +#include "mdss_mdp.h" #include "mdss_livedisplay.h" @@ -764,6 +765,39 @@ static ssize_t mdss_fb_get_dfps_mode(struct device *dev, return ret; } +static ssize_t mdss_get_rgb(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct kcal_lut_data lut_data = kcal_ext_show_values(); + + return sprintf(buf, "%d %d %d\n", lut_data.red * 128, + lut_data.green * 128, + lut_data.blue * 128); +} + +static ssize_t mdss_set_rgb(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + uint32_t r = 0, g = 0, b = 0; + + if (count > 19) + return -EINVAL; + + sscanf(buf, "%d %d %d", &r, &g, &b); + + if (r < 0 || r > 32768) + return -EINVAL; + if (g < 0 || g > 32768) + return -EINVAL; + if (b < 0 || b > 32768) + return -EINVAL; + + kcal_ext_apply_values(r, g, b); + + return count; +} + #ifdef VENDOR_EDIT/* guozhiming@oem Add for set cabc function 2015-04-01 */ extern int set_cabc(int level); @@ -805,6 +839,8 @@ static DEVICE_ATTR(msm_fb_panel_status, S_IRUGO | S_IWUSR, mdss_fb_get_panel_status, mdss_fb_force_panel_dead); static DEVICE_ATTR(msm_fb_dfps_mode, S_IRUGO | S_IWUSR, mdss_fb_get_dfps_mode, mdss_fb_change_dfps_mode); +static DEVICE_ATTR(rgb, S_IRUGO | S_IWUSR | S_IWGRP, mdss_get_rgb, + mdss_set_rgb); #ifdef VENDOR_EDIT /* guozhiming@oem Add for set cabc function 2015-04-01 */ static DEVICE_ATTR(cabc, S_IRUGO|S_IWUSR, mdss_get_cabc, mdss_set_cabc); @@ -821,6 +857,7 @@ static struct attribute *mdss_fb_attrs[] = { &dev_attr_msm_fb_thermal_level.attr, &dev_attr_msm_fb_panel_status.attr, &dev_attr_msm_fb_dfps_mode.attr, + &dev_attr_rgb.attr, #ifdef VENDOR_EDIT /* guozhiming@oem Add for set cabc function 2015-04-01*/ &dev_attr_cabc.attr, diff --git a/drivers/video/msm/mdss/mdss_mdp.h b/drivers/video/msm/mdss/mdss_mdp.h index c322ee067b9e4..56dffb6c4c941 100644 --- a/drivers/video/msm/mdss/mdss_mdp.h +++ b/drivers/video/msm/mdss/mdss_mdp.h @@ -77,6 +77,22 @@ #define XIN_HALT_TIMEOUT_US 0x4000 +struct kcal_lut_data { + int red; + int green; + int blue; + int minimum; + int enable; + int invert; + int sat; + int hue; + int val; + int cont; +}; + +void kcal_ext_apply_values(int red, int green, int blue); +struct kcal_lut_data kcal_ext_show_values(void); + enum mdss_mdp_perf_state_type { PERF_SW_COMMIT_STATE = 0, PERF_HW_MDP_STATE, diff --git a/drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c b/drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c index fa38f7627856c..f815f14fa3a0f 100644 --- a/drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c +++ b/drivers/video/msm/mdss/mdss_mdp_kcal_ctrl.c @@ -27,19 +27,6 @@ #define DEF_PA 0xff #define PCC_ADJ 0x80 -struct kcal_lut_data { - int red; - int green; - int blue; - int minimum; - int enable; - int invert; - int sat; - int hue; - int val; - int cont; -}; - static int mdss_mdp_kcal_display_commit(void) { int i; @@ -161,6 +148,29 @@ static void mdss_mdp_kcal_update_pa(struct kcal_lut_data *lut_data) } } +static struct platform_device kcal_ctrl_device; + +void kcal_ext_apply_values(int red, int green, int blue) +{ + struct kcal_lut_data *lut_data = + platform_get_drvdata(&kcal_ctrl_device); + + lut_data->red = red / 128; + lut_data->green = green / 128; + lut_data->blue = blue / 128; + + mdss_mdp_kcal_update_pcc(lut_data); + mdss_mdp_kcal_display_commit(); +} + +struct kcal_lut_data kcal_ext_show_values(void) +{ + struct kcal_lut_data *lut_data = + platform_get_drvdata(&kcal_ctrl_device); + + return *lut_data; +} + static ssize_t kcal_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { From d51d4cb95622262bc7b705ce2e77c704c55cf8c5 Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 30 Dec 2016 20:13:15 +0100 Subject: [PATCH 48/75] Revert "video: mdss: LiveDisplay driver" This reverts commit 794564b35546562807db7a5398b6b53b72647bde. --- drivers/video/msm/mdss/Makefile | 1 - drivers/video/msm/mdss/mdss_dsi_panel.c | 7 +- drivers/video/msm/mdss/mdss_fb.c | 5 +- drivers/video/msm/mdss/mdss_livedisplay.c | 662 ---------------------- drivers/video/msm/mdss/mdss_livedisplay.h | 116 ---- drivers/video/msm/mdss/mdss_panel.h | 4 - 6 files changed, 3 insertions(+), 792 deletions(-) delete mode 100644 drivers/video/msm/mdss/mdss_livedisplay.c delete mode 100644 drivers/video/msm/mdss/mdss_livedisplay.h diff --git a/drivers/video/msm/mdss/Makefile b/drivers/video/msm/mdss/Makefile index 8b423631f114d..212fbbcf21fc5 100644 --- a/drivers/video/msm/mdss/Makefile +++ b/drivers/video/msm/mdss/Makefile @@ -52,5 +52,4 @@ obj-$(CONFIG_FB_MSM_QPIC_ILI_QVGA_PANEL) += qpic_panel_ili_qvga.o obj-$(CONFIG_FB_MSM_MDSS) += mdss_fb.o mdss_util.o obj-$(CONFIG_COMPAT) += mdss_compat_utils.o -obj-$(CONFIG_FB_MSM_MDSS) += mdss_livedisplay.o obj-$(CONFIG_FB_MSM_MDSS_KCAL_CTRL) += mdss_mdp_kcal_ctrl.o diff --git a/drivers/video/msm/mdss/mdss_dsi_panel.c b/drivers/video/msm/mdss/mdss_dsi_panel.c index b28d7459e93fc..c8097b66d3fcd 100755 --- a/drivers/video/msm/mdss/mdss_dsi_panel.c +++ b/drivers/video/msm/mdss/mdss_dsi_panel.c @@ -25,7 +25,6 @@ #include "mdss_dsi.h" #include "mdss_mdp.h" -#include "mdss_livedisplay.h" #define DT_CMD_HDR 6 #define MIN_REFRESH_RATE 30 @@ -239,7 +238,7 @@ u32 mdss_dsi_panel_cmd_read(struct mdss_dsi_ctrl_pdata *ctrl, char cmd0, return 0; } -void mdss_dsi_panel_cmds_send(struct mdss_dsi_ctrl_pdata *ctrl, +static void mdss_dsi_panel_cmds_send(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_panel_cmds *pcmds, u32 flags) { struct dcs_cmd_req cmdreq; @@ -1178,7 +1177,7 @@ static void mdss_dsi_parse_trigger(struct device_node *np, char *trigger, } -int mdss_dsi_parse_dcs_cmds(struct device_node *np, +static int mdss_dsi_parse_dcs_cmds(struct device_node *np, struct dsi_panel_cmds *pcmds, char *cmd_key, char *link_key) { const char *data; @@ -2392,8 +2391,6 @@ static int mdss_panel_parse_dt(struct device_node *np, mdss_dsi_parse_dfps_config(np, ctrl_pdata); - mdss_livedisplay_parse_dt(np, pinfo); - return 0; error: diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c index 9c8fda0afe4de..b8572fb71c17b 100755 --- a/drivers/video/msm/mdss/mdss_fb.c +++ b/drivers/video/msm/mdss/mdss_fb.c @@ -56,8 +56,6 @@ #include "mdss_debug.h" #include "mdss_mdp.h" -#include "mdss_livedisplay.h" - #ifdef CONFIG_FB_MSM_TRIPLE_BUFFER #define MDSS_FB_NUM 3 #else @@ -876,8 +874,7 @@ static int mdss_fb_create_sysfs(struct msm_fb_data_type *mfd) rc = sysfs_create_group(&mfd->fbi->dev->kobj, &mdss_fb_attr_group); if (rc) pr_err("sysfs group creation failed, rc=%d\n", rc); - - return mdss_livedisplay_create_sysfs(mfd); + return rc; } static void mdss_fb_remove_sysfs(struct msm_fb_data_type *mfd) diff --git a/drivers/video/msm/mdss/mdss_livedisplay.c b/drivers/video/msm/mdss/mdss_livedisplay.c deleted file mode 100644 index ab63904a18f8b..0000000000000 --- a/drivers/video/msm/mdss/mdss_livedisplay.c +++ /dev/null @@ -1,662 +0,0 @@ -/* - * Copyright (c) 2015 The CyanogenMod Project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include -#include -#include -#include -#include -#include - -#include "mdss_dsi.h" -#include "mdss_fb.h" -#include "mdss_mdp.h" -#include "mdss_livedisplay.h" - -/* - * LiveDisplay is the display management service in CyanogenMod. It uses - * various capabilities of the hardware and software in order to - * optimize the experience for ambient conditions and time of day. - * - * This module is initialized by mdss_fb for each panel, and creates - * several new controls in /sys/class/graphics/fbX based on the - * configuration in the devicetree. - * - * rgb: Always available with MDSS. Used for color temperature and - * user-level calibration. Takes a string of "r g b". - * - * cabc: Content Adaptive Backlight Control. Must be configured - * in the panel devicetree. Up to three levels. - * sre: Sunlight Readability Enhancement. Must be configured in - * the panel devicetree. Up to three levels. - * aco: Automatic Contrast Optimization. Must be configured in - * the panel devicetree. Boolean. - * - * preset: Arbitrary DSI commands, up to 10 may be configured. - * Useful for gamma calibration. - * - * color_enhance: Hardware color enhancement. Must be configured - * in the panel devicetree. Boolean. - */ - -extern void mdss_dsi_panel_cmds_send(struct mdss_dsi_ctrl_pdata *ctrl, - struct dsi_panel_cmds *pcmds, u32 flags); - -static int parse_dsi_cmds(struct dsi_panel_cmds *pcmds, const uint8_t *cmd, int blen) -{ - int len; - char *buf, *bp; - struct dsi_ctrl_hdr *dchdr; - int i, cnt; - - buf = kzalloc(blen, GFP_KERNEL); - if (!buf) - return -ENOMEM; - - memcpy(buf, cmd, blen); - - /* scan dcs commands */ - bp = buf; - len = blen; - cnt = 0; - while (len >= sizeof(*dchdr)) { - dchdr = (struct dsi_ctrl_hdr *)bp; - dchdr->dlen = ntohs(dchdr->dlen); - if (dchdr->dlen > len) { - pr_err("%s: dtsi cmd=%x error, len=%d\n", - __func__, dchdr->dtype, dchdr->dlen); - goto exit_free; - } - bp += sizeof(*dchdr); - len -= sizeof(*dchdr); - bp += dchdr->dlen; - len -= dchdr->dlen; - cnt++; - } - - if (len != 0) { - pr_err("%s: dcs_cmd=%x len=%d error!\n", - __func__, buf[0], blen); - goto exit_free; - } - - pcmds->cmds = kzalloc(cnt * sizeof(struct dsi_cmd_desc), - GFP_KERNEL); - if (!pcmds->cmds) - goto exit_free; - - pcmds->cmd_cnt = cnt; - pcmds->buf = buf; - pcmds->blen = blen; - - bp = buf; - len = blen; - for (i = 0; i < cnt; i++) { - dchdr = (struct dsi_ctrl_hdr *)bp; - len -= sizeof(*dchdr); - bp += sizeof(*dchdr); - pcmds->cmds[i].dchdr = *dchdr; - pcmds->cmds[i].payload = bp; - bp += dchdr->dlen; - len -= dchdr->dlen; - } - - /*Set default link state to HS Mode*/ - pcmds->link_state = DSI_HS_MODE; - - pr_debug("%s: dcs_cmd=%x len=%d, cmd_cnt=%d link_state=%d\n", __func__, - pcmds->buf[0], pcmds->blen, pcmds->cmd_cnt, pcmds->link_state); - - return 0; - -exit_free: - kfree(buf); - return -ENOMEM; -} - -/** - * simple color temperature interface using polynomial color correction - * - * input values are r/g/b adjustments from 0-32768 representing 0 -> 1 - * - * example adjustment @ 3500K: - * 1.0000 / 0.5515 / 0.2520 = 32768 / 25828 / 17347 - * - * reference chart: - * http://www.vendian.org/mncharity/dir3/blackbody/UnstableURLs/bbr_color.html - */ -static int mdss_livedisplay_update_pcc(struct mdss_livedisplay_ctx *mlc) -{ - static struct mdp_pcc_cfg_data pcc_cfg; - - if (mlc == NULL) - return -ENODEV; - - WARN_ON(!mutex_is_locked(&mlc->lock)); - - pr_info("%s: r=%d g=%d b=%d\n", __func__, mlc->r, mlc->g, mlc->b); - - memset(&pcc_cfg, 0, sizeof(struct mdp_pcc_cfg_data)); - - pcc_cfg.block = mlc->mfd->index + MDP_LOGICAL_BLOCK_DISP_0; - if (mlc->r == 32768 && mlc->g == 32768 && mlc->b == 32768) - pcc_cfg.ops = MDP_PP_OPS_DISABLE; - else - pcc_cfg.ops = MDP_PP_OPS_ENABLE; - pcc_cfg.ops |= MDP_PP_OPS_WRITE; - pcc_cfg.r.r = mlc->r; - pcc_cfg.g.g = mlc->g; - pcc_cfg.b.b = mlc->b; - - return mdss_mdp_user_pcc_config(&pcc_cfg); -} - -/* - * Update all or a subset of parameters - */ -static void mdss_livedisplay_worker(struct work_struct *work) -{ - int ret = 0; - struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL; - struct mdss_panel_info *pinfo = NULL; - struct mdss_livedisplay_ctx *mlc = NULL; - unsigned int len = 0, dlen = 0; - struct dsi_panel_cmds dsi_cmds; - uint8_t cabc_value = 0; - - mlc = container_of(work, struct mdss_livedisplay_ctx, update_work); - - if (mlc == NULL) - return; - - ctrl_pdata = get_ctrl(mlc->mfd); - if (ctrl_pdata == NULL) - return; - - pinfo = &(ctrl_pdata->panel_data.panel_info); - if (pinfo == NULL) - return; - - if (!mlc->caps || !mdss_panel_is_power_on_interactive(pinfo->panel_power_state)) - return; - - mutex_lock(&mlc->lock); - - // First find the length of the command array - if ((mlc->caps & MODE_PRESET) && (mlc->updated & MODE_PRESET)) - len += mlc->presets_len[mlc->preset]; - - if ((mlc->caps & MODE_COLOR_ENHANCE) && (mlc->updated & MODE_COLOR_ENHANCE)) - len += mlc->ce_enabled ? mlc->ce_on_cmds_len : mlc->ce_off_cmds_len; - - if (is_cabc_cmd(mlc->updated) && is_cabc_cmd(mlc->caps)) { - - // The CABC command on most modern panels is also responsible for - // other features such as SRE and ACO. The register fields are bits - // and are OR'd together and sent in a single DSI command. - if (mlc->cabc_level == CABC_UI) - cabc_value |= mlc->cabc_ui_value; - else if (mlc->cabc_level == CABC_IMAGE) - cabc_value |= mlc->cabc_image_value; - else if (mlc->cabc_level == CABC_VIDEO) - cabc_value |= mlc->cabc_video_value; - - if (mlc->sre_level == SRE_WEAK) - cabc_value |= mlc->sre_weak_value; - else if (mlc->sre_level == SRE_MEDIUM) - cabc_value |= mlc->sre_medium_value; - else if (mlc->sre_level == SRE_STRONG) - cabc_value |= mlc->sre_strong_value; - - if (mlc->aco_enabled) - cabc_value |= mlc->aco_value; - - len += mlc->cabc_cmds_len; - - pr_info("%s cabc=%d sre=%d aco=%d cmd=%d\n", __func__, - mlc->cabc_level, mlc->sre_level, mlc->aco_enabled, - cabc_value); - } - - len += mlc->post_cmds_len; - - if (len == 0) - goto out; - - memset(&dsi_cmds, 0, sizeof(struct dsi_panel_cmds)); - - // Build the command as a single chain, preset first - if ((mlc->caps & MODE_PRESET) && (mlc->updated & MODE_PRESET)) { - memcpy(mlc->cmd_buf, mlc->presets[mlc->preset], mlc->presets_len[mlc->preset]); - dlen += mlc->presets_len[mlc->preset]; - } - - // Color enhancement - if ((mlc->caps & MODE_COLOR_ENHANCE) && (mlc->updated & MODE_COLOR_ENHANCE)) { - if (mlc->ce_enabled) { - memcpy(mlc->cmd_buf + dlen, mlc->ce_on_cmds, mlc->ce_on_cmds_len); - dlen += mlc->ce_on_cmds_len; - } else { - memcpy(mlc->cmd_buf + dlen, mlc->ce_off_cmds, mlc->ce_off_cmds_len); - dlen += mlc->ce_off_cmds_len; - } - } - - // CABC/SRE/ACO features - if (is_cabc_cmd(mlc->updated) && mlc->cabc_cmds_len) { - memcpy(mlc->cmd_buf + dlen, mlc->cabc_cmds, mlc->cabc_cmds_len); - dlen += mlc->cabc_cmds_len; - // The CABC command parameter is the last value in the sequence - mlc->cmd_buf[dlen - 1] = cabc_value; - } - - // And the post_cmd, can be used to turn on the panel - if (mlc->post_cmds_len) { - memcpy(mlc->cmd_buf + dlen, mlc->post_cmds, mlc->post_cmds_len); - dlen += mlc->post_cmds_len; - } - - // Parse the command and send it - ret = parse_dsi_cmds(&dsi_cmds, mlc->cmd_buf, len); - if (ret == 0) { - mdss_dsi_panel_cmds_send(ctrl_pdata, &dsi_cmds, CMD_REQ_COMMIT); - } else { - pr_err("%s: error parsing DSI command! ret=%d", __func__, ret); - } - -out: - // Restore saved RGB settings - if (mlc->updated & MODE_RGB) - mdss_livedisplay_update_pcc(mlc); - - mlc->updated = 0; - mutex_unlock(&mlc->lock); -} - -void mdss_livedisplay_update(struct mdss_livedisplay_ctx *mlc, uint32_t updated) -{ - mutex_lock(&mlc->lock); - mlc->updated |= updated; - mutex_unlock(&mlc->lock); - - queue_work(mlc->wq, &mlc->update_work); -} - -static ssize_t mdss_livedisplay_get_cabc(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - return sprintf(buf, "%d\n", mlc->cabc_level); -} - -static ssize_t mdss_livedisplay_set_cabc(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - int level = 0; - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - sscanf(buf, "%du", &level); - if (level >= CABC_OFF && level < CABC_MAX && - level != mlc->cabc_level) { - mutex_lock(&mlc->lock); - mlc->cabc_level = level; - mutex_unlock(&mlc->lock); - mdss_livedisplay_update(mlc, MODE_CABC); - } - - return count; -} - -static ssize_t mdss_livedisplay_get_sre(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - return sprintf(buf, "%d\n", mlc->sre_level); -} - -static ssize_t mdss_livedisplay_set_sre(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - int level = 0; - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - sscanf(buf, "%du", &level); - if (level >= SRE_OFF && level < SRE_MAX && - level != mlc->sre_level) { - mutex_lock(&mlc->lock); - mlc->sre_level = level; - mutex_unlock(&mlc->lock); - mdss_livedisplay_update(mlc, MODE_SRE); - } - - return count; -} - -static ssize_t mdss_livedisplay_get_color_enhance(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - return sprintf(buf, "%d\n", mlc->ce_enabled); -} - -static ssize_t mdss_livedisplay_set_color_enhance(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - int value = 0; - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - sscanf(buf, "%du", &value); - if ((value == 0 || value == 1) - && value != mlc->ce_enabled) { - mutex_lock(&mlc->lock); - mlc->ce_enabled = value; - mutex_unlock(&mlc->lock); - mdss_livedisplay_update(mlc, MODE_COLOR_ENHANCE); - } - - return count; -} - -static ssize_t mdss_livedisplay_get_aco(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - return sprintf(buf, "%d\n", mlc->aco_enabled); -} - -static ssize_t mdss_livedisplay_set_aco(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - int value = 0; - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - sscanf(buf, "%du", &value); - if ((value == 0 || value == 1) - && value != mlc->aco_enabled) { - mutex_lock(&mlc->lock); - mlc->aco_enabled = value; - mutex_unlock(&mlc->lock); - mdss_livedisplay_update(mlc, MODE_AUTO_CONTRAST); - } - - mutex_unlock(&mlc->lock); - - return count; -} - -static ssize_t mdss_livedisplay_get_preset(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - return sprintf(buf, "%d\n", mlc->preset); -} - -static ssize_t mdss_livedisplay_set_preset(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - int value = 0; - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - sscanf(buf, "%du", &value); - if (value < 0 || value >= mlc->num_presets) - return -EINVAL; - - mutex_lock(&mlc->lock); - mlc->preset = value; - mutex_unlock(&mlc->lock); - - mdss_livedisplay_update(mlc, MODE_PRESET); - - return count; -} - -static ssize_t mdss_livedisplay_get_num_presets(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - return sprintf(buf, "%d\n", mlc->num_presets); -} - -static ssize_t mdss_livedisplay_get_rgb(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_livedisplay_ctx *mlc; - - if (mfd == NULL) - return -ENODEV; - - mlc = get_ctx(mfd); - - return scnprintf(buf, PAGE_SIZE, "%d %d %d\n", - mlc->r, mlc->g, mlc->b); -} - -static ssize_t mdss_livedisplay_set_rgb(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - uint32_t r = 0, g = 0, b = 0; - struct fb_info *fbi = dev_get_drvdata(dev); - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; - struct mdss_panel_data *pdata; - struct mdss_livedisplay_ctx *mlc; - int ret = -EINVAL; - - if (mfd == NULL) - return -ENODEV; - - if (count > 19) - return -EINVAL; - - mlc = get_ctx(mfd); - pdata = dev_get_platdata(&mfd->pdev->dev); - - sscanf(buf, "%d %d %d", &r, &g, &b); - - if (r < 0 || r > 32768) - return -EINVAL; - if (g < 0 || g > 32768) - return -EINVAL; - if (b < 0 || b > 32768) - return -EINVAL; - - mutex_lock(&mlc->lock); - mlc->r = r; - mlc->g = g; - mlc->b = b; - mutex_unlock(&mlc->lock); - - mdss_livedisplay_update(mlc, MODE_RGB); - ret = count; - - return ret; -} - -static DEVICE_ATTR(cabc, S_IRUGO | S_IWUSR | S_IWGRP, mdss_livedisplay_get_cabc, mdss_livedisplay_set_cabc); -static DEVICE_ATTR(sre, S_IRUGO | S_IWUSR | S_IWGRP, mdss_livedisplay_get_sre, mdss_livedisplay_set_sre); -static DEVICE_ATTR(color_enhance, S_IRUGO | S_IWUSR | S_IWGRP, mdss_livedisplay_get_color_enhance, mdss_livedisplay_set_color_enhance); -static DEVICE_ATTR(aco, S_IRUGO | S_IWUSR | S_IWGRP, mdss_livedisplay_get_aco, mdss_livedisplay_set_aco); -static DEVICE_ATTR(preset, S_IRUGO | S_IWUSR | S_IWGRP, mdss_livedisplay_get_preset, mdss_livedisplay_set_preset); -static DEVICE_ATTR(num_presets, S_IRUGO, mdss_livedisplay_get_num_presets, NULL); -static DEVICE_ATTR(rgb, S_IRUGO | S_IWUSR | S_IWGRP, mdss_livedisplay_get_rgb, mdss_livedisplay_set_rgb); - -int mdss_livedisplay_parse_dt(struct device_node *np, struct mdss_panel_info *pinfo) -{ - int rc = 0, i = 0; - struct mdss_livedisplay_ctx *mlc; - char preset_name[64]; - uint32_t tmp = 0; - - if (pinfo == NULL) - return -ENODEV; - - mlc = kzalloc(sizeof(struct mdss_livedisplay_ctx), GFP_KERNEL); - - mlc->cabc_cmds = of_get_property(np, - "cm,mdss-livedisplay-cabc-cmd", &mlc->cabc_cmds_len); - - if (mlc->cabc_cmds_len > 0) { - rc = of_property_read_u32(np, "cm,mdss-livedisplay-cabc-ui-value", &tmp); - if (rc == 0) { - mlc->caps |= MODE_CABC; - mlc->cabc_ui_value = (uint8_t)(tmp & 0xFF); - of_property_read_u32(np, "cm,mdss-livedisplay-cabc-image-value", &tmp); - mlc->cabc_image_value = (uint8_t)(tmp & 0xFF); - of_property_read_u32(np, "cm,mdss-livedisplay-cabc-video-value", &tmp); - mlc->cabc_video_value = (uint8_t)(tmp & 0xFF); - } - rc = of_property_read_u32(np, "cm,mdss-livedisplay-sre-medium-value", &tmp); - if (rc == 0) { - mlc->caps |= MODE_SRE; - mlc->sre_medium_value = (uint8_t)(tmp & 0xFF); - of_property_read_u32(np, "cm,mdss-livedisplay-sre-weak-value", &tmp); - mlc->sre_weak_value = (uint8_t)(tmp & 0xFF); - of_property_read_u32(np, "cm,mdss-livedisplay-sre-strong-value", &tmp); - mlc->sre_strong_value = (uint8_t)(tmp & 0xFF); - } - rc = of_property_read_u32(np, "cm,mdss-livedisplay-aco-value", &tmp); - if (rc == 0) { - mlc->caps |= MODE_AUTO_CONTRAST; - mlc->aco_value = (uint8_t)(tmp & 0xFF); - } - } - - mlc->ce_on_cmds = of_get_property(np, - "cm,mdss-livedisplay-color-enhance-on", &mlc->ce_on_cmds_len); - if (mlc->ce_on_cmds_len) { - mlc->ce_off_cmds = of_get_property(np, - "cm,mdss-livedisplay-color-enhance-off", &mlc->ce_off_cmds_len); - if (mlc->ce_off_cmds_len) - mlc->caps |= MODE_COLOR_ENHANCE; - } - - for (i = 0; i < MAX_PRESETS; i++) { - memset(preset_name, 0, sizeof(preset_name)); - snprintf(preset_name, 64, "%s-%d", "cm,mdss-livedisplay-preset", i); - mlc->presets[mlc->num_presets] = of_get_property(np, preset_name, - &mlc->presets_len[mlc->num_presets]); - if (mlc->presets_len[mlc->num_presets] > 0) - mlc->num_presets++; - } - - if (mlc->num_presets) - mlc->caps |= MODE_PRESET; - - mlc->post_cmds = of_get_property(np, - "cm,mdss-livedisplay-post-cmd", &mlc->post_cmds_len); - - mlc->caps |= MODE_RGB; - mlc->r = mlc->g = mlc->b = 32768; - mlc->updated = 0; - - mutex_init(&mlc->lock); - - if (mlc->caps) - mlc->cmd_buf = kzalloc(sizeof(uint8_t) * 1024, GFP_KERNEL); - - mlc->wq = create_singlethread_workqueue("livedisplay_wq"); - INIT_WORK(&mlc->update_work, mdss_livedisplay_worker); - - pinfo->livedisplay = mlc; - return 0; -} - -int mdss_livedisplay_create_sysfs(struct msm_fb_data_type *mfd) -{ - int rc = 0; - struct mdss_livedisplay_ctx *mlc = get_ctx(mfd); - - if (mlc == NULL) - return 0; - - rc = sysfs_create_file(&mfd->fbi->dev->kobj, &dev_attr_rgb.attr); - if (rc) - goto sysfs_err; - - if (mlc->caps & MODE_CABC) { - rc = sysfs_create_file(&mfd->fbi->dev->kobj, &dev_attr_cabc.attr); - if (rc) - goto sysfs_err; - } - - if (mlc->caps & MODE_SRE) { - rc = sysfs_create_file(&mfd->fbi->dev->kobj, &dev_attr_sre.attr); - if (rc) - goto sysfs_err; - } - - if (mlc->caps & MODE_AUTO_CONTRAST) { - rc = sysfs_create_file(&mfd->fbi->dev->kobj, &dev_attr_aco.attr); - if (rc) - goto sysfs_err; - } - - if (mlc->caps & MODE_COLOR_ENHANCE) { - rc = sysfs_create_file(&mfd->fbi->dev->kobj, &dev_attr_color_enhance.attr); - if (rc) - goto sysfs_err; - } - - if (mlc->caps & MODE_PRESET) { - rc = sysfs_create_file(&mfd->fbi->dev->kobj, &dev_attr_preset.attr); - if (rc) - goto sysfs_err; - rc = sysfs_create_file(&mfd->fbi->dev->kobj, &dev_attr_num_presets.attr); - if (rc) - goto sysfs_err; - } - - mlc->mfd = mfd; - - return rc; - -sysfs_err: - pr_err("%s: sysfs creation failed, rc=%d", __func__, rc); - return rc; -} - diff --git a/drivers/video/msm/mdss/mdss_livedisplay.h b/drivers/video/msm/mdss/mdss_livedisplay.h deleted file mode 100644 index 7d8432471ee47..0000000000000 --- a/drivers/video/msm/mdss/mdss_livedisplay.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2015 The CyanogenMod Project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef MDSS_LIVEDISPLAY_H -#define MDSS_LIVEDISPLAY_H - -#include -#include -#include - -#include "mdss_dsi.h" -#include "mdss_fb.h" - -#define MAX_PRESETS 10 - -struct mdss_livedisplay_ctx { - uint8_t cabc_ui_value; - uint8_t cabc_image_value; - uint8_t cabc_video_value; - uint8_t sre_weak_value; - uint8_t sre_medium_value; - uint8_t sre_strong_value; - uint8_t aco_value; - - const uint8_t *ce_off_cmds; - const uint8_t *ce_on_cmds; - unsigned int ce_off_cmds_len; - unsigned int ce_on_cmds_len; - - const uint8_t *presets[MAX_PRESETS]; - unsigned int presets_len[MAX_PRESETS]; - - const uint8_t *cabc_cmds; - unsigned int cabc_cmds_len; - - const uint8_t *post_cmds; - unsigned int post_cmds_len; - - unsigned int preset; - unsigned int cabc_level; - unsigned int sre_level; - bool aco_enabled; - bool ce_enabled; - - unsigned int num_presets; - unsigned int caps; - - uint32_t r, g, b; - - struct msm_fb_data_type *mfd; - - struct mutex lock; - struct work_struct update_work; - struct workqueue_struct *wq; - - uint32_t updated; - uint8_t *cmd_buf; -}; - -enum { - CABC_OFF, - CABC_UI, - CABC_IMAGE, - CABC_VIDEO, - CABC_MAX -}; - -enum { - SRE_OFF, - SRE_WEAK, - SRE_MEDIUM, - SRE_STRONG, - SRE_MAX -}; - -enum { - MODE_CABC = 0x01, - MODE_SRE = 0x02, - MODE_AUTO_CONTRAST = 0x04, - MODE_COLOR_ENHANCE = 0x08, - MODE_PRESET = 0x10, - MODE_RGB = 0x20, - MODE_UPDATE_ALL = 0xFF, -}; - -void mdss_livedisplay_update(struct mdss_livedisplay_ctx *mlc, uint32_t updated); -int mdss_livedisplay_parse_dt(struct device_node *np, struct mdss_panel_info *pinfo); -int mdss_livedisplay_create_sysfs(struct msm_fb_data_type *mfd); - -static inline bool is_cabc_cmd(uint32_t value) -{ - return (value & MODE_CABC) || (value & MODE_SRE) || (value & MODE_AUTO_CONTRAST); -} - -static inline struct mdss_livedisplay_ctx* get_ctx(struct msm_fb_data_type *mfd) -{ - return mfd->panel_info->livedisplay; -} - -static inline struct mdss_dsi_ctrl_pdata* get_ctrl(struct msm_fb_data_type *mfd) -{ - struct mdss_panel_data *pdata = dev_get_platdata(&mfd->pdev->dev); - return container_of(pdata, struct mdss_dsi_ctrl_pdata, panel_data); -} - -#endif diff --git a/drivers/video/msm/mdss/mdss_panel.h b/drivers/video/msm/mdss/mdss_panel.h index f48890a03a8a5..873c45dc6dd9b 100755 --- a/drivers/video/msm/mdss/mdss_panel.h +++ b/drivers/video/msm/mdss/mdss_panel.h @@ -412,8 +412,6 @@ struct mdss_mdp_pp_tear_check { u32 refx100; }; -struct mdss_livedisplay_ctx; - struct mdss_panel_info { u32 xres; u32 yres; @@ -491,8 +489,6 @@ struct mdss_panel_info { struct lvds_panel_info lvds; struct edp_panel_info edp; - struct mdss_livedisplay_ctx *livedisplay; - /* debugfs structure for the panel */ struct mdss_panel_debugfs_info *debugfs_info; }; From 493f56d419015e0c6240e9a189e99d083efa6e9d Mon Sep 17 00:00:00 2001 From: friedrich420 Date: Fri, 27 Feb 2015 00:11:28 +0200 Subject: [PATCH 49/75] Slimbus Overclock --- drivers/slimbus/slim-msm-ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/slimbus/slim-msm-ctrl.c b/drivers/slimbus/slim-msm-ctrl.c index d13a54b2cd4f0..c061e35c8f594 100644 --- a/drivers/slimbus/slim-msm-ctrl.c +++ b/drivers/slimbus/slim-msm-ctrl.c @@ -92,8 +92,8 @@ enum mgr_intr { enum frm_cfg { FRM_ACTIVE = 1, - CLK_GEAR = 7, - ROOT_FREQ = 11, + CLK_GEAR = 10, + ROOT_FREQ = 31, REF_CLK_GEAR = 15, INTR_WAKE = 19, }; From e81d4fbe38ca4da67777efb1b107b781450cdd93 Mon Sep 17 00:00:00 2001 From: qiuchangping Date: Thu, 29 Dec 2016 13:05:48 +0800 Subject: [PATCH 50/75] Enable OTG by default, disable OTG switch feature Change-Id: I48f161416bc241810369e5e4efeb88f96f567fb5 --- drivers/usb/dwc3/dwc3_otg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3_otg.c b/drivers/usb/dwc3/dwc3_otg.c index 02c7b0e0a58f5..e45d92b9984f8 100644 --- a/drivers/usb/dwc3/dwc3_otg.c +++ b/drivers/usb/dwc3/dwc3_otg.c @@ -746,7 +746,6 @@ static void dwc3_otg_sm_work(struct work_struct *w) * * Returns 0 on success otherwise negative errno. */ - int dwc3_otg_init(struct dwc3 *dwc) { struct dwc3_otg *dotg; From 4c93800ff4688eaab7956c6c6002149b33e1f923 Mon Sep 17 00:00:00 2001 From: Hikari-no-Tenshi Date: Sat, 26 Nov 2016 21:47:45 +0200 Subject: [PATCH 51/75] drivers: power: Fix 2% battery level drop --- drivers/power/qpnp-fg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/qpnp-fg.c b/drivers/power/qpnp-fg.c index ca621e1c07e95..5ecfc3160b9d7 100644 --- a/drivers/power/qpnp-fg.c +++ b/drivers/power/qpnp-fg.c @@ -5840,7 +5840,7 @@ static int fg_common_hw_init(struct fg_chip *chip) } rc = fg_mem_masked_write(chip, settings[FG_MEM_DELTA_SOC].address, 0xFF, - soc_to_setpoint(settings[FG_MEM_DELTA_SOC].value), + settings[FG_MEM_DELTA_SOC].value == 1 ? 1 : soc_to_setpoint(settings[FG_MEM_DELTA_SOC].value), settings[FG_MEM_DELTA_SOC].offset); if (rc) { pr_err("failed to write delta soc rc=%d\n", rc); From c1da4d1cb833ba5b2d2f6e35c50b8f1160cf5267 Mon Sep 17 00:00:00 2001 From: franciscofranco Date: Thu, 28 Jan 2016 01:13:45 +0000 Subject: [PATCH 52/75] display: add a simple api to query the display state (on/off) at any point in time Signed-off-by: franciscofranco --- drivers/video/msm/mdss/mdss_dsi_panel.c | 10 ++++++++++ include/linux/display_state.h | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 include/linux/display_state.h diff --git a/drivers/video/msm/mdss/mdss_dsi_panel.c b/drivers/video/msm/mdss/mdss_dsi_panel.c index c8097b66d3fcd..637d1a9c54603 100755 --- a/drivers/video/msm/mdss/mdss_dsi_panel.c +++ b/drivers/video/msm/mdss/mdss_dsi_panel.c @@ -23,6 +23,7 @@ #include #include +#include #include "mdss_dsi.h" #include "mdss_mdp.h" @@ -30,6 +31,12 @@ #define MIN_REFRESH_RATE 30 #define DEFAULT_MDP_TRANSFER_TIME 14000 +bool display_on = true; + +bool is_display_on() +{ + return display_on; +} #ifdef VENDOR_EDIT #include @@ -971,6 +978,7 @@ static int mdss_dsi_panel_on(struct mdss_panel_data *pdata) return -EINVAL; } + display_on = true; pinfo = &pdata->panel_info; ctrl = container_of(pdata, struct mdss_dsi_ctrl_pdata, panel_data); @@ -1093,6 +1101,8 @@ static int mdss_dsi_panel_off(struct mdss_panel_data *pdata) if (ctrl->off_cmds.cmd_cnt) mdss_dsi_panel_cmds_send(ctrl, &ctrl->off_cmds, CMD_REQ_COMMIT); + display_on = false; + // memset(rx_buf, 0, sizeof(rx_buf)); // mdss_debug_enable_clock(1); // mdss_dsi_panel_cmd_read(ctrl, 0x0A, 0, NULL, rx_buf, 1); diff --git a/include/linux/display_state.h b/include/linux/display_state.h new file mode 100644 index 0000000000000..e2cd6011edec5 --- /dev/null +++ b/include/linux/display_state.h @@ -0,0 +1,17 @@ +/* + * include/linux/display_state.h + * + * Copyright (c) 2016 Francisco Franco + * franciscofranco.1990@gmail.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _LINUX_DISPLAY_STATE_H +#define _LINUX_DISPLAY_STATE_H + +bool is_display_on(void); + +#endif From 3a9f1394b5a603eee9ffc5d08d1c4e6e71c0b250 Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 30 Dec 2016 21:40:39 +0100 Subject: [PATCH 53/75] Revert "video: mdss: Improve the LiveDisplay driver" This reverts commit ce3df73081b0bbacceb191a0d19c47e91b12275b. --- drivers/video/msm/mdss/mdss_dsi.c | 4 ---- drivers/video/msm/mdss/mdss_dsi_panel.c | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/video/msm/mdss/mdss_dsi.c b/drivers/video/msm/mdss/mdss_dsi.c index ad16dcbebf9bc..ccdd585c52a47 100755 --- a/drivers/video/msm/mdss/mdss_dsi.c +++ b/drivers/video/msm/mdss/mdss_dsi.c @@ -28,7 +28,6 @@ #include "mdss_panel.h" #include "mdss_dsi.h" #include "mdss_debug.h" -#include "mdss_livedisplay.h" #define XO_CLK_RATE 19200000 @@ -956,9 +955,6 @@ static int mdss_dsi_unblank(struct mdss_panel_data *pdata) enable_irq(gpio_to_irq(ctrl_pdata->disp_te_gpio)); } - mdss_livedisplay_update(pdata->panel_info.livedisplay, - MODE_UPDATE_ALL); - error: mdss_dsi_clk_ctrl(ctrl_pdata, DSI_ALL_CLKS, 0); pr_debug("%s-:\n", __func__); diff --git a/drivers/video/msm/mdss/mdss_dsi_panel.c b/drivers/video/msm/mdss/mdss_dsi_panel.c index 637d1a9c54603..e149e4655430b 100755 --- a/drivers/video/msm/mdss/mdss_dsi_panel.c +++ b/drivers/video/msm/mdss/mdss_dsi_panel.c @@ -1045,6 +1045,7 @@ static int mdss_dsi_panel_on(struct mdss_panel_data *pdata) flag_lcd_off = false; mutex_unlock(&cabc_mutex); #endif + mdss_livedisplay_update(ctrl, MODE_UPDATE_ALL); end: pinfo->blank_state = MDSS_PANEL_BLANK_UNBLANK; From 16d812d8858673e45c22badef8db63d308a2d11d Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 30 Dec 2016 21:53:22 +0100 Subject: [PATCH 54/75] remnant from livedisplay Change-Id: Id87a0b9bdab3a441a384926e8a2ff3d381f11dbc --- drivers/video/msm/mdss/mdss_dsi_panel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/msm/mdss/mdss_dsi_panel.c b/drivers/video/msm/mdss/mdss_dsi_panel.c index e149e4655430b..b003c6eb57845 100755 --- a/drivers/video/msm/mdss/mdss_dsi_panel.c +++ b/drivers/video/msm/mdss/mdss_dsi_panel.c @@ -1045,7 +1045,7 @@ static int mdss_dsi_panel_on(struct mdss_panel_data *pdata) flag_lcd_off = false; mutex_unlock(&cabc_mutex); #endif - mdss_livedisplay_update(ctrl, MODE_UPDATE_ALL); + end: pinfo->blank_state = MDSS_PANEL_BLANK_UNBLANK; From d9f9e55e59b06f403047cd7d4c71783ffd55fe67 Mon Sep 17 00:00:00 2001 From: "dl12345@github.com" Date: Tue, 25 Oct 2016 19:36:32 +0700 Subject: [PATCH 55/75] Dirtycow Patch - CVE-2016-5195 Signed-off-by: Shawn Anastasio --- mm/memory.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index a9d76b56dde6d..91057358a869d 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3869,8 +3869,18 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, if (unlikely(pmd_none(*pmd)) && unlikely(__pte_alloc(mm, vma, pmd, address))) return VM_FAULT_OOM; - /* if an huge pmd materialized from under us just retry later */ - if (unlikely(pmd_trans_huge(*pmd))) + /* + * If a huge pmd materialized under us just retry later. Use + * pmd_trans_unstable() instead of pmd_trans_huge() to ensure the pmd + * didn't become pmd_trans_huge under us and then back to pmd_none, as + * a result of MADV_DONTNEED running immediately after a huge pmd fault + * in a different thread of this mm, in turn leading to a misleading + * pmd_trans_huge() retval. All we have to ensure is that it is a + * regular pmd that we can walk with pte_offset_map() and we can do that + * through an atomic read in C, which is what pmd_trans_unstable() + * provides. + */ + if (unlikely(pmd_trans_unstable(pmd))) return 0; /* * A regular pmd is established and it can't morph into a huge pmd From e2a7ad9b5c80d05eaa7aa7cfbee507365da9e814 Mon Sep 17 00:00:00 2001 From: benschhold Date: Fri, 30 Dec 2016 22:27:52 +0100 Subject: [PATCH 56/75] push to 4.9 Change-Id: If65d684c87a3fb6f09a0b46c7a756e458d90ddba --- arch/arm64/configs/cm_oneplus2_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index a226ca0059dd0..7e251f2e5f65b 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -1,4 +1,4 @@ -CONFIG_LOCALVERSION="-benschholds-custom-kernel-v4.8" +CONFIG_LOCALVERSION="-benschholds-custom-kernel-v4.9" CONFIG_SYSVIPC=y CONFIG_AUDIT=y CONFIG_NO_HZ=y From ef31d93d4eb4522014dce34d26289e9ff557af71 Mon Sep 17 00:00:00 2001 From: Simao Gomes Viana Date: Mon, 26 Dec 2016 15:28:17 +0100 Subject: [PATCH 57/75] 2000 mA charging Change-Id: I6ac5fec6e63669ae516dc82d114b955c909fa4cf --- arch/arm/boot/dts/qcom/14049/batterydata-unkown-3300mah.dtsi | 2 +- .../boot/dts/qcom/14049/batterydata_oneplus_ATL_3300mAh.dtsi | 2 +- .../boot/dts/qcom/14049/batterydata_oneplus_SDI_3300mAh.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/qcom/14049/batterydata-unkown-3300mah.dtsi b/arch/arm/boot/dts/qcom/14049/batterydata-unkown-3300mah.dtsi index 4ee01d90bd24d..c0a2f6b7ee6d6 100644 --- a/arch/arm/boot/dts/qcom/14049/batterydata-unkown-3300mah.dtsi +++ b/arch/arm/boot/dts/qcom/14049/batterydata-unkown-3300mah.dtsi @@ -2,7 +2,7 @@ qcom,oneplus_default_3200mah { qcom,max-voltage-uv = <4320000>; qcom,nom-batt-capacity-mah = <3300>; qcom,v-cutoff-uv = <3600000>; - qcom,chg-term-ua = <150000>; + qcom,chg-term-ua = <200000>; qcom,batt-id-kohm = <1>; qcom,battery-beta = <0>; qcom,battery-type = "Unknown Battery"; diff --git a/arch/arm/boot/dts/qcom/14049/batterydata_oneplus_ATL_3300mAh.dtsi b/arch/arm/boot/dts/qcom/14049/batterydata_oneplus_ATL_3300mAh.dtsi index 08924c2b14994..5bd1eda48fe00 100644 --- a/arch/arm/boot/dts/qcom/14049/batterydata_oneplus_ATL_3300mAh.dtsi +++ b/arch/arm/boot/dts/qcom/14049/batterydata_oneplus_ATL_3300mAh.dtsi @@ -2,7 +2,7 @@ qcom,oneplus_3200mah { qcom,max-voltage-uv = <4320000>; qcom,nom-batt-capacity-mah = <3300>; qcom,v-cutoff-uv = <3600000>; - qcom,chg-term-ua = <150000>; + qcom,chg-term-ua = <200000>; qcom,batt-id-kohm = <1>; qcom,battery-beta = <0>; qcom,battery-type = "ATL"; diff --git a/arch/arm/boot/dts/qcom/14049/batterydata_oneplus_SDI_3300mAh.dtsi b/arch/arm/boot/dts/qcom/14049/batterydata_oneplus_SDI_3300mAh.dtsi index 8756ab9405b54..74101ce726890 100644 --- a/arch/arm/boot/dts/qcom/14049/batterydata_oneplus_SDI_3300mAh.dtsi +++ b/arch/arm/boot/dts/qcom/14049/batterydata_oneplus_SDI_3300mAh.dtsi @@ -2,7 +2,7 @@ qcom,oneplus_SDI_3200mah { qcom,max-voltage-uv = <4320000>; qcom,nom-batt-capacity-mah = <3300>; qcom,v-cutoff-uv = <3600000>; - qcom,chg-term-ua = <150000>; + qcom,chg-term-ua = <200000>; qcom,batt-id-kohm = <50>; qcom,battery-beta = <0>; qcom,battery-type = "SDI"; From 846f4a6c2693f4c2d2d32eb818dfca2a09d8f5d3 Mon Sep 17 00:00:00 2001 From: andip71 Date: Mon, 12 Oct 2015 21:25:31 +0200 Subject: [PATCH 58/75] qpnp-smbcharger: Charge Level Interface 1.2 for OPT all credits for OPT version port of OPO driver to ZaneZam - ported to One Plus Two smbcharger driver with keeping AICL/ICL intact - same functionality as with version for One Plus One - added a flag to differentiate some kernel logs produced by the driver Fixes: - Fix charge level interface to remove hard 500 mA limit for USB - Reduce max ac charge rate to 2000 mA - Show tilde in front of actual charge current, to indicate it is inaccurate - fixes wrong display of "no charger" with random data for charge rates after boot up - improved implementation by exchanging a charger type instead of a text between the drivers Change-Id: Ia3a0f0d3482334023065bc0b6ee47dd86763d6e4 Signed-off-by: Simao Gomes Viana --- drivers/power/Kconfig | 6 + drivers/power/Makefile | 1 + drivers/power/charge_level.c | 188 ++++++++++++++++++++++++++++++++ drivers/power/qpnp-smbcharger.c | 184 +++++++++++++++++++++++++++---- include/linux/charge_level.h | 36 ++++++ 5 files changed, 391 insertions(+), 24 deletions(-) create mode 100644 drivers/power/charge_level.c create mode 100644 include/linux/charge_level.h diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 6ef076fbea6cd..46fb9e8d3f7ab 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -475,6 +475,12 @@ config QPNP_FG fuel gauge. The state of charge is reported through a BMS power supply property and also sends uevents when the capacity is updated. +config CHARGE_LEVEL + bool "Charge level interface" + default y + help + Allows configuration of ac and usb charging levels + config PM8921_BMS tristate "PM8921 Battery Monitoring System driver" depends on MFD_PM8921_CORE diff --git a/drivers/power/Makefile b/drivers/power/Makefile index e593f8b873d95..8463eb776f21f 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile @@ -66,6 +66,7 @@ obj-$(CONFIG_QPNP_FG) += qpnp-fg.o obj-$(CONFIG_QPNP_CHARGER) += qpnp-charger.o obj-$(CONFIG_QPNP_LINEAR_CHARGER) += qpnp-linear-charger.o obj-$(CONFIG_QPNP_SMBCHARGER) += qpnp-smbcharger.o +obj-$(CONFIG_CHARGE_LEVEL) += charge_level.o obj-$(CONFIG_CHARGER_SMB347) += smb347-charger.o obj-$(CONFIG_CHARGER_TPS65090) += tps65090-charger.o obj-$(CONFIG_BATTERY_BCL) += battery_current_limit.o diff --git a/drivers/power/charge_level.c b/drivers/power/charge_level.c new file mode 100644 index 0000000000000..8f16d5d88c613 --- /dev/null +++ b/drivers/power/charge_level.c @@ -0,0 +1,188 @@ +/* + * Author: andip71, 11.03.2016 + * + * Version 1.2 + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + + +#include +#include +#include + + +/* sysfs interface for charge levels */ + +static ssize_t charge_level_ac_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) +{ + // print current value + return sprintf(buf, "%d mA", ac_level); +} + + +static ssize_t charge_level_ac_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) +{ + unsigned int ret = -EINVAL; + int val; + + // read value from input buffer + ret = sscanf(buf, "%d", &val); + + if (ret != 1) + return -EINVAL; + + // check whether value is within the valid ranges and adjust accordingly + if (val > AC_CHARGE_LEVEL_MAX) + val = AC_CHARGE_LEVEL_MAX; + + if (val < AC_CHARGE_LEVEL_MIN) + val = AC_CHARGE_LEVEL_MIN; + + // store value + ac_level = val; + + return count; +} + + +static ssize_t charge_level_usb_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) +{ + // print current value + return sprintf(buf, "%d mA", usb_level); +} + + +static ssize_t charge_level_usb_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) +{ + unsigned int ret = -EINVAL; + int val; + + // read value from input buffer + ret = sscanf(buf, "%d", &val); + + if (ret != 1) + return -EINVAL; + + // check whether value is within the valid ranges and adjust accordingly + if (val > USB_CHARGE_LEVEL_MAX) + val = USB_CHARGE_LEVEL_MAX; + + if (val < USB_CHARGE_LEVEL_MIN) + val = USB_CHARGE_LEVEL_MIN; + + // store value + usb_level = val; + + return count; +} + + +static ssize_t charge_info_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) +{ + char charge_info_text[30]; + + // check connected charger type + switch (charger_type) + { + case BK_CHARGER_NONE: + return sprintf(buf, "No charger"); + break; + + case BK_CHARGER_AC: + sprintf(charge_info_text, "AC charger"); + break; + + case BK_CHARGER_USB: + sprintf(charge_info_text, "USB charger"); + break; + + default: + sprintf(charge_info_text, "Unknown charger"); + break; + } + + // stock charge logic + if (charge_level == 0) + return sprintf(buf, "%s / ~%d mA (%d) SL", + charge_info_text, charge_info_level_cur, charge_info_level_req); + + // non-stock charge logic + return sprintf(buf, "%s / ~%d mA (%d)", + charge_info_text, charge_info_level_cur, charge_info_level_req); +} + + +/* Initialize charge level sysfs folder */ + +static struct kobj_attribute charge_level_ac_attribute = +__ATTR(charge_level_ac, 0666, charge_level_ac_show, charge_level_ac_store); + +static struct kobj_attribute charge_level_usb_attribute = +__ATTR(charge_level_usb, 0666, charge_level_usb_show, charge_level_usb_store); + +static struct kobj_attribute charge_info_attribute = +__ATTR(charge_info, 0666, charge_info_show, NULL); + +static struct attribute *charge_level_attrs[] = { +&charge_level_ac_attribute.attr, +&charge_level_usb_attribute.attr, +&charge_info_attribute.attr, +NULL, +}; + +static struct attribute_group charge_level_attr_group = { +.attrs = charge_level_attrs, +}; + +static struct kobject *charge_level_kobj; + + +int charge_level_init(void) +{ + int charge_level_retval; + + charge_level_kobj = kobject_create_and_add("charge_levels", kernel_kobj); + + if (!charge_level_kobj) + { + printk("Boeffla-Kernel: failed to create kernel object for charge level interface.\n"); + return -ENOMEM; + } + + charge_level_retval = sysfs_create_group(charge_level_kobj, &charge_level_attr_group); + + if (charge_level_retval) + { + kobject_put(charge_level_kobj); + printk("Boeffla-Kernel: failed to create fs object for charge level interface.\n"); + return (charge_level_retval); + } + + // print debug info + printk("Boeffla-Kernel: charge level interface started.\n"); + + return (charge_level_retval); +} + + +void charge_level_exit(void) +{ + kobject_put(charge_level_kobj); + + // print debug info + printk("Boeffla-Kernel: charge level interface stopped.\n"); +} + + +/* define driver entry points */ +module_init(charge_level_init); +module_exit(charge_level_exit); diff --git a/drivers/power/qpnp-smbcharger.c b/drivers/power/qpnp-smbcharger.c index 2bedf104d088c..7588964f35b19 100644 --- a/drivers/power/qpnp-smbcharger.c +++ b/drivers/power/qpnp-smbcharger.c @@ -54,6 +54,17 @@ _SMB_MASK((LEFT_BIT_POS) - (RIGHT_BIT_POS) + 1, \ (RIGHT_BIT_POS)) +#ifdef CONFIG_CHARGE_LEVEL +#include "linux/charge_level.h" +int ac_level = AC_CHARGE_LEVEL_DEFAULT; // Set AC default charge level +int usb_level = USB_CHARGE_LEVEL_DEFAULT; // Set USB default charge level +int charge_info_level_req = 0; // requested charge current +int charge_info_level_cur = 0; // current charge current +int charge_level = 0; // 0 = stock charge logic, not 0 = current to set +static bool set_by_charge_level = false; // flag for detection of set values +int charger_type = BK_CHARGER_NONE; +#endif /* CONFIG_CHARGE_LEVEL */ + #ifdef VENDOR_EDIT #define AICL_INIT_FUNCTION_MASK BIT(7) @@ -1915,6 +1926,9 @@ static int smbchg_set_usb_current_max(struct smbchg_chip *chip, out: pr_smb(PR_STATUS, "usb type = %s current set to %d mA\n", usb_type_name, chip->usb_max_current_ma); +#ifdef CONFIG_CHARGE_LEVEL + charge_info_level_req = chip->usb_max_current_ma; +#endif /* CONFIG_CHARGE_LEVEL */ return rc; } @@ -2064,6 +2078,7 @@ static int smbchg_set_fastchg_current_raw(struct smbchg_chip *chip, CURRENT_500_MA, rc); else chip->fastchg_current_ma = 500; + return rc; } @@ -2817,8 +2832,18 @@ static int smbchg_set_thermal_limited_usb_current_max(struct smbchg_chip *chip, return rc; } - pr_err("AICL = %d, ICL = %d\n", - aicl_ma, chip->usb_max_current_ma); +#ifdef CONFIG_CHARGE_LEVEL + if (set_by_charge_level) { + pr_err("AICL = %d, ICL = %d requested by charge level interface\n", + aicl_ma, chip->usb_max_current_ma); + set_by_charge_level = false; + } else { +#endif /* CONFIG_CHARGE_LEVEL */ + pr_err("AICL = %d, ICL = %d\n", + aicl_ma, chip->usb_max_current_ma); +#ifdef CONFIG_CHARGE_LEVEL + } +#endif /* CONFIG_CHARGE_LEVEL */ if (chip->usb_max_current_ma > aicl_ma && smbchg_is_aicl_complete(chip)) smbchg_rerun_aicl(chip); smbchg_parallel_usb_check_ok(chip); @@ -4297,6 +4322,25 @@ static void handle_usb_insertion(struct smbchg_chip *chip) "inserted type = %d (%s)", usb_supply_type, usb_type_name); smbchg_aicl_deglitch_wa_check(chip); + +#ifdef CONFIG_CHARGE_LEVEL + if (usb_supply_type == POWER_SUPPLY_TYPE_USB_DCP) + { + charge_level = ac_level; + charger_type = BK_CHARGER_AC; + } + else if (usb_supply_type == POWER_SUPPLY_TYPE_USB) + { + charge_level = usb_level; + charger_type = BK_CHARGER_USB; + } + else + { + charge_level = 0; // enable stock charging logic + charger_type = BK_CHARGER_UNKNOWN; + pr_info("Boeffla-Kernel: Unknown charger detected with ID %d", usb_supply_type); } +#endif /* CONFIG_CHARGE_LEVEL */ + if (chip->usb_psy) { pr_smb(PR_MISC, "setting usb psy type = %d\n", usb_supply_type); @@ -4374,6 +4418,12 @@ void update_usb_status(struct smbchg_chip *chip, bool usb_present, bool force) chip->time_out = false;// usb unplug agin ,set charge time_out false chip->recharge_status=false;// usb unplug agin ,set charge time_out false chip->usb_present = usb_present; +#ifdef CONFIG_CHARGE_LEVEL + charge_level = 0; + charge_info_level_req = 0; + charge_info_level_cur = 0; + charger_type = BK_CHARGER_NONE; +#endif /* CONFIG_CHARGE_LEVEL */ handle_usb_removal(chip); } @@ -7058,6 +7108,10 @@ static void qpnp_check_charger_uovp(struct smbchg_chip *chip) pr_debug("%s %d %d\n", __func__, vchg_mv, chip->charger_status); +#ifdef CONFIG_CHARGE_LEVEL + charge_info_level_cur = abs(get_prop_batt_current_now(chip)) / 1000; +#endif /* CONFIG_CHARGE_LEVEL */ + if(chip->charger_status == CHARGER_STATUS_GOOD) { if(vchg_mv > CHARGER_SOFT_OVP_VOLTAGE || vchg_mv <= CHARGER_SOFT_UVP_VOLTAGE) { @@ -7145,9 +7199,18 @@ static int handle_batt_temp_little_cold(struct smbchg_chip *chip) if(qpnp_battery_temp_region_get(chip) == CV_BATTERY_TEMP_REGION__HOT || qpnp_battery_temp_region_get(chip) == CV_BATTERY_TEMP_REGION__COLD) smbchg_charging_en(chip, 1); - - chip->usb_psy->get_property(chip->usb_psy, - POWER_SUPPLY_PROP_CURRENT_MAX, &ret); +#ifdef CONFIG_CHARGE_LEVEL + if (charge_level != 0) { + set_by_charge_level = true; + chip->usb_target_current_ma = charge_level; + smbchg_set_usb_current_max(chip, charge_level); + smbchg_rerun_aicl(chip); + chip->usb_psy->get_property(chip->usb_psy, + POWER_SUPPLY_PROP_CURRENT_MAX, &ret); + } else { +#endif /* CONFIG_CHARGE_LEVEL */ + chip->usb_psy->get_property(chip->usb_psy, + POWER_SUPPLY_PROP_CURRENT_MAX, &ret); if(ret.intval / 1000 == 500) { smbchg_set_usb_current_max(chip, ret.intval / 1000); @@ -7178,7 +7241,9 @@ static int handle_batt_temp_little_cold(struct smbchg_chip *chip) smbchg_rerun_aicl(chip); } } - +#ifdef CONFIG_CHARGE_LEVEL + } +#endif /* CONFIG_CHARGE_LEVEL */ smbchg_float_voltage_set(chip, chip->temp_more_cool_vbatdel); //qpnp_set_recharge(chip,100);//chip->temp_more_cool_vbatdel -3700); smbchg_set_fastchg_current(chip, chip->temp_more_cool_current); @@ -7218,6 +7283,16 @@ static int handle_batt_temp_cool(struct smbchg_chip *chip) if(qpnp_battery_temp_region_get(chip) == CV_BATTERY_TEMP_REGION__HOT || qpnp_battery_temp_region_get(chip) == CV_BATTERY_TEMP_REGION__COLD) smbchg_charging_en(chip, 1); +#ifdef CONFIG_CHARGE_LEVEL + if (charge_level != 0) { + set_by_charge_level = true; + chip->usb_target_current_ma = charge_level; + smbchg_set_usb_current_max(chip, charge_level); + smbchg_rerun_aicl(chip); + chip->usb_psy->get_property(chip->usb_psy, + POWER_SUPPLY_PROP_CURRENT_MAX, &ret); + } else { +#endif /* CONFIG_CHARGE_LEVEL */ chip->usb_psy->get_property(chip->usb_psy, POWER_SUPPLY_PROP_CURRENT_MAX, &ret); if(ret.intval / 1000 == 500) { @@ -7248,7 +7323,9 @@ static int handle_batt_temp_cool(struct smbchg_chip *chip) smbchg_rerun_aicl(chip); } } - +#ifdef CONFIG_CHARGE_LEVEL + } +#endif /* CONFIG_CHARGE_LEVEL */ if(ret.intval / 1000 == 1500){ smbchg_float_voltage_set(chip, chip->temp_cool_vbatdel); @@ -7297,7 +7374,17 @@ static int handle_batt_temp_little_cool(struct smbchg_chip *chip) if(qpnp_battery_temp_region_get(chip) == CV_BATTERY_TEMP_REGION__HOT || qpnp_battery_temp_region_get(chip) == CV_BATTERY_TEMP_REGION__COLD) smbchg_charging_en(chip, 1); - chip->usb_psy->get_property(chip->usb_psy, +#ifdef CONFIG_CHARGE_LEVEL + if (charge_level != 0) { + set_by_charge_level = true; + chip->usb_target_current_ma = charge_level; + smbchg_set_usb_current_max(chip, charge_level); + smbchg_rerun_aicl(chip); + chip->usb_psy->get_property(chip->usb_psy, + POWER_SUPPLY_PROP_CURRENT_MAX, &ret); + } else { +#endif /* CONFIG_CHARGE_LEVEL */ + chip->usb_psy->get_property(chip->usb_psy, POWER_SUPPLY_PROP_CURRENT_MAX, &ret); if(ret.intval / 1000 == 500) { smbchg_set_usb_current_max(chip, ret.intval / 1000); @@ -7328,7 +7415,9 @@ static int handle_batt_temp_little_cool(struct smbchg_chip *chip) smbchg_rerun_aicl(chip); } } - +#ifdef CONFIG_CHARGE_LEVEL + } +#endif /* CONFIG_CHARGE_LEVEL */ if(ret.intval / 1000 == 1500) { smbchg_float_voltage_set(chip, chip->temp_littel_cool_vbatdel); if(get_prop_batt_voltage_now(chip)> 4180*1000) { @@ -7453,7 +7542,17 @@ static int handle_batt_temp_normal(struct smbchg_chip *chip) /* Update battery temp region */ qpnp_battery_temp_region_set(chip, CV_BATTERY_TEMP_REGION__NORMAL); - chip->usb_psy->get_property(chip->usb_psy, +#ifdef CONFIG_CHARGE_LEVEL + if (charge_level != 0) { + set_by_charge_level = true; + chip->usb_target_current_ma = charge_level; + smbchg_set_usb_current_max(chip, charge_level); + smbchg_rerun_aicl(chip); + chip->usb_psy->get_property(chip->usb_psy, + POWER_SUPPLY_PROP_CURRENT_MAX, &ret); + } else { +#endif /* CONFIG_CHARGE_LEVEL */ + chip->usb_psy->get_property(chip->usb_psy, POWER_SUPPLY_PROP_CURRENT_MAX, &ret); if(ret.intval / 1000 == 500) { smbchg_set_usb_current_max(chip, ret.intval / 1000); @@ -7484,21 +7583,47 @@ static int handle_batt_temp_normal(struct smbchg_chip *chip) smbchg_rerun_aicl(chip); } } +#ifdef CONFIG_CHARGE_LEVEL + } +#endif /* CONFIG_CHARGE_LEVEL */ +#ifdef CONFIG_CHARGE_LEVEL + if (charge_level != 0) + { + if(ret.intval / 1000 == 1500) + { + if (chip->aicl_current != 0 && chip->aicl_current <= 1500) + smbchg_set_fastchg_current(chip, charge_level); + else + smbchg_set_fastchg_current(chip, charge_level); + smbchg_float_voltage_set(chip, chip->temp_normal_vbatdel); - if(ret.intval / 1000 == 1500) - { - if (chip->aicl_current != 0 && chip->aicl_current <= 1500) - smbchg_set_fastchg_current(chip, chip->aicl_current); - else - smbchg_set_fastchg_current(chip, chip->temp_normal_current); - smbchg_float_voltage_set(chip, chip->temp_normal_vbatdel); + }else{ + smbchg_set_fastchg_current(chip, charge_level); + smbchg_float_voltage_set(chip, chip->temp_normal_vbatdel); - }else{ - smbchg_set_fastchg_current(chip, 500); - smbchg_float_voltage_set(chip, chip->temp_normal_vbatdel); + } + } + else + { +#endif /* CONFIG_CHARGE_LEVEL */ + if(ret.intval / 1000 == 1500) + { + if (chip->aicl_current != 0 && chip->aicl_current <= 1500) + smbchg_set_fastchg_current(chip, chip->aicl_current); + else + smbchg_set_fastchg_current(chip, chip->temp_normal_current); + smbchg_float_voltage_set(chip, chip->temp_normal_vbatdel); + + }else{ + smbchg_set_fastchg_current(chip, 500); + smbchg_float_voltage_set(chip, chip->temp_normal_vbatdel); + + } +#ifdef CONFIG_CHARGE_LEVEL + } +#endif /* CONFIG_CHARGE_LEVEL */ - } qpnp_set_recharge(chip,chip->resume_delta_mv); /* Update the temperature boundaries */ @@ -7531,8 +7656,17 @@ static int handle_batt_temp_warm(struct smbchg_chip *chip) if(qpnp_battery_temp_region_get(chip) == CV_BATTERY_TEMP_REGION__HOT || qpnp_battery_temp_region_get(chip) == CV_BATTERY_TEMP_REGION__COLD) smbchg_charging_en(chip, 1); - - chip->usb_psy->get_property(chip->usb_psy, +#ifdef CONFIG_CHARGE_LEVEL + if (charge_level != 0) { + set_by_charge_level = true; + chip->usb_target_current_ma = charge_level; + smbchg_set_usb_current_max(chip, charge_level); + smbchg_rerun_aicl(chip); + chip->usb_psy->get_property(chip->usb_psy, + POWER_SUPPLY_PROP_CURRENT_MAX, &ret); + } else { +#endif /* CONFIG_CHARGE_LEVEL */ + chip->usb_psy->get_property(chip->usb_psy, POWER_SUPPLY_PROP_CURRENT_MAX, &ret); if(ret.intval / 1000 == 500) { smbchg_set_usb_current_max(chip, ret.intval / 1000); @@ -7562,7 +7696,9 @@ static int handle_batt_temp_warm(struct smbchg_chip *chip) smbchg_rerun_aicl(chip); } } - +#ifdef CONFIG_CHARGE_LEVEL + } +#endif /* CONFIG_CHARGE_LEVEL */ if(ret.intval / 1000 == 1500){ smbchg_float_voltage_set(chip, chip->temp_warm_vbatdel); diff --git a/include/linux/charge_level.h b/include/linux/charge_level.h new file mode 100644 index 0000000000000..fa3a3b91068db --- /dev/null +++ b/include/linux/charge_level.h @@ -0,0 +1,36 @@ +/* + * Author: andip71, 11.03.2016 + * + * Version 1.2 + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +extern int ac_level; +extern int usb_level; +extern int charge_level; +extern int charge_info_level_cur; +extern int charge_info_level_req; +extern int charger_type; + +#define AC_CHARGE_LEVEL_DEFAULT 0 // 0 = stock charging logic will apply +#define AC_CHARGE_LEVEL_MIN 0 +#define AC_CHARGE_LEVEL_MAX 2000 + +#define USB_CHARGE_LEVEL_DEFAULT 0 // 0 = stock charging logic will apply +#define USB_CHARGE_LEVEL_MIN 0 +#define USB_CHARGE_LEVEL_MAX 1600 + +#define BK_CHARGER_NONE 0 +#define BK_CHARGER_AC 1 +#define BK_CHARGER_USB 2 +#define BK_CHARGER_UNKNOWN 3 + From db66bdbfb4642a3c3fa32c36d56aae123c4bf5b9 Mon Sep 17 00:00:00 2001 From: Simao Gomes Viana Date: Thu, 29 Dec 2016 17:40:25 +0100 Subject: [PATCH 59/75] Use better charge levels Change-Id: I0136354c5e35996adc4106e9e429299f663ee5d7 --- include/linux/charge_level.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/charge_level.h b/include/linux/charge_level.h index fa3a3b91068db..d8e743d13c4a1 100644 --- a/include/linux/charge_level.h +++ b/include/linux/charge_level.h @@ -21,13 +21,13 @@ extern int charge_info_level_cur; extern int charge_info_level_req; extern int charger_type; -#define AC_CHARGE_LEVEL_DEFAULT 0 // 0 = stock charging logic will apply -#define AC_CHARGE_LEVEL_MIN 0 +#define AC_CHARGE_LEVEL_DEFAULT 2000 // 0 = stock charging logic will apply +#define AC_CHARGE_LEVEL_MIN 240 #define AC_CHARGE_LEVEL_MAX 2000 -#define USB_CHARGE_LEVEL_DEFAULT 0 // 0 = stock charging logic will apply -#define USB_CHARGE_LEVEL_MIN 0 -#define USB_CHARGE_LEVEL_MAX 1600 +#define USB_CHARGE_LEVEL_DEFAULT 1500 // 0 = stock charging logic will apply +#define USB_CHARGE_LEVEL_MIN 200 +#define USB_CHARGE_LEVEL_MAX 2000 #define BK_CHARGER_NONE 0 #define BK_CHARGER_AC 1 From c986d0c2e80bf042659591c78a1d1f66fca838cb Mon Sep 17 00:00:00 2001 From: flar2 Date: Wed, 2 Dec 2015 21:04:40 -0500 Subject: [PATCH 60/75] mdss_fb: backlight dimmer option Change-Id: I5bbca099cf6feb294cf1d4d9e6ef08cfc939c183 Signed-off-by: AudioGod Signed-off-by: Simao Gomes Viana --- drivers/video/msm/mdss/mdss_fb.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c index f0e42fbd4fcf0..f53f04634c31a 100755 --- a/drivers/video/msm/mdss/mdss_fb.c +++ b/drivers/video/msm/mdss/mdss_fb.c @@ -72,6 +72,13 @@ #define BLANK_FLAG_LP FB_BLANK_VSYNC_SUSPEND #define BLANK_FLAG_ULP FB_BLANK_NORMAL +#define MDSS_BRIGHT_TO_BL_DIMMER(out, v) do {\ + out = (((v) - 2) * 255 / 250);\ + } while (0) + +bool backlight_dimmer = false; +module_param(backlight_dimmer, bool, 0755); + static struct fb_info *fbi_list[MAX_FBI_LIST]; static int fbi_list_index; @@ -270,10 +277,17 @@ static void mdss_fb_set_bl_brightness(struct led_classdev *led_cdev, if(!value) count = 1; #endif - /* This maps android backlight level 0 to 255 into - driver backlight level 0 to bl_max with rounding */ - MDSS_BRIGHT_TO_BL(bl_lvl, value, mfd->panel_info->bl_max, - mfd->panel_info->brightness_max); + if (backlight_dimmer) { + if (value < 3) + bl_lvl = 1; + else + MDSS_BRIGHT_TO_BL_DIMMER(bl_lvl, value); + } else { + /* This maps android backlight level 0 to 255 into + driver backlight level 0 to bl_max with rounding */ + MDSS_BRIGHT_TO_BL(bl_lvl, value, mfd->panel_info->bl_max, + mfd->panel_info->brightness_max); + } if (!bl_lvl && value) bl_lvl = 1; From 4d71ea9f8722896fab28f17d64807b5fd9ae846a Mon Sep 17 00:00:00 2001 From: imoseyon Date: Wed, 18 Nov 2015 22:27:12 -0800 Subject: [PATCH 61/75] cpufreq: show cpu voltages via sysfs * use the known sysfs node for compatibility Change-Id: I978a38e3108667c4ccd805249db4f2b0e3bd8716 Signed-off-by: AudioGod Signed-off-by: Simao Gomes Viana --- drivers/clk/qcom/clock-cpu-8994.c | 37 +++++++++++++++++++++++++++++++ drivers/cpufreq/cpufreq.c | 9 ++++++++ 2 files changed, 46 insertions(+) diff --git a/drivers/clk/qcom/clock-cpu-8994.c b/drivers/clk/qcom/clock-cpu-8994.c index e0043959457f1..8d0036f0cae52 100644 --- a/drivers/clk/qcom/clock-cpu-8994.c +++ b/drivers/clk/qcom/clock-cpu-8994.c @@ -2140,6 +2140,43 @@ static struct platform_driver cpu_clock_8994_driver = { }, }; +ssize_t vc_get_vdd(char *buf) +{ + struct opp *opppoop; + struct clk *c5; + int i, len = 0, levels; + + c5 = &a53_clk.c; + levels = c5->vdd_class->num_levels; + + rcu_read_lock(); + if (buf) { + for(i=1; i < levels; i++) { + opppoop = dev_pm_opp_find_freq_exact(get_cpu_device(0), + c5->fmax[i], true); + len += sprintf(buf + len, "%umhz: %d mV\n", + (unsigned int)c5->fmax[i]/1000000, + (int)dev_pm_opp_get_voltage(opppoop)/1000 ); + } + } + + c5 = &a57_clk.c; + levels = c5->vdd_class->num_levels; + + if (buf) { + for(i=1; i < levels; i++) { + opppoop = dev_pm_opp_find_freq_exact(get_cpu_device(4), + c5->fmax[i], true); + len += sprintf(buf + len, "%umhz: %d mV\n", + (unsigned int)c5->fmax[i]/1000000, + (int)dev_pm_opp_get_voltage(opppoop)/1000 ); + } + } + rcu_read_unlock(); + + return len; +} + /* CPU devices are not currently available in arch_initcall */ static int __init cpu_clock_8994_init_opp(void) { diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 4e1f7d794f103..898c0c4ae8591 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -673,6 +673,13 @@ static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf) return sprintf(buf, "%u\n", policy->cpuinfo.max_freq); } +extern ssize_t vc_get_vdd(char *buf); + +static ssize_t show_UV_mV_table(struct cpufreq_policy *policy, char *buf) +{ + return vc_get_vdd(buf); +} + cpufreq_freq_attr_ro_perm(cpuinfo_cur_freq, 0400); cpufreq_freq_attr_ro(cpuinfo_min_freq); cpufreq_freq_attr_ro(cpuinfo_max_freq); @@ -687,6 +694,7 @@ cpufreq_freq_attr_rw(scaling_min_freq); cpufreq_freq_attr_rw(scaling_max_freq); cpufreq_freq_attr_rw(scaling_governor); cpufreq_freq_attr_rw(scaling_setspeed); +cpufreq_freq_attr_ro(UV_mV_table); static struct attribute *default_attrs[] = { &cpuinfo_min_freq.attr, @@ -700,6 +708,7 @@ static struct attribute *default_attrs[] = { &scaling_driver.attr, &scaling_available_governors.attr, &scaling_setspeed.attr, + &UV_mV_table.attr, NULL }; From 7c153a60b81a7137e688c961fcad98a74e1eac0e Mon Sep 17 00:00:00 2001 From: Susan Date: Fri, 13 Nov 2015 23:11:30 -0500 Subject: [PATCH 62/75] Disable power_aware and enable all cores on boot. Change-Id: Iedf27c35be1e284672b4ad0120b849775e3f38e9 Signed-off-by: AudioGod Signed-off-by: Simao Gomes Viana --- arch/arm/boot/dts/qcom/msm8994.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/qcom/msm8994.dtsi b/arch/arm/boot/dts/qcom/msm8994.dtsi index 215943fa20abd..926ba99527d0a 100644 --- a/arch/arm/boot/dts/qcom/msm8994.dtsi +++ b/arch/arm/boot/dts/qcom/msm8994.dtsi @@ -24,7 +24,7 @@ interrupt-parent = <&intc>; chosen { - bootargs = "sched_enable_hmp=1 sched_enable_power_aware=1"; + bootargs = "boot_cpus=0,1,2,3,4,5,6,7 sched_enable_hmp=1 sched_enable_power_aware=0"; }; aliases { From ca0ec30cb5a4bc8d97320d6782728103a2cd4596 Mon Sep 17 00:00:00 2001 From: Simao Gomes Viana Date: Sat, 31 Dec 2016 18:39:21 +0100 Subject: [PATCH 63/75] charge_level: higher charging rates Change-Id: I5e41abc56a5271056b6350a44a4bef6d02048976 --- include/linux/charge_level.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/charge_level.h b/include/linux/charge_level.h index d8e743d13c4a1..58159f0e8fc2f 100644 --- a/include/linux/charge_level.h +++ b/include/linux/charge_level.h @@ -22,10 +22,10 @@ extern int charge_info_level_req; extern int charger_type; #define AC_CHARGE_LEVEL_DEFAULT 2000 // 0 = stock charging logic will apply -#define AC_CHARGE_LEVEL_MIN 240 +#define AC_CHARGE_LEVEL_MIN 360 #define AC_CHARGE_LEVEL_MAX 2000 -#define USB_CHARGE_LEVEL_DEFAULT 1500 // 0 = stock charging logic will apply +#define USB_CHARGE_LEVEL_DEFAULT 2000 // 0 = stock charging logic will apply #define USB_CHARGE_LEVEL_MIN 200 #define USB_CHARGE_LEVEL_MAX 2000 From 59401f3cb20101637cc4980f77290934d1ba782e Mon Sep 17 00:00:00 2001 From: Simao Gomes Viana Date: Fri, 2 Dec 2016 21:39:47 +0100 Subject: [PATCH 64/75] defconfig: enable charge level control --- arch/arm64/configs/cm_oneplus2_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/configs/cm_oneplus2_defconfig b/arch/arm64/configs/cm_oneplus2_defconfig index a226ca0059dd0..50b30602fe1f8 100644 --- a/arch/arm64/configs/cm_oneplus2_defconfig +++ b/arch/arm64/configs/cm_oneplus2_defconfig @@ -589,3 +589,5 @@ CONFIG_MSM_HOTPLUG=y CONFIG_ADRENO_IDLER=y CONFIG_SOUND_CONTROL_HAX_3_GPL=y CONFIG_FB_MSM_MDSS_KCAL_CTRL=y +CONFIG_USB_NET_AX8817X=m +CONFIG_CHARGE_LEVEL=y From d78a83dad3e88ab09f81ce3f553d6ea3fc770193 Mon Sep 17 00:00:00 2001 From: Sultanxda Date: Fri, 21 Oct 2016 01:37:16 -0700 Subject: [PATCH 65/75] proc: Remove verifiedbootstate flag from /proc/cmdline Userspace parses this and sets the ro.boot.verifiedbootstate prop according to the value that this flag has. When ro.boot.verifiedbootstate is not 'green', SafetyNet is tripped and fails the CTS test. Hide verifiedbootstate from /proc/cmdline in order to fix the failed SafetyNet CTS check. Signed-off-by: Sultanxda --- fs/proc/cmdline.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/fs/proc/cmdline.c b/fs/proc/cmdline.c index 82676e3fcd1d0..d72ac6d0391fe 100644 --- a/fs/proc/cmdline.c +++ b/fs/proc/cmdline.c @@ -2,10 +2,13 @@ #include #include #include +#include + +static char new_command_line[COMMAND_LINE_SIZE]; static int cmdline_proc_show(struct seq_file *m, void *v) { - seq_printf(m, "%s\n", saved_command_line); + seq_printf(m, "%s\n", new_command_line); return 0; } @@ -23,6 +26,29 @@ static const struct file_operations cmdline_proc_fops = { static int __init proc_cmdline_init(void) { + char *offset_addr, *cmd = new_command_line; + + strcpy(cmd, saved_command_line); + + /* + * Remove 'androidboot.verifiedbootstate' flag from command line seen + * by userspace in order to pass SafetyNet CTS check. + */ + offset_addr = strstr(cmd, "androidboot.verifiedbootstate="); + if (offset_addr) { + size_t i, len, offset; + + len = strlen(cmd); + offset = offset_addr - cmd; + + for (i = 1; i < (len - offset); i++) { + if (cmd[offset + i] == ' ') + break; + } + + memmove(offset_addr, &cmd[offset + i + 1], len - i - offset); + } + proc_create("cmdline", 0, NULL, &cmdline_proc_fops); return 0; } From 494b5d07b08000ab32ff409b06b26db2163019c4 Mon Sep 17 00:00:00 2001 From: flar2 Date: Sat, 5 Dec 2015 21:12:48 -0500 Subject: [PATCH 66/75] msm_performance: Make input boosting optional --- drivers/soc/qcom/msm_performance.c | 35 +++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/msm_performance.c b/drivers/soc/qcom/msm_performance.c index 32a648df310be..145006bc91b17 100644 --- a/drivers/soc/qcom/msm_performance.c +++ b/drivers/soc/qcom/msm_performance.c @@ -25,6 +25,8 @@ #include #include +static int touchboost = 1; + static struct mutex managed_cpus_lock; /* Maximum number to clusters that this module will manage*/ @@ -139,6 +141,29 @@ static struct task_struct *notify_thread; /**************************sysfs start********************************/ +static int set_touchboost(const char *buf, const struct kernel_param *kp) +{ + int val; + + if (sscanf(buf, "%d\n", &val) != 1) + return -EINVAL; + + touchboost = val; + + return 0; +} + +static int get_touchboost(char *buf, const struct kernel_param *kp) +{ + return snprintf(buf, PAGE_SIZE, "%d", touchboost); +} + +static const struct kernel_param_ops param_ops_touchboost = { + .set = set_touchboost, + .get = get_touchboost, +}; +device_param_cb(touchboost, ¶m_ops_touchboost, NULL, 0644); + static int set_num_clusters(const char *buf, const struct kernel_param *kp) { unsigned int val; @@ -326,6 +351,10 @@ static int set_cpu_min_freq(const char *buf, const struct kernel_param *kp) struct cpufreq_policy policy; cpumask_var_t limit_mask; int ret; + const char *reset = "0:0 4:0"; + + if (touchboost == 0) + cp = reset; while ((cp = strpbrk(cp + 1, " :"))) ntokens++; @@ -334,7 +363,11 @@ static int set_cpu_min_freq(const char *buf, const struct kernel_param *kp) if (!(ntokens % 2)) return -EINVAL; - cp = buf; + if (touchboost == 0) + cp = reset; + else + cp = buf; + cpumask_clear(limit_mask); for (i = 0; i < ntokens; i += 2) { if (sscanf(cp, "%u:%u", &cpu, &val) != 2) From f2d3e0ec58a46e2849f688946f7ecd9c6b853c84 Mon Sep 17 00:00:00 2001 From: xdevs23 Date: Mon, 25 Jul 2016 18:35:43 +0200 Subject: [PATCH 67/75] vm: set swappiness to 4 by default Better performance, more RAM usage, but on our 4 GB device we don't need so much swappiness. Use a little value though just in case, as using swappiness in general is recommended. --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index f75a0974e36c5..f03681e373455 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -130,7 +130,7 @@ struct scan_control { /* * From 0 .. 100. Higher means more swappy. */ -int vm_swappiness = 60; +int vm_swappiness = 4; unsigned long vm_total_pages; /* The total number of pages which the VM controls */ #ifdef CONFIG_KSWAPD_CPU_AFFINITY_MASK From efd6925e12ab4e7d2cd530ae065f0ec7958e4374 Mon Sep 17 00:00:00 2001 From: xdevs23 Date: Mon, 25 Jul 2016 18:44:14 +0200 Subject: [PATCH 68/75] vm: reduce vfs cache pressure to 20 I am using this value myself. In my opinion very good, and can increase performance without side effects on the ONEPLUS 2. --- fs/dcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dcache.c b/fs/dcache.c index 38c4a302fab42..921f53539e239 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -78,7 +78,7 @@ * dentry1->d_lock * dentry2->d_lock */ -int sysctl_vfs_cache_pressure __read_mostly = 100; +int sysctl_vfs_cache_pressure __read_mostly = 20; EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); static __cacheline_aligned_in_smp DEFINE_SPINLOCK(dcache_lru_lock); From 62e59ad90942f3a1dccd04b32e57df84c6e522f8 Mon Sep 17 00:00:00 2001 From: xdevs23 Date: Mon, 25 Jul 2016 19:40:26 +0200 Subject: [PATCH 69/75] vm: set overcommit ratio to 48% --- mm/nommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/nommu.c b/mm/nommu.c index 08118e026afbc..b981699aa276b 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -60,7 +60,7 @@ unsigned long num_physpages; unsigned long highest_memmap_pfn; struct percpu_counter vm_committed_as; int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ -int sysctl_overcommit_ratio = 50; /* default is 50% */ +int sysctl_overcommit_ratio = 48; /* default is 50% */ int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT; int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS; unsigned long sysctl_user_reserve_kbytes __read_mostly = 1UL << 17; /* 128MB */ From 01eb46cfa8a9e88760912e8fdd012b9bcdb7b34f Mon Sep 17 00:00:00 2001 From: xdevs23 Date: Mon, 25 Jul 2016 19:44:07 +0200 Subject: [PATCH 70/75] vm: tweak dirty expire & writeback centisecs --- mm/page-writeback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index e0ec4b74f5ecd..bec664c72e7ee 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -98,14 +98,14 @@ unsigned long vm_dirty_bytes; /* * The interval between `kupdate'-style writebacks */ -unsigned int dirty_writeback_interval = 5 * 100; /* centiseconds */ +unsigned int dirty_writeback_interval = 520; /* centiseconds */ EXPORT_SYMBOL_GPL(dirty_writeback_interval); /* * The longest time for which data is allowed to remain dirty */ -unsigned int dirty_expire_interval = 30 * 100; /* centiseconds */ +unsigned int dirty_expire_interval = 220; /* centiseconds */ /* * Flag that makes the machine dump writes/reads and block dirtyings. From e9991d13c931c5d8978c5c532e49dca371074dec Mon Sep 17 00:00:00 2001 From: Alex Naidis Date: Fri, 1 Apr 2016 14:05:13 +0200 Subject: [PATCH 71/75] fs: fix for the entropy depletion issue * using an alternative function to prevent the depletion Change-Id: I41956223b2b184be67c239027a1a1a58848691bc Signed-off-by: Alex Naidis Signed-off-by: Simao Gomes Viana --- fs/binfmt_elf.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index b257de4e739b3..44fd4bc6091e0 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -140,6 +140,24 @@ static int padzero(unsigned long elf_bss) #define ELF_BASE_PLATFORM NULL #endif +/* + * Make use of get_random_int() to workaround an issue of entropy depletion + */ + static void get_random_bytes_no_deplete(unsigned char *buf, size_t nbytes) +{ + unsigned char *p = buf; + + while (nbytes) { + unsigned int random_variable; + size_t chunk = min(nbytes, sizeof(random_variable)); + + random_variable = get_random_int(); + memcpy(p, &random_variable, chunk); + p += chunk; + nbytes -= chunk; + } +} + static int create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, unsigned long load_addr, unsigned long interp_load_addr) @@ -201,7 +219,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, /* * Generate 16 random bytes for userspace PRNG seeding. */ - get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes)); + get_random_bytes_no_deplete(k_rand_bytes, sizeof(k_rand_bytes)); u_rand_bytes = (elf_addr_t __user *) STACK_ALLOC(p, sizeof(k_rand_bytes)); if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes))) From db82ce186d605ef875ff3b02c54d6b92b4804c23 Mon Sep 17 00:00:00 2001 From: Simao Gomes Viana Date: Tue, 13 Dec 2016 19:00:43 +0100 Subject: [PATCH 72/75] adreno_idler: optimize values Change-Id: If5deb9ee4c4c22bffa1c9357d36a8734f7093c81 --- drivers/devfreq/adreno_idler.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index b3aa89c88a87c..fe8d8b119d8e3 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -33,12 +33,13 @@ #define ADRENO_IDLER_MAJOR_VERSION 1 #define ADRENO_IDLER_MINOR_VERSION 1 +#define ADRENO_IDLER_REVISION 1 /* stats.busy_time threshold for determining if the given workload is idle. Any workload higher than this will be treated as a non-idle workload. Adreno idler will more actively try to ramp down the frequency if this is set to a higher value. */ -static unsigned long idleworkload = 5000; +static unsigned long idleworkload = 4000; module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); /* Number of events to wait before ramping down the frequency. @@ -47,7 +48,7 @@ module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); This implementation is to prevent micro-lags on scrolling or playing games. Adreno idler will more actively try to ramp down the frequency if this is set to a lower value. */ -static unsigned int idlewait = 15; +static unsigned int idlewait = 16; module_param_named(adreno_idler_idlewait, idlewait, uint, 0664); /* Taken from ondemand */ @@ -93,9 +94,10 @@ EXPORT_SYMBOL(adreno_idler); static int __init adreno_idler_init(void) { - pr_info("adreno_idler: version %d.%d by arter97\n", + pr_info("adreno_idler: version %d.%d rev %d by arter97, optimized values by halogenOS team\n", ADRENO_IDLER_MAJOR_VERSION, - ADRENO_IDLER_MINOR_VERSION); + ADRENO_IDLER_MINOR_VERSION, + ADRENO_IDLER_REVISION); return 0; } From 85b351bab8734d6746aa11fe31aa4da638c7e72a Mon Sep 17 00:00:00 2001 From: Simao Gomes Viana Date: Thu, 15 Dec 2016 19:40:31 +0100 Subject: [PATCH 73/75] adreno_idler: be smooth. be clever. be efficient. Change-Id: I95f181017b748c05a2227a083bd3f4eaec5a5950 --- drivers/devfreq/adreno_idler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index fe8d8b119d8e3..e494cbab37c31 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -39,7 +39,7 @@ Any workload higher than this will be treated as a non-idle workload. Adreno idler will more actively try to ramp down the frequency if this is set to a higher value. */ -static unsigned long idleworkload = 4000; +static unsigned long idleworkload = 1000; module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); /* Number of events to wait before ramping down the frequency. @@ -48,11 +48,11 @@ module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); This implementation is to prevent micro-lags on scrolling or playing games. Adreno idler will more actively try to ramp down the frequency if this is set to a lower value. */ -static unsigned int idlewait = 16; +static unsigned int idlewait = 50; module_param_named(adreno_idler_idlewait, idlewait, uint, 0664); /* Taken from ondemand */ -static unsigned int downdifferential = 20; +static unsigned int downdifferential = 42; module_param_named(adreno_idler_downdifferential, downdifferential, uint, 0664); /* Master switch to activate the whole routine */ From 0610320625fe5ab9726dbbe811770c8ff324bc92 Mon Sep 17 00:00:00 2001 From: Simao Gomes Viana Date: Mon, 26 Dec 2016 10:52:21 +0100 Subject: [PATCH 74/75] adreno_idler: change the settings a little bit Change-Id: Ic223d6f8a78ec83495ddafd495cb1a96c49d7dcc --- drivers/devfreq/adreno_idler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/adreno_idler.c b/drivers/devfreq/adreno_idler.c index e494cbab37c31..185e3ee76b374 100644 --- a/drivers/devfreq/adreno_idler.c +++ b/drivers/devfreq/adreno_idler.c @@ -33,7 +33,7 @@ #define ADRENO_IDLER_MAJOR_VERSION 1 #define ADRENO_IDLER_MINOR_VERSION 1 -#define ADRENO_IDLER_REVISION 1 +#define ADRENO_IDLER_REVISION 2 /* stats.busy_time threshold for determining if the given workload is idle. Any workload higher than this will be treated as a non-idle workload. @@ -48,11 +48,11 @@ module_param_named(adreno_idler_idleworkload, idleworkload, ulong, 0664); This implementation is to prevent micro-lags on scrolling or playing games. Adreno idler will more actively try to ramp down the frequency if this is set to a lower value. */ -static unsigned int idlewait = 50; +static unsigned int idlewait = 52; module_param_named(adreno_idler_idlewait, idlewait, uint, 0664); /* Taken from ondemand */ -static unsigned int downdifferential = 42; +static unsigned int downdifferential = 40; module_param_named(adreno_idler_downdifferential, downdifferential, uint, 0664); /* Master switch to activate the whole routine */ From 7dd94146cec388bf27b7b48c903587be79b91bfc Mon Sep 17 00:00:00 2001 From: Kristof Petho Date: Sun, 15 May 2016 09:35:44 +0200 Subject: [PATCH 75/75] Power optimization Thanks to: Signed-off-by: Sumit Singh Reviewed-on: http://git-master/r/426483 Reviewed-by: Sri Krishna Chowdary GVS: Gerrit_Virtual_Submit Reviewed-by: Alexander Van Brunt Signed-off-by: franciscofranco Change-Id: I37e9cf3fb65556ebcf0a5c57f36ad9bae4950452 Signed-off-by: Simao Gomes Viana --- arch/arm/include/asm/atomic.h | 1 + arch/arm/include/asm/relaxed.h | 20 +++++++++ arch/arm64/include/asm/atomic.h | 66 ++++++++++++++++++++++++++++++ arch/arm64/include/asm/processor.h | 6 +++ arch/arm64/include/asm/relaxed.h | 33 +++++++++++++++ include/asm-generic/atomic.h | 5 +++ include/asm-generic/processor.h | 24 +++++++++++ include/asm-generic/relaxed.h | 30 ++++++++++++++ include/linux/hrtimer.h | 7 ++++ include/linux/llist.h | 6 +++ include/linux/thread_info.h | 13 ++++++ kernel/cpu.c | 2 +- 12 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 arch/arm/include/asm/relaxed.h create mode 100644 arch/arm64/include/asm/relaxed.h create mode 100644 include/asm-generic/processor.h create mode 100644 include/asm-generic/relaxed.h diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h index c8b3d825d81b2..1d0a81c37a719 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h @@ -28,6 +28,7 @@ */ #define atomic_read(v) (*(volatile int *)&(v)->counter) #define atomic_set(v,i) (((v)->counter) = (i)) +#define cpu_relaxed_read_atomic(v) atomic_read(v) #if __LINUX_ARM_ARCH__ >= 6 diff --git a/arch/arm/include/asm/relaxed.h b/arch/arm/include/asm/relaxed.h new file mode 100644 index 0000000000000..378e48d99fee0 --- /dev/null +++ b/arch/arm/include/asm/relaxed.h @@ -0,0 +1,20 @@ +/* + * arm/include/asm/relaxed.h + * + * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _ASM_RELAXED_H_ +#define _ASM_RELAXED_H_ + +#include + +#endif /*_ASM_RELAXED_H_*/ diff --git a/arch/arm64/include/asm/atomic.h b/arch/arm64/include/asm/atomic.h index 65f1569ac96e5..15232e638a3fd 100644 --- a/arch/arm64/include/asm/atomic.h +++ b/arch/arm64/include/asm/atomic.h @@ -4,6 +4,7 @@ * Copyright (C) 1996 Russell King. * Copyright (C) 2002 Deep Blue Solutions Ltd. * Copyright (C) 2012 ARM Ltd. + * Copyright (C) 2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -37,6 +38,71 @@ */ #define atomic_read(v) (*(volatile int *)&(v)->counter) #define atomic_set(v,i) (((v)->counter) = (i)) +#define cpu_relaxed_read_atomic(v) ldax32((volatile int *)&(v->counter)) + +/* + * Macros for generating inline functions to use special load and store + * instructions (exlusive and aquire/release). + */ + +#define _LD(_name, _type, _inst, _reg) \ +static inline _type _name (volatile _type *p) \ +{ \ + _type ret; \ + asm volatile( \ + _inst " %" _reg "0, %1": "=&r" (ret) : "Q" (*p) : "memory"); \ + return ret; \ +} + +#define _STX(_name, _type, _inst, _reg) \ +static inline int _name (volatile _type *p, _type v) \ +{ \ + int ret; \ + asm volatile( \ + _inst " %" _reg "0, %" _reg "1, %2" \ + : "=&r" (ret) \ + : "r" (v), "Q" (*p) \ + : "memory"); \ + return ret; \ +} + +#define _STL(_name, _type, _inst, _reg) \ +static inline void _name (volatile _type *p, _type v) \ +{ \ + asm volatile( \ + _inst " %" _reg "0, %1" \ + : \ + : "r" (v), "Q" (*p) \ + : "memory"); \ +} + +_LD( ldx64, u64, "ldxr", "x") +_STX( stx64, u64, "stxr", "x") +_LD( ldax64, u64, "ldaxr", "x") +_STX(stlx64, u64, "stlxr", "x") +_LD( lda64, u64, "ldar", "x") +_STL( stl64, u64, "stlr", "x") + +_LD( ldx32, u32, "ldxr", "w") +_STX( stx32, u32, "stxr", "w") +_LD( ldax32, u32, "ldaxr", "w") +_STX(stlx32, u32, "stlxr", "w") +_LD( lda32, u32, "ldar", "w") +_STL( stl32, u32, "stlr", "w") + +_LD( ldx16, u16, "ldxrh", "w") +_STX( stx16, u16, "stxrh", "w") +_LD( ldax16, u16, "ldaxrh", "w") +_STX(stlx16, u16, "stlxrh", "w") +_LD( lda16, u16, "ldarh", "w") +_STL( stl16, u16, "stlrh", "w") + +_LD( ldx8, u8, "ldxrb", "w") +_STX( stx8, u8, "stxrb", "w") +_LD( ldax8, u8, "ldaxrb", "w") +_STX( stlx8, u8, "stlxrb", "w") +_LD( lda8, u8, "ldarb", "w") +_STL( stl8, u8, "stlrb", "w") /* * AArch64 UP and SMP safe atomic ops. We use load exclusive and diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 809f869188278..9916957c0ae87 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -3,6 +3,7 @@ * * Copyright (C) 1995-1999 Russell King * Copyright (C) 2012 ARM Ltd. + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -33,6 +34,7 @@ #include #include #include +#include #ifdef __KERNEL__ #define STACK_TOP_MAX TASK_SIZE_64 @@ -133,6 +135,8 @@ unsigned long get_wchan(struct task_struct *p); #define cpu_relax() barrier() +#define cpu_read_relax() wfe() + /* Thread switching */ extern struct task_struct *cpu_switch_to(struct task_struct *prev, struct task_struct *next); @@ -180,4 +184,6 @@ static inline void spin_lock_prefetch(const void *x) #endif +#include + #endif /* __ASM_PROCESSOR_H */ diff --git a/arch/arm64/include/asm/relaxed.h b/arch/arm64/include/asm/relaxed.h new file mode 100644 index 0000000000000..08a217934c414 --- /dev/null +++ b/arch/arm64/include/asm/relaxed.h @@ -0,0 +1,33 @@ +/* + * arm64/include/asm/relaxed.h + * + * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _ASM_RELAXED_H_ +#define _ASM_RELAXED_H_ + +#include + +#ifndef cpu_relaxed_read_short +#define cpu_relaxed_read_short(p) ldax16(p) +#endif + +#ifndef cpu_relaxed_read +#define cpu_relaxed_read(p) ldax32(p) +#endif + +#ifndef cpu_relaxed_read_long +#define cpu_relaxed_read_long(p) ldax64((u64 *)p) +#endif + +#include +#endif /*_ASM_RELAXED_H_*/ diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 9c79e7603459e..64416aceebd06 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h @@ -6,6 +6,7 @@ * * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licence @@ -45,6 +46,10 @@ #define atomic_read(v) (*(volatile int *)&(v)->counter) #endif +#ifndef cpu_relaxed_read_atomic +#define cpu_relaxed_read_atomic(v) atomic_read(v) +#endif + /** * atomic_set - set atomic variable * @v: pointer of type atomic_t diff --git a/include/asm-generic/processor.h b/include/asm-generic/processor.h new file mode 100644 index 0000000000000..0b57d920cdd3b --- /dev/null +++ b/include/asm-generic/processor.h @@ -0,0 +1,24 @@ +/* + * include/asm-generic/processor.h + * + * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _ASM_GENERIC_PROCESSOR_H_ +#define _ASM_GENERIC_PROCESSOR_H_ + +#include + +#ifndef cpu_read_relax +#define cpu_read_relax() cpu_relax() +#endif + +#endif /*_ASM_GENERIC_PROCESSOR_H_*/ diff --git a/include/asm-generic/relaxed.h b/include/asm-generic/relaxed.h new file mode 100644 index 0000000000000..37dc310a4b41c --- /dev/null +++ b/include/asm-generic/relaxed.h @@ -0,0 +1,30 @@ +/* + * include/asm-generic/relaxed.h + * + * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _ASM_GENERIC_RELAXED_H_ +#define _ASM_GENERIC_RELAXED_H_ + +#ifndef cpu_relaxed_read_short +#define cpu_relaxed_read_short(p) (*(p)) +#endif + +#ifndef cpu_relaxed_read +#define cpu_relaxed_read(p) (*(p)) +#endif + +#ifndef cpu_relaxed_read_long +#define cpu_relaxed_read_long(p) (*(p)) +#endif + +#endif /*_ASM_GENERIC_RELAXED_H_*/ diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 0302bbe3dabaf..7e7fb3bc508b3 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -5,6 +5,7 @@ * * Copyright(C) 2005, Thomas Gleixner * Copyright(C) 2005, Red Hat, Inc., Ingo Molnar + * Copyright (C) 2014, NVIDIA CORPORATION. All rights reserved. * * data type definitions, declarations, prototypes * @@ -23,6 +24,7 @@ #include #include #include +#include struct hrtimer_clock_base; struct hrtimer_cpu_base; @@ -420,6 +422,11 @@ static inline int hrtimer_callback_running(struct hrtimer *timer) return timer->state & HRTIMER_STATE_CALLBACK; } +static inline int hrtimer_callback_running_relaxed(struct hrtimer *timer) +{ + return cpu_relaxed_read_long(&timer->state) & HRTIMER_STATE_CALLBACK; +} + /* Forward a hrtimer so it expires after now: */ extern u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); diff --git a/include/linux/llist.h b/include/linux/llist.h index a5199f6d0e825..30019d8fa4e2f 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h @@ -57,6 +57,7 @@ #include #include +#include struct llist_head { struct llist_node *first; @@ -137,6 +138,11 @@ static inline bool llist_empty(const struct llist_head *head) return ACCESS_ONCE(head->first) == NULL; } +static inline bool llist_empty_relaxed(const struct llist_head *head) +{ + return (void *)cpu_relaxed_read_long(&head->first) == NULL; +} + static inline struct llist_node *llist_next(struct llist_node *node) { return node->next; diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 4ae6f32c8033d..c7e3e8ff7f30d 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -2,6 +2,8 @@ * * Copyright (C) 2002 David Howells (dhowells@redhat.com) * - Incorporating suggestions made by Linus Torvalds + * + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. */ #ifndef _LINUX_THREAD_INFO_H @@ -9,6 +11,7 @@ #include #include +#include struct timespec; struct compat_timespec; @@ -88,6 +91,12 @@ static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag return test_and_clear_bit(flag, (unsigned long *)&ti->flags); } +static inline int test_ti_thread_flag_relaxed(struct thread_info *ti, int flag) +{ + ti->flags = cpu_relaxed_read_long(&ti->flags); + return test_bit(flag, (unsigned long *)&ti->flags); +} + static inline int test_ti_thread_flag(struct thread_info *ti, int flag) { return test_bit(flag, (unsigned long *)&ti->flags); @@ -103,12 +112,16 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) test_and_clear_ti_thread_flag(current_thread_info(), flag) #define test_thread_flag(flag) \ test_ti_thread_flag(current_thread_info(), flag) +#define test_thread_flag_relaxed(flag) \ + test_ti_thread_flag_relaxed(current_thread_info(), flag) #define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) #define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) +#define tif_need_resched_relaxed() test_thread_flag_relaxed(TIF_NEED_RESCHED) + #if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK /* * An arch can define its own version of set_restore_sigmask() to get the diff --git a/kernel/cpu.c b/kernel/cpu.c index 7eb31dac55e90..0b74bf3031bdc 100755 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -351,7 +351,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) * Wait for the stop thread to go away. */ while (!idle_cpu(cpu)) - cpu_relax(); + cpu_read_relax(); /* This actually kills the CPU. */ __cpu_die(cpu);