msm: vidc: Memset and flush codec context buffers

This change will memset and flush the codec context
buffers for non-secure case to resolve video driver
timer expire issues.

Change-Id: I6669481da3076a392061868475fc9844f2c41064
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: watchdog: Add reboot/shutdown notifications to watchdog

On shutdown or reboot path, callee CPU waits for one second
in order for other CPUs to respond. However, this coincides
with watchdog pet to bark timeout value, which sometimes
results in unnecessary watchdog barks.

Since we are either shutting down or rebooting the machine
anyways, we might as well wait a bit longer for bark timeout.
This gives a better chance to a graceful shutdown or reboot the
system because their call-sites are race prone.

Change-Id: Ie82f16dcc7671ddc05bf6c6ea20aa71981607273
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
mm: cma: remove watermark hacks

Commits 2139cbe627b8 ("cma: fix counting of isolated pages") and
d95ea5d18e69 ("cma: fix watermark checking") introduced a reliable
method of free page accounting when memory is being allocated from CMA
regions, so the workaround introduced earlier by commit 49f223a9cd96
("mm: trigger page reclaim in alloc_contig_range() to stabilise
watermarks") can be finally removed.

Change-Id: Iae17de8185eeabffd46752dbaf819591e6585869
CRs-Fixed: 480377
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mel Gorman <mel@csn.ul.ie>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit: bc357f431c836c6631751e3ef7dfe7882394ad67
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[lauraa@codeaurora.org: Context fixup in mmzone.h, keep zone definition in
alloc_contig_range for other purposes]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
mm: cma: fix accounting of CMA pages placed in high memory

The total number of low memory pages is determined as totalram_pages -
totalhigh_pages, so without this patch all CMA pageblocks placed in
highmem were accounted to low memory.

Change-Id: I10b78fa6a710828520a487b2fc2419b4f7521a6f
CRs-Fixed: 480377
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 41a7973447b0b8717f0a214d4328dc31ec2291d7
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ASoC: msm: Support independent left-right channel volume control

The current volume sent to DSP is averaged between left and
right channels. As a result with volume level as zero on one
channel and non zero on the other channel results to playback on
both channels. Add support to send left and right volumes to DSP

Change-Id: Icc5f182d138c841607ea356ec37a7f78b4ba770d
CRs-Fixed: 449284
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
Merge "mm: cma: remove watermark hacks"
Merge "mm: cma: fix accounting of CMA pages placed in high memory"
Merge "msm: vidc: Memset and flush codec context buffers"
Merge "ASoC: msm: Support independent left-right channel volume control"
Merge "msm: watchdog: Add reboot/shutdown notifications to watchdog"
ASoC: msm8930: properly protect external mclk control function

Both audio path and MBHC accessory detection logic need master clock
enabled along with bandgap and clock block of CODEC. Clock control
is managed by the machine driver. Calls to clock control function from
audio and MBHC detection paths can be nested. As a result, reference
counter of master clock is incremen/decrement out of order and cause
master clock not enabled when audio path is enabled. Without master clock
CODEC will not consume data and this leads to SLIMBUS overflow error.

CRs-Fixed: 469683
Change-Id: Ib3a55f5d0b36ebe9ba345e7f18162a9314500df2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Merge "ASoC: msm8930: properly protect external mclk control function"
Merge tag 'AU_LINUX_ANDROID_JB_2.5.04.02.02.040.292' of git://codeaurora.org/kernel/msm into cm-10.1

AU_LINUX_ANDROID_JB_2.5.04.02.02.040.292 based on quic/aosp/jb_2.5

Change-Id: Iaf790dce4acebe7b9177717c438694ba9665c789
block: urgent: Fix dispatching of URGENT mechanism

There are cases when blk_peek_request is called not from blk_fetch_request
thus the URGENT request may be started but the flag q->dispatched_urgent is
not updated.

Change-Id: I4fb588823f1b2949160cbd3907f4729767932e12
CRs-fixed: 471736
CRs-fixed: 473036
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
sched: Fix SCHED_HRTICK bug leading to late preemption of tasks

SCHED_HRTICK feature is useful to preempt SCHED_FAIR tasks on-the-dot
(just when they would have exceeded their ideal_runtime). It makes use
of a a per-cpu hrtimer resource and hence alarming that hrtimer should
be based on total SCHED_FAIR tasks a cpu has across its various cfs_rqs,
rather than being based on number of tasks in a particular cfs_rq (as
implemented currently). As a result, with current code, its possible for
a running task (which is the sole task in its cfs_rq) to be preempted
much after its ideal_runtime has elapsed, resulting in increased latency
for tasks in other cfs_rq on same cpu.

Fix this by alarming sched hrtimer based on total number of SCHED_FAIR
tasks a CPU has across its various cfs_rqs.

Change-Id: I1f23680a64872f8ce0f451ac4bcae28e8967918f
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
sched: Mark schedule_io_timeout() with EXPORT_SYMBOL

Make schedule_io_timeout() visible to modules.

Change-Id: Ic0dedbad8a591a9a721f0d2e8f6c372ec75bc4b2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
kernel: Mark find_task_by_vpid with EXPORT_SYMBOL_GPL

make find_task_by_vpid() visible to modules.

Change-Id: Ic0dedbad21a0d908a08dd64479a7acc6b3197d5f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
sched: Reset rq->next_interval before going idle

next_balance, the point in jiffy time scale when a cpu will next load
balance, could have been calculated when the cpu was busy. A busy cpu
will apply its sched domain's busy_factor (usually > 1) in computing
next_balance for that sched domain, which causes the (busy) cpu to load
balance less frequently in its sched domains. However when the same cpu
is going idle, its next_balance needs to be reset without consideration
of busy_factor. Failure to do so would not trigger nohz idle balancer on
that cpu for unnecessarily long time (introducing additional scheduling
latencies for tasks). Fix bug in scheduler which aims to reset
next_balance before a cpu goes idle (as per existing comment) but is
clearly not doing so.

Change-Id: I7e027a51686528c4092d770c7d33c874d38f5df4
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Revert "hrtimer: Prevent enqueue of hrtimer on dead CPU"

This reverts commit 878f1bd9ddd4b9734ad72d187b0266e640c99e08.

Based on upstream mailing list discussions, this patch is not
necessary since switch_hrtimer_base() is called with interrupts
disabled.

Change-Id: I53c64b1a4cea3a310ef53d1729a00baee6e4534a
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Revert "hrtimer: Consider preemption when migrating hrtimer cpu_bases"

This reverts commit f31b9b9f30f76847c94155f9da4da12f912b0885.

Based on upstream mailing list discussions, this patch is not
necessary since switch_hrtimer_base() is called with interrupts
disabled.

Change-Id: I0244a744516e1c289af25043ee8b866be54813e3
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>