msm: ocmem: Call restore_sec_config() after every power collapse

As the QRIB is enabled, after every power collapse of ocmem, the
QRIB is reset to the maximum security state. Due to this the apps
processor cannot access the ocmem register space.

The restore_sec_config() scm call needs to be called before any
register is accessed after a power collapse to ensure that the
security configuration is restored. The clocks need to be turned
on before every call that is made into TZ to ensure that there
is no power collapse.

CRs-Fixed: 651324, 660089
Change-Id: Ieb6b635142057e219de29e811c93749f6500cec5
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
Merge "msm: ocmem: Call restore_sec_config() after every power collapse"
msm: thermal: Automate KTM's switch to interrupt mode

Add support to Kernel Thermal Monitor (KTM) to stop polling
the temperatures and switch to interrupt mode when the KTM
module init is called. This avoids KTM's dependency on
thermal-engine to notify when to switch to interrupt mode.

After switching to interrupt mode, the KTM spawns a
thermal monitor thread and registers temperature
thresholds for monitoring the vdd restriction.

CRs-Fixed: 567187
Change-Id: Ib1536c9fc32d3fc0ef2737818c39ca80c5d636d8
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
(cherry picked from commit 1e7f31cbab5a5546d28ce63225635162dcb852e6)
msm: thermal: Update to speed up bootup time

Update KTM driver to remove flush_scheduled_work that
would introduce bootup delay. This patch replaces
cancel_delayed_work with cancel_delayed_work_sync
to cancel a delayed work.

CRs-Fixed: 647439
Change-Id: Ie81278ca3a7a58f8f46463f7149b512bd07cbcbc
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
(cherry picked from commit f1e51e6fb314f35436b9599a5574ff28f61c2956)
Merge "msm: thermal: Automate KTM's switch to interrupt mode"
Merge "msm: thermal: Update to speed up bootup time"
msm: vidc: Validate userspace buffer count before using it

Validate the number of buffers count variable before
using it to avoid structure overflow error.

Change-Id: I61582c93e0f26ec6842e437134fb8a42bdbc36ff
CRs-fixed: 563654
Signed-off-by: Pachika, Vikas Reddy <vpachi@codeaurora.org>
Merge "msm: vidc: Validate userspace buffer count before using it"
msm: vidc: Validate userspace buffer count

Makesure the number of buffers count is less than
the maximum limit to avoid structure overflow errors.

Change-Id: Icf3850de36325637ae43ac95f1c8f0f63e201d31
CRs-fixed: 563694
Signed-off-by: Pachika, Vikas Reddy <vpachi@codeaurora.org>
Merge "msm: vidc: Validate userspace buffer count"