PM: devfreq: Use high priority workqueue

It does not make sense to run kgsl on high and devfreq on regular
priority.
cpufreq: interactive: Choose highest frequency below or at target

This generally saves us one freq level.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: Support variable frequency calculations

Use a threshold value up to which we are evaluating the current
speed weighted by current load against each new choice of speed.
Above switch to the original frequency calculation proportional to
load relative to the max possible frequency which allows for more
dynamic and fair changes.

Default threshold is cpuinfo min which guarantees minimal freqs
and energy usage during (offloaded) media playback.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
arm: msm: Increase timeout to 2.5ms

CPU Boost of 2 ms has been increased to 2.5 ms to slightly improve performance.
So, also increase msm-pm timeout to prevent false warnings.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: cpufreq: Fix msm_cpufreq_get_freq() for sync CPUs

When CPUs are in sync, only CPU0 has a non-NULL cpu_clk. clk_get_rate()
on other cpu_clk will return 0. msm_cpufreq_get_freq() is used in multiple
places in cpufreq framework to determine current hardware frequency.

Fix msm_cpufreq_get_freq() to return the right hardware frequency for
systems with synchronous CPUs.

Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: Add Buffer overflow check

The overflow check is required to ensure that user space data
in kernel may not go beyond buffer boundary.

Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: qdsp6v2: Fix ion_import failure

When ion_import_legacy api fails,we should not
destory the client instead just bail out.

Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
qcom-cpufreq: Block hotplug until cpufreq is ready

Hotplug before qcom-cpufreq is ready could lead to inconsistent CPU
clock state. Block hotplug by returning NOTIFY_BAD in hotplug callback
until qcom-cpufreq is probed.

Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
qcom-cpufreq: Fix hotplug blocking logic

Change 2b63b10 qcom-cpufreq: Block hotplug until cpufreq is ready
intended to block hotplug until qcom-cpufreq driver has got all
clocks. However, its implementation still leaves a small window when
CPU 0 has got its clock but others haven't. If a hotplug happens on
another CPU that doesn't have its clock pointer, refcount of that CPU
clock will again be wrong.

Fix the issue by introducing a ready flag.

Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
soc: qcom: smd: Validate read and write addresses

The address from which data has to be read and the address to which the
SMD data has to be written is calculated based on the head and tail
indices for that SMD FIFO. If the indices are corrupted, then the
calculated pointer may be outside of the FIFO and may even be outside of
the range of SMEM.

Validate the read and write addresses to be with in the limits of
receive and send FIFO limits respectively.

Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/arm/mach-msm/smem.c

Change-Id: Ia6780bf207b1402d4ac9dfc9c3a48526265ea713
msm: gpiomux: Add msm_tlmm_misc_reg_read API

Provide an API for drivers to read from miscellaneous registers
in the MSM TLMM region.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched/rt: Perform cleanup for moved rt specific bits

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	drivers/net/wireless/bcmdhd/dhd_linux.c

Change-Id: I4a555cc4956753b5899296782f49639f0bc41279
ARM: SoC: convert MSM to SMP operations

Convert MSM SMP platforms to use struct smp_operations to provide
their SMP and CPU hotplug operations.

[antypas@xda: Adapt to 8974/hammerhead]
[linflux@arcor.de: Minor cleanups]

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Cc: David Brown <davidb@codeaurora.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/arm/mach-msm/hotplug.c

Change-Id: I5945298718c27e4a30813f82392af0efa14beb7e
ARM: smp: Make SMP operations mandatory

Now that all SMP platforms have been converted to use struct
smp_operations, remove the "weak" attribute from the hooks
in smp.c, and make the functions static wherever possible.

Change-Id: I2464ef7aabdcd414763a47d4c4afdd8626eb7f80
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: smp: remove wrapper functions

Remove some silly wrapper functions which aren't really required:
	platform_smp_prepare_cpus
	platform_secondary_init
	platform_cpu_die

This simplifies the code.

Change-Id: I42393b82fc856a85fd9f66033a4b7c8ead92c24d
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
topology: merge older Linaro cpupower version with upstream Linux
cpufreq: interactive: Honor changed minimum frequency

This saves a few cycles in the timer routine.

Change-Id: I4c0e89094a00a0b63eae6320e6c3bdbb2d4c307e
cpufreq: interactive: Honor boosted state in several timer calculations

Change-Id: If03da12c52d89a5293e32ac918db44a00ef34884
of: move of_get_cpu_node implementation to DT core library

This patch moves the generalized implementation of of_get_cpu_node from
PowerPC to DT core library, thereby adding support for retrieving cpu
node for a given logical cpu index on any architecture.

The CPU subsystem can now use this function to assign of_node in the
cpu device while registering CPUs.

It is recommended to use these helper function only in pre-SMP/early
initialisation stages to retrieve CPU device node pointers in logical
ordering. Once the cpu devices are registered, it can be retrieved easily
from cpu device of_node which avoids unnecessary parsing and matching.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/powerpc/include/asm/prom.h
	drivers/of/base.c

Change-Id: I92eeb558a17ca45044f5b6b2e5813ad2a4ab1f27
interactive: fix up headers