slub: tid must be retrieved from the percpu area of the current processor

As Steven Rostedt has pointer out: rescheduling could occur on a
different processor after the determination of the per cpu pointer and
before the tid is retrieved. This could result in allocation from the
wrong node in slab_alloc().

The effect is much more severe in slab_free() where we could free to the
freelist of the wrong page.

The window for something like that occurring is pretty small but it is
possible.

Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm: pass readahead info down to the i/o scheduler

Some i/o schedulers (i.e. row-iosched, cfq-iosched) deploy an idling
algorithm in order to be better synced with the readahead algorithm.
Idling is a prediction algorithm for incoming read requests.

In this patch we mark pages which are part of a readahead window, by
setting a newly introduced flag. With this flag, the i/o scheduler can
identify a request which is associated with a readahead page. This
enables the i/o scheduler's idling mechanism to be en-sync with the
readahead mechanism and, in turn, can increase read throughput.

Change-Id: I0654f23315b6d19d71bcc9cc029c6b281a44b196
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
msm: ADSPRPC: Allow mapping of IOMMU heap buffers

Map / unmap the IOMMU heap buffers based on SMMU presence so as
to allow for these buffers to be passed to the remote processor
with zero-copy.

Change-Id: I95b3bdd46a8fa6eb3bca660a3900b5d690c12617
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: cpufreq: Only apply driver limits for scaling_min/max_freq writes

When new values are written to scaling_min/max_freq sysfs files, the
current code applies all the limits imposed by various ADJUST and
INCOMPATIBLE notifiers handlers before storing them.

When the ADJUST and/or INCOMPATIBLE notifiers change their limits
frequently, this behavior makes it almost impossible for a
user/userspace process to store the scaling_min/max_freq limits
that go beyond the instantaneous limits imposed by the notifiers.
Since these sysfs nodes are typically meant to set limits that need
to be enforced for the foreseeable future, this is not a very user
friendly behavior.

So, change the behavior to only apply limits that are enforced by
the cpufreq driver. Typically, these are just the absolute limits
of the HW and don't change very often.

Change-Id: I1ccfaa2d1ee4ea595f882485d359dbdb407a0176
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Revert "[media] v4l2: Introduce V4L2_QCOM_BUF_FLAG_EOS"

This reverts commit a5918b3807cc7cd9ffb5622301a28a97bc3c9d00.
Revert "msm: vidc: add 4cc for hevc hybrid decoder"

This reverts commit 18736857a65d347ba63e422a8bb0297d85b6ecf9.
Revert "msm: vidc: add hevc hybrid driver support"

This reverts commit 9c0178bedaec7b690748d974121f1dc5302d39dc.
vidc: Cleanups
msm: vidc: Set proper verbosity in EBD function logs

Driver doesn't know if the returned values by FW will cause an error.
So lower the priority of the log being printed to avoid raising false
alarms.

Change-Id: I5bccaba13b24b48f76aa70a97e380c5096507f56
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: mdss: refactor performance calculations

Current logic could potentially lead to drop in performance (and
underflow) when multiple panels are there and both are updating mixer
configuration independently, as we may end up raising bus bandwidth for
another panel which may not be ready just yet, this is addressed by
updating performance configuration values until it's ready to switch
rather than updating values and performing these later (other panel
update could come in between).

Change-Id: Ib5077ecfd9390f67157067cb6c06106cb896868f
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_ctl.c
msm: mdss: account for peak bandwidth due to SMP fetch

At beginning of vsync, all pipes can start fetching at the same time in
order to fill their allocated SMP blocks, which is usually only enough
to hold first few lines of the layer. Account for this behavior and
ensure that there is enough bandwidth to fill these in the blanking
period.

Change-Id: Ic23e31813fe67958f741d52ab504ed683d23dd45
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: add back bus factors for bandwidth calculations

Bus factors are needed to account for how system behaves. AB factors is
needed due to the way bus driver is calculating the bandwidth by
dividing it across 2x ports. IB factor is needed to account for DDR
inefficiency and get the correct throughput.

Change-Id: Iccf83dd25615de489d8e986c38a6d2e9175a965c
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: push wait for fences and ping pong done as late as possible

All the configuration up until MDP flush is double buffered. This means
we are able to do all hardware programming without settings taking
effect until flush happens. Perform all programming, wait for fences
and wait for previous frame is done just before the flush in order to
reduce the time between last frame done and kickoff of next one.

Change-Id: I1fd0c7a65309a3b148c8efef61819bfe9a248f29
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
ASoC: msm: qdsp6v2: Use vsid as session id in voice driver

Replace internal session id with voice system id used across
various subsystems to uniquely identify voice sessions.

Change-Id: I9de06c023e994a040118a2ce4e5e8bae8c7b2707
Signed-off-by: Pradnya Chaphekar <pradnyac@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6v2/q6voice.c
	sound/soc/msm/qdsp6v2/q6voice.h
ASoC: msm: qdsp6v2: Add session specific volume and mute control

Update volume and mute control to make it session specific.
Add functionality to handle all sessions for HALs that are not session
specific.

Change-Id: Ic55d3d69c9d4955e5e1d19929a97deecf54a43f9
Signed-off-by: Pradnya Chaphekar <pradnyac@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6v2/msm-pcm-voice-v2.c
	sound/soc/msm/qdsp6v2/q6voice.c
ASoC: msm: Implement soft volume control

Existing cvd volume and mute commands have been deprecated.
Replace the deprecated volume api with soft volume api. Update
volume and mute kcontrol to take ramp duration as a parameter.

Change-Id: I320686d4deb3758c40441fbc54e952d885b548ff
CRs-fixed: 460114
Signed-off-by: Pradnya Chaphekar <pradnyac@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6v2/msm-pcm-voip-v2.c
ASoC: msm: qdsp6v2: Add session specific control for slowtalk

Update slowtalk control to make it session specific. Add
functionality to handle all sessions for HALs that are not session
specific.

Change-Id: Icd3ffb59ebae156ee4ca66196860e14d715ed0e4
Signed-off-by: Pradnya Chaphekar <pradnyac@codeaurora.org>
BU52031NVX: Add lid events to support the smartcover
msm: mdss: Enable solid fill on pipe

Add support to enable solid fill on pipe with an option to
configure fill-color by userspace. This support does not confine
to background pipe and can be used to enable solid fill on any source
surface processing pipes irrespective of the z-order.
This support can be used in requirements involving constant
color layers.

Change-Id: Iae3c2968ca2f2f1be161e9c2f857641ffbb859e5
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
tick: Dynamically set broadcast irq affinity

When a cpu goes to a deep idle state where its local timer is
shutdown, it notifies the time frame work to use the broadcast timer
instead.  Unfortunately, the broadcast device could wake up any CPU,
including an idle one which is not concerned by the wake up at all. So
in the worst case an idle CPU will wake up to send an IPI to the CPU
whose timer expired.

Provide an opt-in feature CLOCK_EVT_FEAT_DYNIRQ which tells the core
that is should set the interrupt affinity of the broadcast interrupt
to the cpu which has the earliest expiry time. This avoids unnecessary
spurious wakeups and IPIs.

[ tglx: Adopted to cpumask rework, silenced an uninitialized warning,
  massaged changelog ]

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: viresh.kumar@linaro.org
Cc: jacob.jun.pan@linux.intel.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: santosh.shilimkar@ti.com
Cc: linaro-kernel@lists.linaro.org
Cc: patches@linaro.org
Cc: rickard.andersson@stericsson.com
Cc: vincent.guittot@linaro.org
Cc: linus.walleij@stericsson.com
Cc: john.stultz@linaro.org
Link: http://lkml.kernel.org/r/1362219013-18173-3-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Change-Id: I6a880a39dd595526b80a6d72b88be74163513da9
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>