msm: kgsl: Remove sscanf() from kgsl_pwrctrl.c

Replace sscanf() in kgsl_pwrctrl.c with a generic function to safely
convert 32 bit unsigned ints.

CRs-fixed: 563585
Change-Id: Ic0dedbad10e2264ec8fccab622d094d123b49b77
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: camera: Add lower and upper bounds check in msm_cpp.c ioctl()

Add a check for upper and lower bounds in msm_cpp_subdev_ioctl() for
command code VIDIOC_MSM_CPP_DEQUEUE_STREAM_BUFF_INFO.

CRs-fixed: 518731
Change-Id: I72996e13b7370a3b49f645297c52a118775b2b12
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
(cherry picked from commit 28385b9c3054c91dca1aa194ffa750550c50f3ce)
ASoC: msm: Null dereference check added

In asm_read function we should check buffer pointer
before it is dererferenced.

CRs-Fixed: 612682
Change-Id: I1968c038e1d35381bf174000287d542441e41092
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Merge "msm: camera: Add lower and upper bounds check in msm_cpp.c ioctl()"
Revert "Revert "ARM: dts: msm: fix ssd2080m pixel corruption issue""

This reverts commit 9214193490f0d2f1176b28e78c037e44e8e15f78.

CRs-fixed: 591272

Change-Id: Ida28597730fe38b32a64ecc08101f27a55fc8829
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
qseecom: Validate the pointer returned by ion_import_dma_buf

Do a "IS_ERR_OR_NULL" check for the return value of
ion_import_dma_buf.

Change-Id: Iaac8b59b1f076d002430e0e6aba055bd88c83ed7
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
msm: ipa: fix potential heap overflow in intf property queries.

Number of TX/RX/EXT properties to be read is supplied by
user-space and if these values are maliciously set too large,
heap overflow and memory corruption can result. This commit
caps the max allowed interface properties.

Change-Id: I9f5bf8b5e9a1b3b47b0741c0b00d5fafc77b28e2
Signed-off-by: Ravi Gummadidala <rgummadi@codeaurora.org>
Signed-off-by: Venkata Aravind <venkata@codeaurora.org>
Merge "ASoC: msm: Null dereference check added"
Merge "Revert "Revert "ARM: dts: msm: fix ssd2080m pixel corruption issue"""
Merge "msm: ipa: fix potential heap overflow in intf property queries."
misc: qfpfuse: validate ioctl input parameters

validate input parameters for ioctl command request

CRs-Fixed: 550574,550575
Change-Id: I87c3818b3bacc43c679aa555d79cc6ed127c6ef8
Acked-by: John Nicholas <jnichola@qti.qualcomm.com>
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Merge "misc: qfpfuse: validate ioctl input parameters"
Merge "msm: kgsl: Remove sscanf() from kgsl_pwrctrl.c"
qseecom: Add support for bus scaling.

Add support for scaling bus to various level:
LOW, MEDIUM, HIGH.  Expose IOCTL to user space
clients to enable selecting a specific bus bandwidth
setting.

Change-Id: I8ef94b84464e86d3a71e4c78c502e99ef2e0ec9a
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
qseecom: Add basic suspend resume functionality.

If ce clock is not disabled in suspend state, memory may be corrupted and
device can not wake up. Thus, if clock is enabled, we disable it in qseecom
suspend function and re-enable it again in resume function.

Change-Id: I70349ad3070c340add1f3fbe392a4bec2b8af9bf
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
qseecom: update clock ref count when bus scaling timer is running.

when there are multiple enable/dislable clock operations, ce clock
ref count is not updated correctly when the timer to disable clock
is running. Specifically, the ref count is not decreased when the
old operation is finished and then we reset clock for the new enable
clock. Thus, the ce clock is not disabled after all operation are
completed due to incorrect clk ref count. We make a change to
decrease clock reference count before reset timer, when the timer
is running, then clock is disabled when all ce clock operations
finish and the timer expires.

Change-Id: If71fd526acd9a74bf21731841fae0b98e76a89b5
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
qseecom: change qseecom bus scaling timer operation.

To ensure ce clock is not disabled before tz operation is completed,
we delete the old timer when tz side operation begins, and then add
a new timer after tz operation is completed.

Change-Id: I4bc8fe3d9305cc1ed5db8e6490832fcc791ef3d7
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
qseecom: Ensure CE clk is managed properly.

Clk access ref count is not updated correctly when issuing a
request that requires enabling clk. this results in leaving the
clk on during regular operation resulting in failure of the
device to go into low power mode.

Change-Id: I80232433ff09277fe83d78142dcec75e7493d96e
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
Merge "qseecom: Add support for bus scaling."
Merge "qseecom: Add basic suspend resume functionality."