Skip to content

Commit

Permalink
Merge branch 'android-3.4' into android-mediatek-sprout-3.4
Browse files Browse the repository at this point in the history
Conflicts:
	android/configs/android-base.cfg
	include/linux/ipv6.h

Signed-off-by: Todd Poynor <[email protected]>
Change-Id: Icc6a273aec9de8dd8ba09f9350387f19611e4278
  • Loading branch information
toddpoynor committed Jul 16, 2014
2 parents 2885fda + 0836a0c commit f027a4a
Show file tree
Hide file tree
Showing 34 changed files with 1,303 additions and 234 deletions.
13 changes: 12 additions & 1 deletion android/configs/android-base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_INTF_ALARM_DEV=y
CONFIG_ANDROID_LOGGER=y
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
CONFIG_ASHMEM=y
CONFIG_AUDIT=y
CONFIG_BLK_DEV_DM=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_CGROUPS=y
Expand All @@ -15,6 +15,7 @@ CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_SCHED=y
CONFIG_DM_CRYPT=y
CONFIG_DM_VERITY=y
CONFIG_EMBEDDED=y
CONFIG_EXPERIMENTAL=y
CONFIG_FB=y
Expand All @@ -35,6 +36,7 @@ CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_IPV6_PRIVACY=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_NF_ARPFILTER=y
Expand All @@ -47,6 +49,7 @@ CONFIG_IP_NF_MATCH_AH=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_RAW=y
CONFIG_IP_NF_SECURITY=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
Expand Down Expand Up @@ -81,9 +84,13 @@ CONFIG_NETFILTER_XT_MATCH_TIME=y
CONFIG_NETFILTER_XT_MATCH_U32=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_MARK=y
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
CONFIG_NETFILTER_XT_TARGET_SECMARK=y
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
CONFIG_NETFILTER_XT_TARGET_TPROXY=y
CONFIG_NETFILTER_XT_TARGET_TRACE=y
CONFIG_NET_CLS_ACT=y
Expand All @@ -104,6 +111,7 @@ CONFIG_NF_CONNTRACK_IRC=y
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
CONFIG_NF_CONNTRACK_PPTP=y
CONFIG_NF_CONNTRACK_SANE=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_CT_NETLINK=y
CONFIG_NF_CT_PROTO_DCCP=y
Expand All @@ -124,6 +132,9 @@ CONFIG_PREEMPT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_RTC_CLASS=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_SELINUX=y
CONFIG_STAGING=y
CONFIG_SWITCH=y
CONFIG_SYNC=y
Expand Down
2 changes: 2 additions & 0 deletions android/configs/android-recommended.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_FUSE_FS=y
CONFIG_GREENASIA_FF=y
CONFIG_HIDRAW=y
CONFIG_HID_A4TECH=y
CONFIG_HID_ACRUX=y
CONFIG_HID_ACRUX_FF=y
Expand Down Expand Up @@ -98,6 +99,7 @@ CONFIG_SCHEDSTATS=y
CONFIG_SCHED_TRACER=y
CONFIG_SMARTJOYPLUS_FF=y
CONFIG_SND=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SOUND=y
CONFIG_SUSPEND_TIME=y
CONFIG_TABLET_USB_ACECAD=y
Expand Down
54 changes: 38 additions & 16 deletions drivers/cpufreq/cpufreq_interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ struct cpufreq_interactive_cpuinfo {
u64 cputime_speedadj_timestamp;
struct cpufreq_policy *policy;
struct cpufreq_frequency_table *freq_table;
spinlock_t target_freq_lock; /*protects target freq */
unsigned int target_freq;
unsigned int floor_freq;
unsigned int max_freq;
u64 floor_validate_time;
u64 hispeed_validate_time;
struct rw_semaphore enable_sem;
Expand Down Expand Up @@ -391,6 +393,7 @@ static void cpufreq_interactive_timer(unsigned long data)
if (WARN_ON_ONCE(!delta_time))
goto rearm;

spin_lock_irqsave(&pcpu->target_freq_lock, flags);
do_div(cputime_speedadj, delta_time);
loadadjfreq = (unsigned int)cputime_speedadj * 100;
cpu_load = loadadjfreq / pcpu->target_freq;
Expand All @@ -416,15 +419,18 @@ static void cpufreq_interactive_timer(unsigned long data)
trace_cpufreq_interactive_notyet(
data, cpu_load, pcpu->target_freq,
pcpu->policy->cur, new_freq);
spin_unlock_irqrestore(&pcpu->target_freq_lock, flags);
goto rearm;
}

pcpu->hispeed_validate_time = now;

if (cpufreq_frequency_table_target(pcpu->policy, pcpu->freq_table,
new_freq, CPUFREQ_RELATION_L,
&index))
&index)) {
spin_unlock_irqrestore(&pcpu->target_freq_lock, flags);
goto rearm;
}

new_freq = pcpu->freq_table[index].frequency;

Expand All @@ -437,6 +443,7 @@ static void cpufreq_interactive_timer(unsigned long data)
trace_cpufreq_interactive_notyet(
data, cpu_load, pcpu->target_freq,
pcpu->policy->cur, new_freq);
spin_unlock_irqrestore(&pcpu->target_freq_lock, flags);
goto rearm;
}
}
Expand All @@ -458,13 +465,15 @@ static void cpufreq_interactive_timer(unsigned long data)
trace_cpufreq_interactive_already(
data, cpu_load, pcpu->target_freq,
pcpu->policy->cur, new_freq);
spin_unlock_irqrestore(&pcpu->target_freq_lock, flags);
goto rearm_if_notmax;
}

trace_cpufreq_interactive_target(data, cpu_load, pcpu->target_freq,
pcpu->policy->cur, new_freq);

pcpu->target_freq = new_freq;
spin_unlock_irqrestore(&pcpu->target_freq_lock, flags);
spin_lock_irqsave(&speedchange_cpumask_lock, flags);
cpumask_set_cpu(data, &speedchange_cpumask);
spin_unlock_irqrestore(&speedchange_cpumask_lock, flags);
Expand Down Expand Up @@ -608,14 +617,14 @@ static void cpufreq_interactive_boost(void)
{
int i;
int anyboost = 0;
unsigned long flags;
unsigned long flags[2];
struct cpufreq_interactive_cpuinfo *pcpu;

spin_lock_irqsave(&speedchange_cpumask_lock, flags);
spin_lock_irqsave(&speedchange_cpumask_lock, flags[0]);

for_each_online_cpu(i) {
pcpu = &per_cpu(cpuinfo, i);

spin_lock_irqsave(&pcpu->target_freq_lock, flags[1]);
if (pcpu->target_freq < hispeed_freq) {
pcpu->target_freq = hispeed_freq;
cpumask_set_cpu(i, &speedchange_cpumask);
Expand All @@ -631,9 +640,10 @@ static void cpufreq_interactive_boost(void)

pcpu->floor_freq = hispeed_freq;
pcpu->floor_validate_time = ktime_to_us(ktime_get());
spin_unlock_irqrestore(&pcpu->target_freq_lock, flags[1]);
}

spin_unlock_irqrestore(&speedchange_cpumask_lock, flags);
spin_unlock_irqrestore(&speedchange_cpumask_lock, flags[0]);

if (anyboost)
wake_up_process(speedchange_task);
Expand Down Expand Up @@ -741,7 +751,7 @@ static ssize_t show_target_loads(
ret += sprintf(buf + ret, "%u%s", target_loads[i],
i & 0x1 ? ":" : " ");

ret += sprintf(buf + --ret, "\n");
sprintf(buf + ret - 1, "\n");
spin_unlock_irqrestore(&target_loads_lock, flags);
return ret;
}
Expand Down Expand Up @@ -784,7 +794,7 @@ static ssize_t show_above_hispeed_delay(
ret += sprintf(buf + ret, "%u%s", above_hispeed_delay[i],
i & 0x1 ? ":" : " ");

ret += sprintf(buf + --ret, "\n");
sprintf(buf + ret - 1, "\n");
spin_unlock_irqrestore(&above_hispeed_delay_lock, flags);
return ret;
}
Expand Down Expand Up @@ -950,6 +960,7 @@ static ssize_t store_boost(struct kobject *kobj, struct attribute *attr,
trace_cpufreq_interactive_boost("on");
cpufreq_interactive_boost();
} else {
boostpulse_endtime = ktime_to_us(ktime_get());
trace_cpufreq_interactive_unboost("off");
}

Expand Down Expand Up @@ -1069,6 +1080,7 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
unsigned int j;
struct cpufreq_interactive_cpuinfo *pcpu;
struct cpufreq_frequency_table *freq_table;
unsigned long flags;

switch (event) {
case CPUFREQ_GOV_START:
Expand All @@ -1092,6 +1104,7 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
ktime_to_us(ktime_get());
pcpu->hispeed_validate_time =
pcpu->floor_validate_time;
pcpu->max_freq = policy->max;
down_write(&pcpu->enable_sem);
cpufreq_interactive_timer_start(j);
pcpu->governor_enabled = 1;
Expand Down Expand Up @@ -1155,29 +1168,37 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
for_each_cpu(j, policy->cpus) {
pcpu = &per_cpu(cpuinfo, j);

/* hold write semaphore to avoid race */
down_write(&pcpu->enable_sem);
down_read(&pcpu->enable_sem);
if (pcpu->governor_enabled == 0) {
up_write(&pcpu->enable_sem);
up_read(&pcpu->enable_sem);
continue;
}

/* update target_freq firstly */
spin_lock_irqsave(&pcpu->target_freq_lock, flags);
if (policy->max < pcpu->target_freq)
pcpu->target_freq = policy->max;
else if (policy->min > pcpu->target_freq)
pcpu->target_freq = policy->min;

/* Reschedule timer.
spin_unlock_irqrestore(&pcpu->target_freq_lock, flags);
up_read(&pcpu->enable_sem);

/* Reschedule timer only if policy->max is raised.
* Delete the timers, else the timer callback may
* return without re-arm the timer when failed
* acquire the semaphore. This race may cause timer
* stopped unexpectedly.
*/
del_timer_sync(&pcpu->cpu_timer);
del_timer_sync(&pcpu->cpu_slack_timer);
cpufreq_interactive_timer_start(j);
up_write(&pcpu->enable_sem);

if (policy->max > pcpu->max_freq) {
down_write(&pcpu->enable_sem);
del_timer_sync(&pcpu->cpu_timer);
del_timer_sync(&pcpu->cpu_slack_timer);
cpufreq_interactive_timer_start(j);
up_write(&pcpu->enable_sem);
}

pcpu->max_freq = policy->max;
}
break;
}
Expand All @@ -1203,6 +1224,7 @@ static int __init cpufreq_interactive_init(void)
init_timer(&pcpu->cpu_slack_timer);
pcpu->cpu_slack_timer.function = cpufreq_interactive_nop_timer;
spin_lock_init(&pcpu->load_lock);
spin_lock_init(&pcpu->target_freq_lock);
init_rwsem(&pcpu->enable_sem);
}

Expand Down
Loading

0 comments on commit f027a4a

Please sign in to comment.