Disable gentle_fair_sleepers & arch_power in kernel/sched/fair.c
Disable WIFI Driver Debug. works good no need to debug.

Thanks neobuddy89
Revert WIFI wakelocks to STOCK. to prevent too high power use.
Revert "drivers: bluetooth: Improve use of macros"

This reverts commit 6780709e56fb7adeb1190b6de1740bf08af28b02.

Users report SLOW BT connect to Car BT, also noticed with my car...

LG uses different BT code for sleep/wake so i will keep it STOCK.
bcmdhd: Reset the hang flag after notifications are sent

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

https://github.com/neobuddy89/hammerhead_kernel_caf/commit/7b683bd7323abe0b2bd4cd82e377236a99b4f517
gpio: msm: Remove software handling for dual-edge interrupts for TLMM_V2

The TLMM_V2 did not have hardware support for dual-edge interrupts.
This was handled in software using an algorithm to detect the current
edge and switch the interrupt polarity. This does not work after keeping
the RAW_STATUS_EN always enabled as switching the interrupt polarity
causes a spurious interrupt.
The TLMM_v3 has hardware support for dual-edge interrupts and this
continues to work as expected.
Thus, this patch removes dual-edge interrupt support for TLMM_V2.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
gpio: msm-v3: Use _no_log variants of readl/writel accessors

Avoid logging accesses to GPIO-related registers. This prevents flooding
of RTB logs when GPIOs are polled. GPIO (TLMM) registers should always
be accessible anyway, so logging of these accesses is unlikely to be
useful for debugging purposes.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cpufreq_alucard: Added init_boostfreq pcpu parameter.
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>
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>
sched: Fix sched_policy < 0 comparison

attr.sched_policy is u32, therefore a comparison against < 0 is never true.
Fix this by casting sched_policy to int.

This issue was reported by coverity CID 1219934.

Fixes: ("sched: Disallow sched_attr::sched_policy < 0")
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1401741514-7045-1-git-send-email-richard@nod.at
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched: Simplify return logic in sched_read_attr()

Gotos are chained pointlessly here, and the 'out' label
can be dispensed with.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/536CEC29.9090503@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched: Simplify return logic in sched_copy_attr()

The logic in this function is a little contorted, clean it up:

  * Rather than having chained gotos for the -EFBIG case, just
    return -EFBIG directly.

  * Now, the label 'out' is no longer needed, and 'ret' must be zero
    zero by the time we fall through to this point, so just return 0.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/536CEC24.9080201@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: Fix for USB device switch

Add mutex locks to prevent sending multiple mem map
commands unless the previous one returns, because otherwise
the mem_handle is overwritten.

Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9320: Fix null pointer access for event callback

The ASoC machine driver provides callback to codec driver to setup
certain settings that are specific to the machine. It is possible that
machine driver does not provide this callback when there are no machine
specific settings. In such cases the callback will be NULL. Make sure to
not access the callback if it is NULL to avoid null pointer dereference.

Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Enable headset in high performance

Invoke class AB sequence for headset path dynamically based on
module parameter. Change enables headset path in high performance
mode when module parameter is set to one.

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Enable headset in high performance

Invoke class AB mode for headset path when sample rate
is set to 192KHz and bit width is set to 24. Change enables
headset path in Ultra High Quality Audio(UHQA)mode.

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>