Merge "ASoC: msm: qdsp6v2: Avoid DS1 and SRS topology on low latency path"
msm: camera: sensor: Update to use wait_for_completion.

Use wait_for_completion in place of wait_for_completion_interruptible

Change-Id: I960b334128e2b811b27c64721a65f7c7e773b085
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Merge "ASoC: msm: fix the target crash due to the NULL pointer dereference"
Merge "msm: vidc: recover from firmware fatal error"
USB: Clear pm_done flag to false in msm_otg_sm_work

As part of USB disconnect event, msm_otg_suspend() executes and USB
enters into low power mode and pm_done flag is set to true. In the
scenario in which before the msm_otg_suspend() finished executing,
then USB connect event came in, in this case msm_otg_suspend() returns
-EBUSY. And later USB connect event is processed. As device is already
in resumed state, hence pm_done flag is never set to false. So on
next USB connect pm usage counter gets incremented in msm_otg_sm_work()
and device cannot enter into sleep state.

Fix the issue by clearing pm_done flag to false as part of usb connect
in msm_otg_sm_work().

CRs-fixed: 649434
Change-Id: Ibc36221b2f8b781322fa741b1b6639dd813c0810
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
msm: vidc: ensure venus clocks are enabled while release buffer

While interframe clock gating, venus clock are gated ON and
OFF based on firmware response. It may happen that venus
clocks are disabled while iommu driver unmaps output buffers.
This may lead to unclocked memory access.
Venus clocks should be enabled while releasing output buffers.

Change-Id: Ib7a04c2d3600ae91a229730e2caffbff9c8353ca
CRs-Fixed: 645657
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
slim_ngd: notify slaves in some MDM restart scenarios

If MDM restarts when it had active framer, bus may lose sync.
Send device-down notification if that happens, and corresponding
reset-device and device-up notifications to slaves so that they
can act to restore their devices' communication over slimbus

CRs-Fixed: 612775
Change-Id: I83f22b9bcf18912c7c9507ea099691ed71d86a9f
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
msm-slim-ngd: Read configurable external modem identifier

When an external modem is used, read the config from dt and use the
value in subsystem restart callback registration.

CRs-Fixed: 612775
Change-Id: I5e40e98a60c304c82741914157191cfb2f0697d5
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
slim_msm: Handle external-modem shutdown differently than restart

External modem may shutdown in cases other than subsystem-restart.
In that case, the power-up notification may not happen.
Handle such a scenario and make sure runtime-pm vote is not held
for more time than required, and that slave-device up/down/reset
notifications happen as expected if slimbus was down.

CRs-Fixed: 645450
Change-Id: I5fef2393c835d06c5ce1dc4f9cb62d418620211b
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
msm: mdss: Configure minimum voltage for CX power rail

For smart panels, we observe abnormal waveforms and
unexpected voltage spikes on DSI data lanes when the cx
power rail goes to minimum voltage. Vote for the cx
regulator in mdp3 driver and control the voltage to
avoid frame shifting.

Change-Id: I8ce8d7621f903966f519da563a9c57701146be24
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
slim_msm_ngd: Add IPC logging support

Add IPC logging support for improved debugging
per device, and in memory to avoid using kernel
dmesg logs.

Logs are captured in four levels.
1) error level ---> All fatal errors are logged
2) warn level  ---> error level logs +
Warning messages are logged
3) Info level  ---> Error level +
warn level + the required information
for debugging is logged
4) Debug level ----> error level + warn level +
info level logs + extra information
for debugging are logged

Procedure to change the debug level at runtime:
==============================================
cd sys/devices/ctrl_num(eg:1234).slim
echo <log_level> > debug_mask

Procedure to collect the logs at run time:
=========================================
adb shell cat sys/kernel/debug/ipc_logging/ctrl_num.slim/log_cont
|tee slimbus.txt

CRs-Fixed: 645838
Change-Id: If183533472ee61b2d8cf458d228dd4ae2124dd37
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
msm: krait-regulator-pmic: account for PWM_CL register security

The PWM_CL register is secure i.e. driver has to write 0xA5 to 0XD0
register to allow updates to PWM_CL register.

Fix it.

Change-Id: I3f273627bdc137d8c10768c7d5824abe96ee8707
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
defconfig: Increase default kmemleak log size to 4000 from 400

Increase default kmemleak log size to 4000 from 400.

CRs-Fixed: 653040
Change-Id: Idb7187a90e1b4171bd0937ea8e49c9e5adb026ba
Signed-off-by: Prasad Sodagudi <psodagud@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: Allow remapping lowmem as 4K pages

Lowmem is currently mapped with sections (1MB/2MB) whenever
possible due to TLB performance boosts. Sections cannot easily
be changed at runtime however which makes implementing certain
features annoying. Add an option to map lowmem with 4K patches.
This is intended to be used as a debugging feature and should
NOT be used for performance testing.

Change-Id: I9612a99b8e05a022f5ba7e568f21307cf66b5667
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
mm: Mark free pages as read only

Drivers have a tendency to scribble on everything, including free
pages. Make life easier by marking free pages as read only when
on the buddy list and re-marking as read/write when allocating.

Change-Id: I978ed2921394919917307b9c99217fdc22f82c59
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
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: camera: Fix improper memory free in failure case

Remove improper drv_priv free in failure case and
add NULL pointer check to avoid kernel panic

Change-Id: If074eba245e93bf8fead505993a2611582e4398d
Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
Merge "ARM: dts: msm: Increase the drive strength for MSM8610v2"
Merge "cfg80211: Add support for QoS mapping"