msm: kgsl: Configure FT behaviour from sysfs instead of debugfs

FT behaviour is changed to be configured from sysfs
instead of debugfs. Sysfs control gives us the advantage
of configuring FT at bootup and also across bootups.
Persistant configuration across bootups helps
testing by configuring FT once and testing the FT
config across bootups.

Conflicts:

	drivers/gpu/msm/adreno.h
	drivers/gpu/msm/adreno_debugfs.c

Change-Id: Ia3378f214371a6a4b9f205f9f884976f58585971
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
diag: NRT read wakelocks held for very long time

During on-device logging with '-b' option,
NRT read wakelocks i.e. diag_nrt_modem_read
and diag_nrt_wcnss_read were held for more than
a day's time. This patch releases the wakelocks
even if SMD channel will be closed.

Change-Id: I7d211aaeaeb8d59369a191c5eef54c02a1b4a61d
CRs-Fixed: 513309
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
ASoC: msm: Change lpa driver to use HW instead of runtime params

Use HW params to allocate buffer size instead of runtime params.

Change-Id: Id7c531938e2f77241a6c1779b82d387e09ab03f2
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Revert "ASoC: msm: Undo Samsung derpage in LPA driver"

This reverts commit 8244bfb87c8a5eb6212e2cf2daa49255d94f8503.

Change-Id: If178e01a642c5581f2296afe84d8d1c158a129be
msm: kgsl: Use the kmalloc/vmalloc trick for the sharedmem page array

It was previously assumed that most GPU memory allocations would be
small enough to allow us to fit the array of page pointers into one
or two pages allocated via kmalloc.  Recent reports have proven
those assumptions to be wrong - allocations on the order of 32MB will
end up trying to get 8 pages from kmalloc and 8 contiguous pages
on a busy system are a rare beast indeed.

So use the usual kmalloc/vmalloc trick instead - use kmalloc for the
page array when we can and vmalloc if we can't.

CRs-fixed: 513469
Change-Id: Ic0dedbad0a5b14abe6a8bd73342b3e68faa8c8b7
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
cpufreq: interactive: fix show_target_loads and show_above_hispeed_delay

Remove a trailing whitespace from target_loads and above_hispeed_delay. Problem
happens when user-space program tried to restore parameters that saved before
changing parameters. In this case was returned error(EINVAL).

Change-Id: I5a74e3824602cd6f2b74651adda5ec1b627e61e9
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
mmc: Put back in some Samsung specific changes

Change-Id: I4ae1b3e50c0f2c7c570a6ec1a942083528aac740
ARM: Fix negative idle stats for offline cpu

We see negative idle stats because of cpu dying without
cleaning up idle entry statistics. When a cpu is offline,
the most immediate thing you'd want to do is just call
into cpu_die() and not waste time calling notifier(IDLE_START).

CRs-Fixed: 414554
Change-Id: Iadc6a3ca39997e0ccf65d2a29b004e24b1b211a1
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Taniya Das <tdas@codeaurora.org>
arm: Remove no-longer-required RCU_NONIDLE wrapper

Commit 21111be8 "ARM: Fix negative idle stats for offline cpu" moved call
to cpu_die() to occur outside of rcu_idle_enter()/rcu_idle_exit() section.
As a result, the RCU_NONIDLE() wrapper to complete() call in
arch/arm/kernel/process.c:cpu_die() is no longer required (and is
technically incorrect to have). Removing RCU_NONIDLE() wrapper also removes
this warning seen during CPU offline:

[Note: Below message has been edited to fit 75-char per line limit.
Insignificant portions of warning message has been removed in each line.]

------------[ cut here ]------------
WARNING: at kernel/rcutree.c:456 rcu_idle_exit_common+0x4c/0xe0()
Modules linked in:
(unwind_backtrace+0x0/0x120) from (warn_slowpath_common+0x4c/0x64)
(warn_slowpath_common+0x4c/0x64) from (warn_slowpath_null+0x18/0x1c)
(warn_slowpath_null+0x18/0x1c) from (rcu_idle_exit_common+0x4c/0xe0)
(rcu_idle_exit_common+0x4c/0xe0) from (rcu_idle_exit+0xa8/0xc0)
(rcu_idle_exit+0xa8/0xc0) from (cpu_die+0x24/0x5c)
(cpu_die+0x24/0x5c) from (cpu_idle+0xdc/0xf0)
(cpu_idle+0xdc/0xf0) from (0x8160)
---[ end trace 61bf21937a496a37 ]---

Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Change-Id: I721e6b20651674e6f6f584cf8d814af00b688c91
msm: watchdog: Add reboot/shutdown notifications to watchdog

On shutdown or reboot path, callee CPU waits for one second
in order for other CPUs to respond. However, this coincides
with watchdog pet to bark timeout value, which sometimes
results in unnecessary watchdog barks.

Since we are either shutting down or rebooting the machine
anyways, we might as well wait a bit longer for bark timeout.
This gives a better chance to a graceful shutdown or reboot the
system because their call-sites are race prone.

Change-Id: Ie82f16dcc7671ddc05bf6c6ea20aa71981607273
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
msm: pm-8x60: Use relative time for events

There is a bug when adjusting for event wakeups. The adjusted time
is being set in absolute mode incorrectly. Instead just use relative
times.

Without this core wakeups may not happen on time.

CRs-fixed: 486466
Change-Id: If625f25bd573b05befb6e0f922c80db646428b86
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
msm: camera: Check for valid pcam before using it

When event notify is called, check if pcam is valid or not
to avoid NULL pointer deferences.

CRs-Fixed: 462215
Change-Id: I78590c06ff5132dce0a629e8496d11360201aafc
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
msm: camera: Fix for properly configuring AXI bus when using dual_enabled mode

When lp_mode=0 and dual_enabled=1, the msm_camio_bus_scale_cfg API is not
called in axi_start() i.e. the AXI bus is not configured properly

Change-Id: Ifca9ca97ea21b8442ae801802e38d7d98433ba97
CRs-Fixed: 458802
Signed-off-by: Krupal Divvela <kdivvela@codeaurora.org>
msm: camera: Fix flash issue timeout

Add timer and refresh logic for flash to work
in torch mode until user changes flash stae.

Change-Id: I9f6e5fb8de60015d354234c65fd0e53733bcb4f5
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: camera: remove frame delay at start_stream in msm_sensor

required for latency optimization

Change-Id: I3d039e21ee8736cf8df1373d5386671f77f2382c
Signed-off-by: Punit Soni <punits@codeaurora.org>
Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
msm: camera: fix the out of order of frames issue

observed that if the frame processing in the userspace
is delayed, the incoming frames from the hardware are being sent
to user before the diverted frame returns.so dropping the
the delayed postprocessing frame to prevent out of order

Change-Id: I43b0f9ea7a7683a419ce142b7d4fdf9e13d11d95
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
msm: camera: Release mutex lock in case of failure

Release mutex lock in camera driver in case of a
failure.

Change-Id: Idc7de63b320df69754ad26fa9ae9639a08c96fc4
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: camera: Fix event queue drain issue

when camera daemon is killed, then command processing
timeout happens and there is a possibility of pending
event payload data. It creates a problem for further
command processing due to mismatch of event ids.
Drain the event payload queue when there is a timeout
for any event.

Change-Id: I046baf5ecc8abc8e795f96f8a1701da5c8506b88
CRs-Fixed: 467053
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: camera: Check if client is NULL before calling ion_free

NULL check was added inorder to prevent a target reboot in ion_free
in case client is already NULL

Change-Id: I263f56ff06ad7907c459b4f7254fc1435a41c61d
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
msm: camera: Add NULL pointer check for regulator

To avoid potential crashes, Null pointer check is added
before regulator calls are made

CRs-Fixed: 478027
Change-Id: Icf366c42b4dce544c133d6a6815068a37354ff4c
Signed-off-by: Alok Kediya <kediya@codeaurora.org>