msm: mdss: Check null-pointer dereferencing and buffer overflows

Add checks before possible null-pointer dereferencing. Add checks to
prevent buffer out-of-bounds access.

Change-Id: I17419c82654c4ad2d18c7f88e34447cf333450bb
Signed-off-by: Mathew Karimpanal <kjmathew@codeaurora.org>
Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
ARM: dts: msm: Add support for second qcrypto device for 8974

Add entry for a second qcrypto instance that uses a different
pipe pair for data transfer to/from CE hardware. This will allow
clients to use different PIPE key register set intended for a
different use case.

Change-Id: Ibdf5ae10de63f1a26ce37ab9b74e4a60346cc105
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
ARM: dts: msm: Add support for ce-device number in crypto driver

Add an entry for ce-device in qcedev and qcrypto device nodes.

Change-Id: Ibaed7e8992f0773873217a7520cd9874dc4e115e
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
msm: camera_v2: limit the max stream_cnt to 0x0000FFFF

In userspace, the stream id will be rounded by 0x0000FFFF when
packed into identity, which will cause stream id mis-match problem
if we keep increasing stream_cnt beyond 0x0000FFFF. So we also need
limit the max stream_cnt correspodint to userspace.

Change-Id: I65b064762be9fc8389f1fcde3c6602e2f2f68410
Signed-off-by: Fei Zhang <feizhang@codeaurora.org>
mmc: sdhci: Fix issue with SDHCI_NEEDS_RETUNING

The following two issues are addressed with this change -

1. The current code sets SDHCI_NEEDS_RETUNING flag even for tuning
commands and it will unecessarily cause tuning to be done again
for the next read/write command. Hence, we must not set this flag
for any CRC failures to tuning commands.

2. If SDHCI_NEEDS_RETUNING flag is set and if all tuning phases
pass, then the driver attempts to change the driver type by sending
CMD6 which is a not a tuning command. The driver will thus attempt
to do re-tuning again before sending CMD6 and goes forever in a
recursive loop. Hence, clear SDHCI_NEEDS_RETUNING flag before
executing tuning.

Change-Id: Iaf3b24b93fdf655392fe02c973799e465960a495
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
crypto: msm: enable rfc4309(ccm(aes)) algorithm

This patch enables rfc4309(ccm(aes)) algorithm. Further more, it fixes
an issues with ccm.  According to RFC3610, associate
data is optional. The assocaite data length can be 0 as shown in
testmgr ccm rfc4309 test vectors. The driver did not take this zero
length of  associate data situation into account. And the corresponding
test vectors in testmgr may fail.

Change-Id: I2f269a54ad269a8ba72c0e570a7859da223e2d9b
Signed-off-by: Panwar Vivek <vpanwa@codeaurora.org>
msm_serial_hs: Handle client requests without port open

Adding defensive checks in the APIs to handle the
client driver requests calling without port open.

Change-Id: I0d618abbc7a38151651550a07aa909689ce92054
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm: mdss: add support to validate pixel extension calculations

If a layer needs a scaling than its pixel extension values are calculated
in the user-space library and passed down to driver. Currently driver
blindly programs these settings to HW without validating for correctness.
This leads to HW hangs and stability issues. Add a proper sanitization
checks for pixel extension and report error back to user-space if any

Change-Id: I086cf0b23fbccd37a23bb509f067bffdf396c247
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
msm: mdss: fix bug for validating pixel extension calculations

While validating pixel extension calculations from user space,
validate the over fetch pixels with image dimentions in both
horizontal and vertical directions

Change-Id: I8e39e89d9ace8e26237b3b23ca375456abd804a1
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
mdss: mdp: reset init phase and phase step to default

reset the init phase and phase step registers to default
when the pixel extension are not calculated in userspace.

Change-Id: I876f1628fb46901a07deb1b97a4ab55f924612b0
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Merge "mdss: mdp: reset init phase and phase step to default"
Merge "msm: mdss: add support to validate pixel extension calculations"
Merge "msm: mdss: fix bug for validating pixel extension calculations"
Merge "msm_serial_hs: Handle client requests without port open"
msm: msm_bus: Suspected fix for deadlock

mutex is not released while checking for
null pdata which can lead to possible deadlock
condition.

Change-Id: I1dc3efd725df5bb75c96434a81d9a8f3f868cd0a
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Merge "ARM: dts: msm: Add support for second qcrypto device for 8974"
Merge "crypto: msm: enable rfc4309(ccm(aes)) algorithm"
Merge "ARM: dts: msm: Add support for ce-device number in crypto driver"
mdss: mdp: Appropriate check to see if right LM is needed

New fixes rely on selecting right layer mixer by changing
destination layer x offset to be >= left layer mixer's width.
This patch is to allow for this logic to be corrected on
chipsets that do not support x offset being greater than
layer mixer's width.

Change-Id: I860e87a8092c81a0a1523ee7b47b02b57160f4af
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Merge "msm: msm_bus: Suspected fix for deadlock"