qseecom: Fix QSEECOM_IOCTL_UNLOAD_EXTERNAL_ELF_REQ kernel crash

Fixes the kernel crash occuring with IOCTL_UNLOAD_EXTERNAL_ELF_REQ
ioctl by adding unavailable client type to qseecom_client_handle_type
enum, which is required in the driver during qseecom_release().

Change-Id: I73b817255149ffc4a808852feb2954a0ba3c317f
CRs-fixed: 508253
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
msm:camera: Bound check the num_planes variable

Bound check the num_planes variable, otherwise for loop
can execute forever

Change-Id: I554b988e048b9bf64e92a157eb7459d270e54721
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
msm: msm_bus: Add checks during bus client unregistration

During unregistration clients should withdraw all pending
requests. This was earlier done in update-request function.
However, that caused acpuclock client requests to be
incorrectly zeroed out.

It seems more appropriate to let the client ensure that
they correctly clean up their requests than to have bus
driver forcefully remove non-zero requests. Hence, a
warning has been added in the unregistration path.

Change-Id: Icfd4f62f46fdd3219dc685007029be21b983c2d0
CRs-Fixed: 510389
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
mmc: core: Do not print error message if runtime-error is not set.

This patch checks the state of the device when schedule_suspend
fails and prints the error iff pm_runtime_error or pm_runtime is
disabled.

CRs-Fixed: 529879
Change-Id: I5800bc64cdcf5859260a7f24b9773355bef2f750
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
power: qpnp-bms: fix UVLO issues

When the battery gets in the low voltage range, don't limit
the corrections. We have seen UVLO where even though the BMS was
calculating SOC quickly it was not lowering the SOC fast enough.
Skip limiting ocv change when battery is near cutoff voltage.

Change-Id: I5d559a9df113b06a15b60bdb89fea61566583799
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
defconfig: 8610: add config to mark XPU violations as fatal errors

This config enables XPU violations to be fatal errors. Add this for
the debug defconfig only since it helps narrowing down stability
issues.

Change-Id: Ieb70a593c30b8ea90cdd9e46860a761ad90fb2b0
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
arm: Add XN bit to pgrprot_stronglyordered

pgprot_stronglyordered sets page attributes to the strongly ordered
memory type. This type is often used for regions of memory which
cannot be speculated into. Strongly ordered memory by itself prevents
speculative data accesses but it will not prevent speculative instruction
accesses. Since strongly ordered memory will never be used for
instructions, set the XN bit as well to prevent speculative instruction
fethces.

Change-Id: I3405a6f791499f32d94b0a60f55f2ffa08620c85
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: scm-pas: Provide a strongly ordered buffer to the secure world

The secure world requires that the metadata-containing buffer
be strongly ordered. Use the dma_alloc_attrs API to obtain a
strongly ordered region for this purpose.

CRs-Fixed: 525863
Change-Id: I0fdfb9957aa0eb66279afa362edec075c3dff131
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: mdss: Add support to YCBYCR MDP format

Add support to MDP_YCBYCR_H2V1 interleaved YUV format.

Change-Id: I3b4fccf8303db778af213feb03644e5600ee803f
Signed-off-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org>
arm/dt: camera:adjust mount angle for gc0339 sensor

Adjust the mount angle of gc0339 sensor from 90 degree to
270 degree.

Change-Id: If464c66e9a0f84fb9744991e90868352a9c77e81
CRs-Fixed: 532212
Signed-off-by: Wang Wenbin <wenbinw@codeaurora.org>
msm: camera: Bound check num_cid from userspace in csid driver

Upper and lower bound checks are enforced for num_cid
which is passed from userspace with lower as 1 and
max of 16.

Change-Id: Ic5456289cb2f2b4ea17610a7672eb2c5225b7954
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
ARM: dts: msm: update msm8x10 v1 and v2 chip support for QRD

Update msm8x10 model info to distinguish v1 and v2 chip and split
v1/v2 common devices into separate dtsi files for QRD OEM.

Change-Id: I2329c093e3f1387145423927cf3f4a0f51e0e1dc
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
arm/dt: msm-iommu-v0: don't gate XO shutdown

The MMSSNOC AXI clock is controlled by the apps clock driver,
therefore there is no concept of "active-only". If the clock
is on, it will stay on irrespective of whether the apps
processor is running or power-collapsed. Drivers need to
ensure that their requests are removed before entering a
low-power mode that is expected to lead to XO shutdown.
Therefore there is no point in including an active-only flag,
and drivers should not rely on this flag taking care of
turning off this clock, because that can't happen.

CRs-fixed: 521149
Change-Id: I5f77330599c1e7258512f655b826a215d2ddfdb7
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
arm/dt: msm-iommu-v1: don't gate XO shutdown

The MMSSNOC AXI clock is controlled by the apps clock driver,
therefore there is no concept of "active-only". If the clock
is on, it will stay on irrespective of whether the apps
processor is running or power-collapsed. Drivers need to
ensure that their requests are removed before entering a
low-power mode that is expected to lead to XO shutdown.
Therefore there is no point in including an active-only flag,
and drivers should not rely on this flag taking care of
turning off this clock, because that can't happen.

CRs-fixed: 521149
Change-Id: I2bb3eb1e223d13ef097619e64d64030482c026fe
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
sched: Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s

try_to_wake_up_local() should only be invoked to wake up another
task in the same runqueue and BUG_ON()s are used to enforce the
rule. Missing try_to_wake_up_local() can stall workqueue
execution but such stalls are likely to be finite either by
another work item being queued or the one blocked getting
unblocked.  There's no reason to trigger BUG while holding rq
lock crashing the whole system.

Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s.

Change-Id: I75fdaaf4dcaefcf3893e0404d98c8aa91f89934d
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130318192234.GD3042@htj.dyndns.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 383efcd00053ec40023010ce5034bd702e7ab373
CRs-Fixed: 519942
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
sched: change WARN_ON_ONCE to WARN_ON in try_to_wake_up_local()

The WARN_ON_ONCE() calls at the beginning of try_to_wake_up_local()
were recently converted from BUG_ON() calls. If these hit it indicates
something is wrong and that may contribute to other system instability.
To eliminate the risk of an instance of one of these errors going
un-noticed because there was an earlier instance that occured long ago,
change to WARN_ON(). If there ever is a flood of these there are bigger
problems.

Change-Id: I392832e2b6ec24b3569b001b1af9ecd4ed6828e7
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
msm: mdss: Mute blend warning.

MDSS driver throws warning in case requested blend operation does
not match with layer properties but it internally handles such
cases with proper blend configuration.
Silent the warning as it results in excessive logging.

Change-Id: Ia37a16d55dde4a4532972c0bb5dc6e7ecf35eb07
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Revert "Revert "ARM:dts:msm: Remove CPU notifications to RPM for MSM8610""

This reverts commit af3b3068a60b3e41afb1bfe2bd37f2ced551aa6e. Since
the RPM image with the fix to handle the SPM handshaking is available
revert this change and allow the original change where only L2 handshakes
with SPM.

Change-Id: I567d77c2ecc9acef9d68a29c4cefeb62a1e96f3a
Signed-off-by: Chandra Ramachandran <cramacha@codeaurora.org>
ARM: dts: msm8610: Update MPM mapping for GIC interrupts

Some interrupts can be bypassed during xo shutdown
as they are not responsible for wakeup. Update MPM
mappings with this list.

Change-Id: I4e294f2a30fa8458d50a0cf3f362cb0d40ba9913
Signed-off-by: Chandra Ramachandran <cramacha@codeaurora.org>
ARM: dts: msm8610: Add wcd9xxx IRQ to bypass list

The wcd9xxx interrupt can be bypassed as it wont
wakeup from XO shutdown

Change-Id: I543c425b6c556e561b4f30f290c1e827fdad748a
Signed-off-by: Chandra Ramachandran <cramacha@codeaurora.org>