CPUFREQ: Clean Ondemand get tit close to LG stock, revert tuning in others.

*Clean the SMART UP its was not allowing max freq and was laggy.
*Revert DEF_SAMPLING_DOWN_FACTOR = 4 as it's make max freq always on core 0.

Conflicts:
	drivers/cpufreq/cpu-boost.c
	drivers/cpufreq/cpufreq_ondemand.c
Disable ARCH_POWER and SLEEPERS

*Power save on suspend was better with ARCH_POWER OFF.
Set all versions of sync_freq to middle range freq to gain high perf.

and not allow to set less than 960000Mhz
as at this point gov start to LAG hard!

LG default hotplug also set sync_freq types to 960000 by default,
and if user select default hotplug he loose performance allot.

Conflicts:
	drivers/cpufreq/cpufreq_ondemand.c
cpufreq_alucard: Added init_boostfreq pcpu parameter.
Disable gentle_fair_sleepers & arch_power in  kernel/sched/fair.c
Disable WIFI Driver Debug. works good no need to debug.

Thanks neobuddy89

Conflicts:
	drivers/net/wireless/bcmdhd/Makefile
drivers: dma: warn if ioremap fails

dma-removed alloc hook tries to ioremap a carve-out in order
to memset it to 0s. Warn the user if it fails due to low
vmalloc space.

Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
arm: dma-removed: Add option to skip buffer zeroing

The DMA framework currently zeros all buffers because it (righfully so)
assumes that drivers will soon need to pass the memory to a device.
Some devices/use case may not require zeroed memory and there can
be an increase in performance if we skip the zeroing. Use the
DMA_ATTR_SKIP_ZEROING attr to allow skipping of DMA zeroing.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
drivers: dma: map pages only if required

DMA clients such as PIL would often allocate large
contiguous physical memory through dma-removed interface
for carve-outs. It may not be possible to map these large
allocations due to insufficient vmalloc space.

Hence provide provision to map the allocated pages only
if mapping or zeroing is explicitly requested for.

Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Increase the default number of regions

The total number of CMA regions that can be created is statically
decided at compile time via a config option. Incoming memory map
changes increase the number of CMA regions significantly across
almost all targets. Rather than make every target set the CONFIG,
just increase the default number. The additional overhead is very
small.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
drivers: cma: Fix wrong CMA selected region size default value

Kconfig lists CMA_SIZE_SEL_ABSOLUTE as the default value fo the CMA
selected region size, but that option isn't available in the defined
choices. Set the default to CMA_SIZE_SEL_MBYTES instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
drivers: Add option to reserve default CMA region

CMA provides good utilization of memory but for some use cases, the
allocation time is too costly. Add a Kconfig option to allow the
default region to be permanently set aside for contiguous use cases.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: print physical addresses correctly

Physical addresses can be greater than an unsigned long on
systems with LPAE. Print these addresses properly with %pa

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Make the default CMA region not reserved by default

Due to a bug in code logic, the default CMA region is
reserved when CONFIG_CMA_RESERVE_DEFAULT_AREA is NOT set
instead of when it is set. Fix this logic.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Add support for removed regions

In addition to reserving memory from the system, there may
be uses where memory should be completely removed from control
of the linux page allocator. Add the appropriate information to
be able to remove the memory.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	Documentation/devicetree/bindings/memory.txt
cma: Drop alignment requirements for regions not in system

CMA requires that regions be aligned to page block order or higher
to ensure migration types can be changed for whole regions. This
is not applicable if the memory is removed from the system completely.
Keep the alignment requirement at PAGE_SIZE if the memory is outside
the system allocator. Note that if there are alignment requirements
these can still be set up by manually aligning the base/size.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Drop the right mutex

The lock that was locked was cma->lock not cma_mutex. Drop
the right one when breaking out of the loop.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Return 0 on error path

If a free CMA region cannot be found because every one is busy,
an error needs to be propegated up by returning a zero pfn.
Ensure the pfn is actually zero when returning an error.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched: Make sched_setattr() correctly return -EFBIG

The documented[1] behavior of sched_attr() in the proposed man page text is:

    sched_attr::size must be set to the size of the structure, as in
    sizeof(struct sched_attr), if the provided structure is smaller
    than the kernel structure, any additional fields are assumed
    '0'. If the provided structure is larger than the kernel structure,
    the kernel verifies all additional fields are '0' if not the
    syscall will fail with -E2BIG.

As currently implemented, sched_copy_attr() returns -EFBIG for
for this case, but the logic in sys_sched_setattr() converts that
error to -EFAULT. This patch fixes the behavior.

[1] http://thread.gmane.org/gmane.linux.kernel/1615615/focus=1697760

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/536CEC17.9070903@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched: Disallow sched_attr::sched_policy < 0

The scheduler uses policy=-1 to preserve the current policy state to
implement sys_sched_setparam(), this got exposed to userspace by
accident through sys_sched_setattr(), cure this.

Reported-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: <stable@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20140509085311.GJ30445@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>