avtimer: msm: allow driver to register to SSR framework

Sub System Restart[SSR] framework allows driver to handle
unexpected crash in middle of operation.
Also, adding support clk_div dtsi entry to calculate
avtimer_lsw value.

Change-Id: I521e3c010dadd00a06a0fe8998a1759b2eb81b55
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: vidc: Handle hfi session creation failures properly

Previously, when the hfi session creation failed, the hfi session was
left intact.  So, in case of timeouts, if the core responded beyond the
time out, the driver would handle the message thinking that it's a valid
session.  This commit cleans up the hfi session in case session_init
fails (or times out).

Also rename msm_comm_recover_from_session_error to msm_comm_kill_session,
as the latter was a misnomer, as the function was used to abort a session.

CRs-Fixed: 762541
Change-Id: I9ec4337014f012b6c0f677c5c4844bf9b28c9899
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
Signed-off-by: Balamurugan Alagarsamy <balaga@codeaurora.org>

Conflicts:
	drivers/media/platform/msm/vidc/msm_vidc_common.c
msm: vidc: Handle max clients error from video hardware

Use instance "lock" instead of "sync_lock" variable for
mutex lock/unlock for video instance state change operation
else session init will be timed out due to dead lock when
max clients error is received from video hardware because
"sync_lock" is already acquired before session init.
At the same time do not free the session when any error
is received from video hardware, if freed results in
dangling pointer access when video driver wants to send
any commands to video hardware after session error,
leading to device reset. The proper way of session cleanup
is already being done upon receiving any errors from
video hardware.

CRs-Fixed: 762541
Change-Id: I689dd255681826508069fa86fb5a87f92fc775b5
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Balamurugan Alagarsamy <balaga@codeaurora.org>
msm: kgsl: Disable shader memory dump during snapshot

Disabling shader memory dump for these chipsets(8974, 8x26, 8x10).

CRs-Fixed: 650035, 637989, 631728.

Change-Id: I3a56810147e16763eaf3131aa837ed535a447e69
Signed-off-by: Anupam Sakargayan <asakarga@codeaurora.org>
msm: kgsl: Increase fault timer for slower a305 GPU

Slower GPU's need larger fault timer to detect hangs correctly.
we use 50ms fault timer for faster GPU's, a305 GPU is slower
compared to faster GPU, use a larger 200ms fault timer to
prevent false hang detection.

Change-Id: I0f0bf492ae2d9941979893b75b2e1dbc832e1ba8
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Increase fault timer for A305B GPU

Slower GPU's need larger fault timer to detect hangs
correctly. Frodo A305B GPU is slower compared to faster
GPU, hence use a larger 200ms fault timer to prevent
false hang detection.

Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
Change-Id: I6338cecc3be81700ab10c45fab66daa7a1078e42

Conflicts:
	drivers/gpu/msm/adreno_dispatch.c
msm: kgsl: Don't block on the dispatcher mutex in issuecmds

Don't block the rendering thread if we can't get our hands on the
dispatcher mutex in adreno_dispatcher_issuecmds(). If the mutex
is held then there is an excellent chance that somebody else is
running the scheduler. To be 100% sure schedule the worker again
to catch any subtle races.

Change-Id: Ic0dedbad8126ebfe776840cd6d7227b39477f3fa
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: store process comm name in kgsl_process_private

Now that contexts keep a reference on their owning
kgsl_process_private, look up pid and process from there.
If the process is exiting while hanging the GPU, the
process name might not be available anymore by the time
we make the snapshot.

Change-Id: If05ae2096dd7d25bfe9931e949759e11ba3cd262
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: Skip the entire command during fault recovery

During fault recovery the algorithm may choose to skip the faulting
command. To skip just one indirect buffer we have to rely on
CP_IB1_BASE but depending on where the fault happened the base could
already be pointing to the next buffer. This causes the code to skip
over the wrong buffer. There is no advantage to skipping just one
buffer vs the entire submission.

Change-Id: I28dc999b2156d05f7b5084df6bdd95c5b9308579
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Add a timer to detect possible syncpoint deadlocks

Use timers to detect when a syncpoint stays active for too long. This
won't avoid deadlocks but it sure will make it easier to debug them.

Conflicts:
        drivers/gpu/msm/kgsl_device.h

Change-Id: Ic0dedbadde07abcc1d39563c3b141591cbf2f634
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Avoid a deadlock with the cmdbatch timer

Don't take the cmdbatch lock while deleting the cmdbatch timer.
This avoids a deadlock where del_timer_sync() waits for the timer
function which needs to take the lock.

CRs-Fixed: 644944
Change-Id: Iaeb5a26b67e96e8e748fb9ff8c26fa8b0f2c3827
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
ASoC: msm: Add async ops for codec TX path

 * Improves low-latency capture performance

Change-Id: I34cdf6da4b8be8cdd4874ca203b1f2ff08eb1dc2
msm: kgsl: Elevate the priority of the thread during adreno start

It turns out that having lots of spurious threads causes race
conditions. Who knew? Instead of spawning a new high prority
thread just bump the priority of the current thread up
while adreno_start is running.

Change-Id: Ic0dedbadf65da11c800578c8769ae844f010e925
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>