hammerhead_defconfig: Disable the verbose user fault messages

Kernel spits out many messages when a user program crashes due to
an exception.  So it may cause the watchdog reset due to the verbose
messages. We don't need this feature in the production stage.

Change-Id: I45596b3a35c866151aec50887d8f85a067139842
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
slub: tid must be retrieved from the percpu area of the current processor

As Steven Rostedt has pointer out: rescheduling could occur on a
different processor after the determination of the per cpu pointer and
before the tid is retrieved. This could result in allocation from the
wrong node in slab_alloc().

The effect is much more severe in slab_free() where we could free to the
freelist of the wrong page.

The window for something like that occurring is pretty small but it is
possible.

Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
arm/dt: hammerhead: Fixed the yellow line on the gray UI

Bug: 11032252
Change-Id: Ife0001defed9b8871ac707709ef2ab2281da489e
Signed-off-by: sooduek.kim <sooduek.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Store freme request and apply on next EOF.

In order to get proper timing we need to store frame request
to next EOF. There is on guarantee if AXI IRQ or frame request
ioctl will happens first. Because of that we need store and apply
on next EOF in order to be sure that frame request will come
after AXI IRQ.

Bug: 11160785
Signed-off-by: Konstantin Motov <kmotov@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
hammerhead: disable /dev/diag

unset CONFIG_DIAG_CHAR & CONFIG_DIAG_OVER_USB

Signed-off-by: Patrick Tjin <pattjin@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
PM / Sleep: Add wake lock api wrapper on top of wakeup sources

Change-Id: Icaad02fe1e8856fdc2e4215f380594a5dde8e002
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
arm/dt: hammerhead: Increase command mode clock rate

Set command mode panel clock rate to 854.96MHz
This clock rate is within panel spec. Setting the value in device tree
avoids lower calculated clock value in driver. The transfer time from
mdp to panel is reduced and the overall system latency is improved.
The phy timings and the dsi-t clock settings are also adjusted accordingly.

Bug: 10951729
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Protect memory corruption in actuator drv.

Add check for size of step position table.

Bug: 11226273
Change-Id: I57ba477a04e726a82b73a7e01897d7b48d41756b
Signed-off-by: Konstantin Motov <kmotov@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Revert "arm/dt: hammerhead: Increase command mode clock rate"

This reverts commit e23080e5b40277f0f0cb5b7c8be87e04d169a591.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Move logic for deleting the fault timer

To make sure that the fault timer does not fire while the
hardware is in the process of turning off, delete the timer
before doing and active_count_put.

Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Fix error case in kgsl ioctl handler

If active_count_get fails, then calling active_count_put will
cause the active count to become unbalanced.  Fix the case
in the kgsl ioctl control code that was causing in inbalance.

Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
arm/dt: hammerhead: Increase command mode clock rate

Set command mode panel clock rate to 854.96MHz
This clock rate is within panel spec. Setting the value in device tree
avoids lower calculated clock value in driver. The transfer time from
mdp to panel is reduced and the overall system latency is improved.
The phy timings and the dsi-t clock settings are also adjusted accordingly

Bug: 10951729
Signed-off-by: sooduek.kim <sooduek.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera_v2: validated calls to copy_from_user

Validated calls to copy_from_user in isp driver in order to prevent overrun of
kernel memory by userspace.

Change-Id: I36ec1618a81b75fa3147a9234c991185fa1421f5
Signed-off-by: Konstantin Motov <kmotov@codeaurora.org>
Signed-off-by: Mansoor Aftab <maftab@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: split sync fence and display thread commit count

Sync fences should maintain a separate commit count from display thread.
Sync fences need the commit count in order to maintain proper timeline
and ensure the fences are created against right timeline. The display
thread on the other hand maintains number of commits that it should
handle. If we want to separate sync fences from display thread logic so
that sync fences can be released after asynchronously from display
thread then these need to be in separate variables.

Change-Id: I1303c49f2c56eb5b9a34c162a1896670d307a674
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: allow asynchronous acquire fence waits

Add optional flag to allow MDP driver to asynchronously wait for fences
instead of doing it at beginning of every commit. This allows the wait
to happen much later in the programming sequence so that, we can use
that time to do everything that is needed and have a smaller window
between the wait for fences and the next frame update.

Change-Id: Ib4f7601ed22670ba235ba86fe3389a5d54d685a9
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: push wait for fences and ping pong done as late as possible

All the configuration up until MDP flush is double buffered. This means
we are able to do all hardware programming without settings taking
effect until flush happens. Perform all programming, wait for fences
and wait for previous frame is done just before the flush in order to
reduce the time between last frame done and kickoff of next one.

Change-Id: I1fd0c7a65309a3b148c8efef61819bfe9a248f29
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: increase retire fence timeline with retire count

Account for cases where multiple retire fences are acquire before
previous ones are signaled. It may happen that the next retire fence is
acquired before the current one has been signaled, we want to signal on
the next vsync instead of the current one.

Change-Id: Ieff3115f9b10ea1a917eebdb6a32e44bc2e71c73
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
perf/arm: Fix armpmu_map_hw_event()

Fix constraint check in armpmu_map_hw_event().

Reported-and-tested-by: Vince Weaver <vincent.weaver@maine.edu>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Patrick Tjin <pattjin@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: fix frame done not signaling for command mode

When ping pong done schedule_work is used to schedule a workqueue to
signal the frame done signaling. Schedule work does not guarantee one to
one mapping to the signals done and if a second interrupt comes before
workqueue is done it may lead to some frame done signaling not
happening. Fix this by having additional count for the frames done.

Change-Id: Ie0a67ab45657ff6ef894f6958e9e4f1309ad9455
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: Fix potential spin lock recursion in compress driver

1. compr_event_handler() in this driver is called from interrupt context. This
   function uses spin_lock_irq() and spin_unlock_irq().
2. Calling spin_unlock_irq() from interrupt handler will enable the interrupts
   and could result another interrupt while we are still in an interrupt
   handler.

Replace spin_lock_irq() with spin_lock() and spind_unlock_irq() with
spin_unlock() in the compr_event_handler() function.

Replace spin_lock_irq() with spin_lock_irqsave() and spin_unlock_irq() with
spin_unlock_irqrestore() in rest of file.

Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>