ASoC: core: avoid scheduling delay work

ASoC framework prevents undesirable audio artifact
due to quick shutdown and startup of CODEC Rx path by
schedule delayed work. When timer expires, delayed work
callback function calls DAPM to tear down CODEC Rx path
This mechanism is undesirable when user-space application
manages shutdown of CODEC Rx path in similar fashion.
It causes false turning off of active CODEC path when
there is use case requiring co-processor manages audio use
cases while host processor goes to suspend mode. Change
power down time to 0 instead of 5 second by default.

CRs-fixed: 351956
Signed-off-by: Patrick Lai <plai@codeaurora.org>
(cherry picked from commit 95c1e67867befcbd81c7d507f31f478f7a795377)

Change-Id: I75f4a019a381dffc93807c50108dcfecb7aad50e
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
msm: smd: Remove spurious DATA notification

Add a check to make sure that the SMD_EVENT_DATA
notification is only sent if the FIFO head or
tail has been actually updated.

This extra notification is harmless, but adds
interrupt overhead due to the extra unnecessary
processing.

Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
(cherry picked from commit 65a7d431afd94c59fd3cddc284db7db28f326377)

Change-Id: I884bd8a22e6bf82e5d6ca61b38d1b9de7fec3255
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
msm: msm_bus: Avoid exceeding allocated buffer space in debugfs

While commiting fabric data, there were writes to memory outside
allocated buffer space causing a crash.
Fix this by removing an unnecessary offset addition to buffer
length

CRs-Fixed: 344544
Change-Id: If5506753d472c3adc530cae58f6f248ebea07197
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
include: Add new histogram IOCTL parameters

Change the histogram IOCTLS to accept new data structures as well as read
from userspace when required. These changes are required so that other
histogram blocks can be read instead of the current DMA-P only
implementation.

Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 97c98688ca5549db24685ef87cd14aab21f86322)

Change-Id: Ief0f1984aca3f2d5b5c2032c700c9aa01092cdbb
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
msm_fb: display: disable mdp flip when enabling mdp solid fill

If both solid fill and flip mode are enabled, MDP underruns. So for
any pipe, if solid fill bit is set, flip operation modes including
left/right or/and up/done are disabled.

CRs-fixed: 334782
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit 917ed6837ea5a43fe61b39ba0b966ae642fd9c4d)

Change-Id: I479285e5036b05b1997e66592fe178803ad990ee
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
msm: pil: Synchronize request_firmware() with suspend

Calling request_firmware() during suspend/resume operations is
buggy and error prone. Therefore a check exists in
request_firmware() to see if a suspend/resume operation is in
progress. In testing we've seen that a wakeup interrupt can come
in during suspend and trigger subsystem restart to call
pil_force_boot() before userspace has fully thawed. Since this is
not allowed the request_firmware() call from pil_force_boot()
fails with -EBUSY and the processor is never rebooted.

Register for PM notifiers to avoid calling request_firmware()
when suspend/resume is in progress. Within the notifier
synchronize any request firmware calls with suspend using a
rwsem. In the case where pil is called before suspend, the
suspend notifier should block on the down_write() during
PM_SUSPEND_PREPARE. When suspend is initiated before pil any pil
operations should block on the down_read() until suspend
finishes. Doing this should fix races between suspend/resume and
request_firmware() within PIL.

Change-Id: Id12d128a3729680b36845de7228bf3919c32a672
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
msm: pm-8x60: Add clock debug to idle code path.

Clock debug during is suspend is enabled in pm-8x60.
This code has been added to the idle code path to be
able to debug the clocks that are left on and
result in apps not voting for XO during Idle PC.

Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
(cherry picked from commit 6fb932ded7e93dbc42667105dfd461f3c9a86d0e)

Change-Id: I6b5fe6d08d27a85269ee433ce7677b3e6e38557e
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
arm: Allow saving of stacktraces from other processes

Currently, a process is only able to save its own stacktrace
due to concerns about other processes going away while the
saving is occuring. Realistaically though, hititng this
case is very unlikely and the debugging benefit outweighs
the risk. Enable saving of other stacktraces for access
through systems such as procfs.

Change-Id: I584388f6edb48431bfec8d11d217f0fdc116f73e
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
vidc: Enable error concealment in video core

Without error concealment, there is a bug in video core due to which it
goes in to bad state for certain clips and times out. This change fixes
the issue.

CRs-fixed: 336167
Signed-off-by: Arun Menon <menon@codeaurora.org>
(cherry picked from commit 0a1dfa3ebb6056c8969fd594be998b7e666a74cd)

Change-Id: Ib3f8de2ff96bfe4d0db35197950fe758f9186b03
Signed-off-by: Yen-Pin Hsiao <yphsiao@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
msm: dma: Fix the error checking for DMA clocks.

If sometime while enabling dma clocks, clock operation fails, since we
are not sanity checking the error value and assumes that dma clocks are on.
Next time when dma timer expires, it tries to disable the dma clocks which
are not enabled earlier and we get a clock unbalance stack trace warnings.

This scenario is reproducible if we continuously reboot the target. If
clk enable is failed and we bail out immediately, the next timer event
will not be set and there will be no further call to clock disable.

CRs-Fixed: 342519
Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org>
(cherry picked from commit 253bafc36d5b90d1a2d8ba223f3a43ffabe1c4c7)

Change-Id: Icbb97a1f2265fddafac27ead10becbaf550dd694
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
msm: watchdog: set up dump area from cpu 0

The secure side will not correctly set up CPU0's watchdog interrupt as
an FIQ if the scm_call is made from CPU1. So, always make this call from
CPU0.

CRs-Fixed: 340231
Change-Id: Iadfe464359c1bc85e5586a0081fafede15dd8524
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>