[ARM] msm: do not crash when subsystem not initialized

Signed-off-by: Iliyan Malchev <malchev@google.com>
[ARM] msm: do not panic on subsystem_restart errors

A misbehaving subsystem should not be able to crash the app processor.

Signed-off-by: Iliyan Malchev <malchev@google.com>
msm: qdsp5v2: Increase buffersize of hostPCM interface.

The default audio sample rate of audioflinger is increased
from 44.1k to 48k.Increase the buffersize to take
advantage of that.

Change-Id: I7ffc6c697cb32b6983c9bb5cc6ea73a7a55b5006
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
msm: clock: Fix hardware clock gating detection for mdp_axi_clk

clock-debug uses a clock flag (CLKFLAG_HWCG) to determine if a
clock is capable of hardware gating. Unfortunately, recent
changes to clock handoff cause this flag to not always be set.

Take mdp_axi_clk for example. It is a depends of mdp_clk, and so
if mdp_clk is on out of the bootloader, mdp_axi_clk is indirectly
enabled by the clk_prepare_enable() call in __handoff_clk() when
mdp_clk is enabled. We could add support for handing off depends
clocks, but we're planning on removing the depends code and there
isn't a real problem in failing to hand off branches that are
depends since they're hidden from consumers anyway.

The only problem with this scenario is that branch_handoff() is
not called and so mdp_axi_clk is not marked as supporting
hardware clock gating. The clock flag is only used to indicate
support for hardware clock gating, so let's just read the
hardware anytime a users wants to know if the clock has hardware
gating or not.

This changes the semantics of the has_hw_gating file because we
read the hardware instead of returning a cached value and the
state of the hardware changes at runtime (e.g. if the clock is
put into reset hardware gating is turned off). In practice these
clocks aren't switching in and out of hardware gating mode while
a clock test is in progress so the impact of this change is
minimal to zero.

Change-Id: I4f646b1b32b42e3ef00067b47ffb78df8fb761d5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: clock-debug.c: Display clock vdd fmax values

Display the voltage level a clock votes for debugging.
The currently selected level is shown in square brackets.

Change-Id: I5062c5ea05408c94b63a1eeb376c42da9b7e5908
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
msm: smem_log: Initialize SMEM log after SMD

The smem_log dependency on SMSM is a legacy dependency that waited
for the modem to allocate the SMEM items before smem_log was initialized.
Now that smem_log can allocate the items first if necessary, it no longer
needs to wait for the modem since the only true dependency is that the
SMD module has initialized SMEM.

Update dependency information to initialize smem_log once SMD has
been initialized.

CRs-Fixed: 389529
Change-Id: I452eb31c8d2d1aea8ae02f8786a8c46f98c3ca2c
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
(cherry picked from commit fa44cd76ee424d4cfae2595ff69cff0510a94518)
msm: pm2: Update SPC LPM stats correctly

Currently StandalonePC stats are updating incorrectly even
for successful cases. After debug found that compiler has
optimized some of the instructions where the return value
from "msm_pm_power_collapse_standalone()" being compared
incorrectly and always log the stats as failed even for
success cases. Change the "exit_stat" variable to "volatile"
to avoid any optimization.

CRs-Fixed: 433578
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
(cherry picked from commit f59048d29fd75a30cac8c294e068178d9d489af3)

Change-Id: If1f9313f7968e93f5dcd9fb33426496f5091d14a
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: smd_tty: use pm_qos for bt performance.

A2DP audio skips out every 8-10 seconds in idle.
cpuidle is working and sometime A2DP audio skips in that time.

Use pm_qos to avoid this problem.

Change-Id: I00701c89cb9d5723e17928f452696db21e107ab0
Signed-off-by: Iliyan Malchev <malchev@google.com>
bluetooth: Send hardware event to userspace stack on controller reset

Bluetooth stack expects hardware error event when controller
goes in bad state. Send hardware error to the stack when BT
controller resets.

Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
msm: kgsl: Don't consider active count if not in active state

Don't consider active_cnt variable if not already in ACTIVE state.
The active count variable does not necessarily exactly indicate the
number of open handles to GPU for switching power state. Hence,
only wait for active count to reach zero before switching to SUSPEND
state if, the current state is ACTIVE.

CRs-fixed: 483154
Change-Id: Ie025a1873cfb9237bdfba89204f4c2116549eba4
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
mmc: msm_sdcc: fix a type mismatch in msmsdccc_config_dma()

msmsdcc_prep_xfer() function returns a signed integer value but
caller function msmsdcc_config_dma() is storing this value in an unsigned
integer variable which is obviously not the correct thing to do.

CRs-Fixed: 476578
Change-Id: I39159e2f4f73c7f54de359cbe4faba5e902915ff
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
ariesve: Moved the config_gpio_table method outside of the CONFIG_MSM_CAMERA block

This method is used by other drivers init methods
ariesve: Fixed some warnings reported during board compilation
ariesve: Initialize TV Encoder only if TV Out config option has been enabled
ariesve: Fixed display regulators init
ariesve: updated lcd regulator
video: Power management support on S6E63M0 display driver
ariesve: fixed double activation of the regulators of the display
Squashed update of kernel from 3.4.46 to 3.4.47
ashmem: avoid deadlock between read and mmap calls

Avoid holding ashmem_mutex across code that can page fault.  Page faults
grab the mmap_sem for the process, which are also held by mmap calls
prior to calling ashmem_mmap, which locks ashmem_mutex.  The reversed
order of locking between the two can deadlock.

The calls that can page fault are read() and the ASHMEM_SET_NAME and
ASHMEM_GET_NAME ioctls.  Move the code that accesses userspace pages
outside the ashmem_mutex.

Bug: 9261835
Change-Id: If1322e981d29c889a56cdc9dfcbc6df2729a45e9
Signed-off-by: Todd Poynor <toddpoynor@google.com>