[Samsung Galaxy Nexus] aosp:
Could you implement cpufreq boost and powerhal fixes from our brother the blaze tablet on omapzoom the tuna could use a boost during boot especially on art and some more juice ;)

[MENTION=4608636]bsmitty83[/MENTION] [MENTION=4328678]metalspring[/MENTION] [MENTION=2999829]PlayfulGod[/MENTION] [MENTION=4112553]dhacker29[/MENTION] [MENTION=4443334]Grarak[/MENTION]

#Boot boost

pm: cpufreq: boost cpu frequency API support

This patch introduces boost sysfs interface which would enable the

govenor to ack any request for running the system at max freq just before

the system is going to be loaded. The next sample time would be decided

based on the user configured timeout value or the default (0) usec.

To set boost timeout:

echo > /sys/devices/system/cpu/cpufreq/interactive/boost_timeout

To enable boost:

echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/boost_cpufreq

http://goo.gl/n78dwP

cpufreq: interactive governor: Delete boost timer on CPUFREQ_GOV_STOP.

Concurrent execution of CPUFREQ_GOV_STOP and interactive_boost_timer()

should be avoided.

Also, interactive_boost() should follow CPUFREQ_GOV_STOP on

flush_work().

http://goo.gl/FkEoXA

cpufreq: interactive governor: Delete boost timer on CPUFREQ_GOV_STOP.

Concurrent execution of CPUFREQ_GOV_STOP and interactive_boost_timer()

should be avoided.

Also, interactive_boost() should follow CPUFREQ_GOV_STOP on

flush_work().

http://goo.gl/mSBt1o

cpufreq: interactiver governor: Add a time view concept

CPUFreq governors are always a tradeoff between power vs performance.

For low power UCs we want to have a less reponsive cpufreq governor that

does not respond or react to each load pick.

However when scrolling on the screen or during webbrowsing we need a more

responsive governor that interact or esponse to each load variation.

To detect which kind of application we have, we'll rely on the history of

the load. if the the average over the load history is high that means we

need to be more responsive so we change the governor paramters in that

direction.

if the average over the load history is low thatmeans we are in low power

UCs so we change the governor parameter to be less responsive

http://goo.gl/27AOQD

OMAP4: DPLL cascading: Tune cpufreq interactive governor

During DPLL cascading timer_rate of interactive timer should be

increased, otherwise interactive governor will try to put system

out of DPLL cascading very frequently

http://goo.gl/f3Yyqw

cpufreq: interactive governor: Fix not uniform buf filling & memory corruption

Each CPU has it's own load history buffer, but all they use shared

variable, this lead to not uniform filling

of the cpu's circular buffers. Only about half of buffer is updated

during each buffer rewriting cycle that obligate governor to use

outdated data during freq tuning.

Moreover access to variable is not atomic, that

create race conditions. Simultaneous increment could cause situation

where such check:

if (++history_load_index == sampling_periods)

history_load_index = 0;

not safe and buffer overflow will not be prevented. That will lead

to memory corruption.

To avoid such problems this patch move buffer-index variable to

structure, which is separate for each CPU.

Also, buffer overflow checking will be paranoidly changed.

http://goo.gl/7hnndj

blaze_tablet: Enabling cpu boost during boot

Added cpu boost for boot time improvement.

http://goo.gl/BCTZ3Z

# Boost the CPU for 30 secs during boot

write /sys/devices/system/cpu/cpufreq/interactive/boost_timeout 30000000

write /sys/devices/system/cpu/cpu0/cpufreq/boost_cpufreq 1

PowerHAL: Rename functions and variables to blaze_tablet

Blaze Tablet PowerHAL is copied from Tuna's PowerHAL

with the Tuna's functions and variables names.

The patch basically does s/tuna/blaze_tablet/

Also it replaces a few tab indentations by spaces.

http://goo.gl/OfZop8

#Powerhal

PowerHAL: Change obsolete designated initializers syntax

Designated initializers syntax which is used to initialize

HAL_MODULE_INFO_SYM is obsolete since GCC 2.5:

http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

This patch changes syntax to usual one.

http://goo.gl/sh34zF

PowerHAL: Define constants for CPUfreq paths

Same CPUfreq paths are used many times in the code.

This patch defines constants for them.

http://goo.gl/NSI3yY

PowerHAL: Check that PowerHAL is successfully initialized

It doesn't make any sense to do something if PowerHAL

couldn't setup initial parameters successfully.

http://goo.gl/8NV72Z

PowerHAL: Read available scaling frequencies from sysfs

Blaze Tablet board can have any type of OMAP44xx mounted.

Each OMAP has its own set of scaling frequencies,

so this patch read available frequencies from sysfs on init

and store them into freq_list[] for future use.

http://goo.gl/ZFP5qv

PowerHAL: Use correct scaling frequencies

Currently PowerHAL uses hardcoded frequencies for OMAP4460 1.2GHz.

It doesn't work well, because Blaze Tablet can have any type

of OMAP44xx mounted.

This patch uses correct scaling frequencies stored in freq_list[].

http://goo.gl/Gwe5XB