msm: kgsl: Ignore signals for ringbuffer timestamp waits

Ignore signals when waiting for ringbuffer timestamp since
the wait needs to complete regardless of whether the process
got a signal. Also, increase the wait timeout for context
detachment to 30s instead of 10s. Large IB's can take longer
than 10s to retire and if a hang happens then recovering from
the hang and completing the long IB's will take much longer
than 10s, bump this timer to 30s which should be sufficient
for the context's commands to retire even if hang happens.

Conflicts:
	drivers/gpu/msm/adreno_drawctxt.c
	drivers/gpu/msm/adreno_ringbuffer.c

CRs-Fixed: 718284

Change-Id: I54589c9ec48da3f87ccc60c85451daac7e9a22bd
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Anupam Sakargayan <asakarga@codeaurora.org>
qseecom:  Add checks for send_cmd inputs

Improve user input validation across send cmd APIs. Add new
API  __validate_send_cmd_inputs() to validate all user provided
inputs.

Change-Id: Ibbb0c0e7e5483f653bd59b927562b63c1e43c365
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
ASoC: msm: qdsp6v2: Unblock drain on reset event callback

Unblock drain on reset event callback from DSP as drain is
aborted in this case and it should be considered completed
with error.

CRs-Fixed: 731606
Change-Id: Iafc68eb6b75c21635d7ada4c56dd5af0b4b2c233
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
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>
Signed-off-by: Pradosh Das <prados@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>
Signed-off-by: Pradosh Das <prados@codeaurora.org>
qseecom: Free ion memory even if keymaster app is not unloaded

Make a change to free the ion memory allocated for keymaster client
even if keymaster app doesn't need to be unloaded from TZ, so as to
avoid memory leak.

CRs-Fixed: 724638
Change-Id: I3ddb68c8a3f96b0a44afc3efc63e93f0a8be51bb
Signed-off-by: Zhen Kong <zkong@codeaurora.org>