Tegra:cpufreq: restart timer if limits have changed.

The interactive governor stops polling for load at 2 boundary conditions:

1. Frequency is at minimum and CPU is going into idle
2. Target frequency is maximum

These cases interact badly when the min and max limits change during the
time the timer has stopped polling.

Particularly when going from a restrictive to a more liberal limit,
frequency cannot be adjusted in reaction to the change until the CPU
becomes idle/comes out of idle again.

Change-Id: Iecb2703c824cefbf88004cce96a0877625e143d1
Signed-off-by: satya popuri <spopuri@nvidia.com>
Reviewed-on: http://git-master/r/146056
Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>
Tested-by: Anshul Jain (SW) <anshulj@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
[CPUFREQ]conservative: fix overflow of freq

freq_target may be bigger than requested_freq but they are unsigned,
add judgement condition to fix it.

Bug 1172636

Change-Id: Ib15bbac93c34c9a0428dcfd0be5dff24493124bb
Signed-off-by: Hunk Lin <hulin@nvidia.com>
Reviewed-on: http://git-master/r/162999
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Aly Hirani <ahirani@nvidia.com>
Tested-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-by: Satya Popuri <spopuri@nvidia.com>
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
cpufreq:interactive:idle time excludes iowait.

The CPU idle time reported by scheduler stats does not include time
spent waiting on I/O anymore. This has flipped the semantics of the
io_is_busy flag in current code and causes any usecases that do file I/O
to run at higher than normal frequencies. E.g, video playback.

Bug 1205531

Change-Id: Iee0f14597272ea59a879d4bfce3ea93cf90fe57a
Signed-off-by: Satya Popuri <spopuri@nvidia.com>
Reviewed-on: http://git-master/r/172931
(cherry picked from commit a7a099eeccc8b6cf0f8f7e53a877e0e6b1a020e3)
Reviewed-on: http://git-master/r/173723
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
cpufreq: interactive: Fix race when canceling timer at min freq

When target_freq reaches policy->min the governor calls del_timer()
upon entry to idle. However, it is possible for the timer handler to
still be running at this time, in which case it could rearm itself
such that the timer stays pending.

If we exit from idle before the next timer fires, the timer handler
will find idle_exit_time == 0 and will exit without rearming, from
this point on frequency will be stuck at the current level until we
enter idle again. This sometimes causes frequency to get stuck at
minimum, with cpu load at 100%, causing serious performance problems.

This patch replaces the del_timer() with del_timer_sync().

Bug: 1173466

(Issue no longer exists in upstream interactive governor)

Change-Id: Ic61194f2afb4ac041e18c7556e6ed4aee9c90303
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/213638
Reviewed-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-by: Yong Goo Yi <yyi@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
cpufreq: Add GCOV_PROFILE

Include cpufreq in GCOV profiling when enabled by defconfig.

Change-Id: Iab3d2b7d2868acd51c66d975fc255552e2af1724
Signed-off-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-on: http://git-master/r/131125
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
gpio_keys: cleanup and fix errors

Change-Id: I10330816170aef96d87ac7ca5402c00efef6a369
ARM: tegra: comms: xmm wake enable at suspend

enable_irq_wake call moved from probe function to suspend.
Resume function has disable_irq_wake call

Bug 992448

Change-Id: I0390822f66d91e23514fc2f0439a927e4c7712e9
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/304347
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
cpwatcher: cleanup driver and add a retry function to the main work_func

Change-Id: Ib1a03f7a017373e7281d2f3d552cb6fbf73ae05d
On branch alfs-cm11.0
	modified:   arch/arm/Makefile
Untracked files:
	alf-export.bash
arm: tegra: x3: add 12.75mhz memory freq

Add operation parameters for running emc at 12.75 MHz into
emc dvfs table.

Change-Id: I61f8d3cda19cd9b56e93091668359951bdb4375d
[ARM] tegra: initialize clock-event notifiers

Notifiers need to be explicitly initialized.  They contain semaphores with
list_head entries tracking waiters.  If the list_head entries are not
initialized properly, bad things will happenr.

Change-Id: Ib97613b28220f4e0522f276cd2f5d2a97e85e9d8
Signed-off-by: Iliyan Malchev <malchev@google.com>