cpufreq: interactive: don't skip waking up speedchange_task if target_freq > policy->cur

When __cpufreq_driver_target() in speedchange_task failed for some reason, the
policy->cur could be lower than the target_freq. The governor misses to change
the target_freq if the target_freq is equal to the next_freq at the next sample
time.

Added a check to prevent the CPU to stay at the speed that is lower than the
target_freq for long duration.

Change-Id: Ibfdcd193b8280390b8f8374a63218aa31267f310
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
power: Adds functionality to log the last suspend abort reason.

Extends the last_resume_reason to log suspend abort reason. The abort
reasons will have "Abort:" appended at the start to distinguish itself
from the resume reason.

Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Change-Id: I3207f1844e3d87c706dfc298fb10e1c648814c5f
power: Add check_wakeup_reason() to verify wakeup source irq

Wakeup reason is set before driver resume handlers are called.
It is cleared before driver suspend handlers are called, on
PM_SUSPEND_PREPARE.

Change-Id: I04218c9b0c115a7877e8029c73e6679ff82e0aa4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
power: fix compile warning
crypto: ablk_helper - Replace memcpy with struct assignment

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   48e6dc1b2a1ad8186d48968d5018912bdacac744
commit: a62b01cd6cc1feb5e80d64d6937c291473ed82cb [20/24] crypto: create generic version of ablk_helper

coccinelle warnings: (new ones prefixed by >>)

>> crypto/ablk_helper.c:97:2-8: Replace memcpy with struct assignment
>> crypto/ablk_helper.c:78:2-8: Replace memcpy with struct assignment

Please consider folding the attached diff :-)

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
dm-crypt: show cipher mode to check occasionally

* just in case it ever changes on me
ramdisk: lkconfig: show wakeup sources
Linux 3.10.62
cpufreq: Introduce new relation for freq selection

Introduce CPUFREQ_RELATION_C for frequency selection.
It selects the frequency with the minimum euclidean distance to target.
In case of equal distance between 2 frequencies, it will select the
greater frequency.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Conflicts:
	drivers/cpufreq/freq_table.c
cpufreq: ondemand: update code to Linux v3.18
KCAL control: don't let RGB values drop below 50
drivers: ipc_router: Add support to disable loading a subsystem

IPC Router interfaces with PIL to load/unload a remote subsystem. In
certain System-on-Chips(SoCs) this support is not required.

Add a device tree configuration entry to disable loading a subsystem by
IPC Router. By default, IPC Router loads the remote subsystem and if that
entry is defined, then IPC Router does not load the concerned subsystem.

Change-Id: Ibf8b6b510c1b9006efe19a1bbebadf213ebeaacb
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
net: ipc_router: Fix the race condition during SSR

During subsystem restart, SMD XPRT state is checked after starting the
write operation on a SMD channel. The channel state is different from its
corresponding XPRT state. This causes a writer to start the write operation
and then abort it, since the channel is not in reset state and the XPRT is
in reset state. This in turn causes the channel to be busy.

Check the XPRT state first before performing the write operation on its
corresponding channel. Remove the XPRT from the XPRT list at the earliest
possible, so that any write operation on a reset XPRT is avoided.

Change-Id: Id97870d4d6dae2d778fe0b4f39fc5265ffcaa51b
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
ion: Remove custom compat framework

It was pointed out that there is no need for a custom compat ioctl
framework in Ion, that decision can all be handled in device
registration. Remove the custom compat framework and just handle
the decision regarding compat ioctls in msm_ion.c

Change-Id: I6a0791013ce8e1f2f679555a46afd33de8fd9ce6
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ion: fix remaining instances of sg_dma_len

Recently, [ec6c8a8f443: "ion: convert sg_dma_len(sg) to sg->length"]
moved Ion away from using sg_dma_len. However, a few instances were left
over from MSM-specific code. Fix these instances so that we're using
sg->length everywhere.

Change-Id: I76b07f5589ba3867e1584b129a0ccd9f3ef00ad7
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

Conflicts:
	drivers/staging/android/ion/ion_heap.c
ion: WARN when the handle kmap_cnt is going to wrap around

There are certain client bugs (double unmap, for example) that can cause
the handle->kmap_cnt (an unsigned int) to wrap around from zero. This
causes problems when the handle is destroyed because we have:

        while (handle->kmap_cnt)
                ion_handle_kmap_put(handle);

which takes a long time to complete when kmap_cnt starts at ~0 and can
result in a watchdog timeout.

WARN and bail when kmap_cnt is about to wrap around from zero.

Change-Id: I01cb09ad09b81c1d0e02e82333a14af6a08a92e9
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
gpu: ion: Clarify variable names and comments around heap ids v types

There is some confusion between when to use the heap type and when
the id.  This patch clarifies this by using clearer variable names
and describing the intention in the comments.  Also fixes the client
debug code to print heaps by id instead of type.

Change-Id: Ie8b3dadded52e18590fcb2ca94001f6ed46ef07d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Git-commit: dbb80960d2f720c9d06dcbe4726fc5a1e2c4e8e0
Git-repo: https://android.googlesource.com/kernel/common/
[mitchelh@codeaurora.org: Had to skip most of this patch since already
had most of it. Also had to apply to both ion.h files due to the UAPI
split. Also reverting 0b017a376827fc which renamed heap_id_mask to
heap_mask.]
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
ion: move shrinker out of heaps

Every heap that uses deferred frees is going to need a shrinker
to shrink the freelist under memory pressure.  Rather than
requiring each heap to implement a shrinker, automatically
register a shrinker if the deferred free flag is set.
The system heap also needs to shrink its page pools, so add
a shrink function to the heap ops that will be called after
shrinking the freelists.

Change-Id: Icda722d683426fadb8ddd1c8e9499264ab682c57
Signed-off-by: Colin Cross <ccross@android.com>
Git-commit: f3ae9a8286d63f13715d2082965d6b8849af05a5
Git-repo: http://android.googlesource.com/kernel/common/
[mitchelh@codeaurora.org: context differences due to our addition of
 cached page pools and some additional heap callbacks]
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
staging: ion: msm: Only parse available dt nodes

ION is currently ignoring the status property of device tree
heap nodes. Make ION aware of the status of the ION heap nodes making
it possible to disable certain heaps.

Change-Id: I96e6af97df6bbd1c24ace9aa476baae28409ea96
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
ion: Always flush using kernel virtual address

Cache operations via userspace address always has a risk of a
page fault. On arm64, userspace addresses are marked as write
protect and fixed up on first accesses. If a userspace address
that has not been written to is invalidated, we will take a
fault, fixup and proceed on. If the mmap semaphore is locked at
the time however we cannot fixup the fault and will abort instead.
Rather than hope the mmap semaphore is not write protected, always
invalidate via the kernel virtual addresses instead.

Change-Id: I71eb0d214cce54ebc82a213ae653f891939f273a
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>