cpufreq: Introduce new relation for freq selection

Introduce CPUFREQ_RELATION_C for frequency selection.
It selects the frequency with the minimum euclidean distance
to target. In case of equal distance between 2 frequencies,
it will select the greater freq.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Blechd0se <alex.christ@hotmail.de>
input: touchboost: merge touchboost work in

Directly based upon the work here; https://github.com/Blechd0se/kernel-moto-g/commit/777ac1216bad4820a1c1f7ac78dc27aac37a37a6
This might also fix a very rare kernel panic.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
cpufreq: interactive: merge interactive work in

This is based upon this work over here; https://github.com/Blechd0se/kernel-moto-g/commit/188a3251106d13a34335654bb7f2ce3da27bf8b0
It contains all previous features minus the thread
migration code.
In return the new calculation method should turn out
to be very effective.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
defconfig: update a few things

 * Enable powersave governor back again
 * set deadline as default io scheduler

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
cpufreq: interactive: fix potential wrong calculations

When overclocked the previous decisions might not be accurate
enough. With this change, this should be fixed (for underclocking
as well).

Strictly adapted from over here;
https://github.com/franciscofranco/flo/commit/22f731b21d63109a64247b63870f1bcc1ed4f43e

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
kernel/: convert cpu notifier to return encapsulate errno value

By the previous modification, the cpu notifier can return encapsulate
errno value.  This converts the cpu notifiers for kernel/*.c

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Blechd0se <alex.christ@hotmail.de>

Conflicts:
	kernel/padata.c
lockdep: Add an in_workqueue_context() lockdep-based test function

Some recent uses of RCU make use of workqueues.  In these uses, execution
within the context of a specific workqueue takes the place of the usual
RCU read-side primitives such as rcu_read_lock(), and flushing of workqueues
takes the place of the usual RCU grace-period primitives.  Checking for
correct use of rcu_dereference() in such cases requires a test of whether
the code is executing in the context of a particular workqueue.  This
commit adds an in_workqueue_context() function that provides this test.
This new function is only defined when lockdep is enabled, which allows
it to be used as the second argument of rcu_dereference_check().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Blechd0se <alex.christ@hotmail.de>

Conflicts:
	kernel/workqueue.c
Merge remote-tracking branch 'mb52x/AeroKernel' into AeroKernel