msm: camera: Fix various small issues in Actuator driver

Bound check and validate userspace parameters direction,
number of steps and direction sign. Also fix possible
memory leak in certain error cases.

CRs-Fixed: 511349
Conflicts:
	drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c

Change-Id: Icaa324468574494fb40f2de78e522090806744cb
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Signed-off-by: Natiq Ahmed <c_mnatiq@qti.qualcomm.com>
msm: kgsl: Protect CP_STATE_DEBUG_INDEX

Put CP_STATE_DEBUG_INDEX and CP_STATE_DEBUG_DATA under protection
to keep it from being written from an IB1. Doing so however opens
up a subtle "feature" in the microcode: memory read opcodes turn off
protected mode in the microcode to do the read and then turns it
back on regardless of the initial state. This is a problem if the
memory read happens while protected mode is turned off and then we
try to access a protected register which then complains and goes boom.

To account for this irregularity explicitly turn back off protected
mode in all the places where we know this will be a problem.

Change-Id: Ic0dedbad1397ca9b80132241ac006560a615e042
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Mark the IOMMU setstate memory as read only

Mark the IOMMU setstate memory as read only in the pagetable.

Change-Id: Ic0dedbadb19e499c749cd744c3e89be3bcb4c2a2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
arm: mach-msm: Remove the unused rmt_storage code

The rmt_storage module is no longer used.
Remove the unused module and cleanup the makefile and kconfig.

CRs-Fixed: 549951
Change-Id: Ie9ebaa2209ea9fa0df05dc892504fcb882f00f29
Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
Merge "msm: kgsl: Mark the IOMMU setstate memory as read only"
Merge "msm: kgsl: Protect CP_STATE_DEBUG_INDEX"
Merge "arm: mach-msm: Remove the unused rmt_storage code"
arm: mach-msm: Remove the unused rmt_storage code

The rmt_storage module is no longer used.
Remove the unused module and cleanup the makefile and kconfig.

CRs-Fixed: 549951
Change-Id: Ie9ebaa2209ea9fa0df05dc892504fcb882f00f29
Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
unix: fix a race condition in unix_release()

As reported by Jan, and others over the past few years, there is a
race condition caused by unix_release setting the sock->sk pointer
to NULL before properly marking the socket as dead/orphaned.  This
can cause a problem with the LSM hook security_unix_may_send() if
there is another socket attempting to write to this partially
released socket in between when sock->sk is set to NULL and it is
marked as dead/orphaned.  This patch fixes this by only setting
sock->sk to NULL after the socket has been marked as dead; I also
take the opportunity to make unix_release_sock() a void function
as it only ever returned 0/success.

Dave, I think this one should go on the -stable pile.

Special thanks to Jan for coming up with a reproducer for this
problem.

CRs-Fixed: 660580
Change-Id: I0e39b84464cf3f4c9daf8677bba444d0d6d94825
Reported-by: Jan Stancek <jan.stancek@gmail.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Git-commit: ded34e0fe8fe8c2d595bfa30626654e4b87621e0
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
Merge "arm: mach-msm: Remove the unused rmt_storage code"
Update to AU_LINUX_ANDROID_LNX.LA.3.5.2.1.04.04.02.060.095

Change-Id: I5709fca323ac5b5f1c33abcab46703cd048b6b89
Signed-off-by: B2G User <b2guser@localhost>
msm: cpp: Provide cpp clock frequency table to user-space

CPP clock frequency table varies form platform to platform.
It have to be read and sent to user-space for cpp dynamic
clock calculation. It is done during GET_HW_INFO IOCTL
call. In result user-space sends current cpp clock rate
and bandwidth to be set up.

Change-Id: I8919776908914ee39fb86b28f0ce9f8735789c1c
CRs-fixed: 645604
Signed-off-by: Krupal Divvela <kdivvela@codeaurora.org>
Merge "msm: cpp: Provide cpp clock frequency table to user-space"
Merge "Update to AU_LINUX_ANDROID_LNX.LA.3.5.2.1.04.04.02.060.095"
wcnss: Reset IRIS card before Starting IRIS XO configuration

Set iris_reset bit of PMU CFG register to reset the IRIS
card before Starting IRIS XO configuration.

Change-Id: Id1cfd7e3e3df29919089725b2233c6f95afbbfb5
CRs-Fixed: 664642
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
Merge "wcnss: Reset IRIS card before Starting IRIS XO configuration"
mdss: mdp3: Remove scaling by 1 for ppp composition

Scaling by 1 logic was complicated. After trying to understand
what use cases we were preventing with this check, we verified that
ppp is actually able to handle scaling by 1 with hw team. There
is no need for this check.

Change-Id: I9f3cda5e61740fffdbda92dc768a98796b9a8238
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Merge "mdss: mdp3: Remove scaling by 1 for ppp composition"
Update to AU_LINUX_ANDROID_LNX.LA.3.5.2.1.04.04.02.060.098

Change-Id: I37febf4dbfcf350453a406e1dcb8264e3ede5573
Signed-off-by: B2G User <b2guser@localhost>
Merge "msm: camera: Fix various small issues in Actuator driver"