sultan_defconfig: Update from mrg666
Revert "Defconfig: use optimized SHA1 and AES routines"

This reverts commit f957b7e48355ab723fbf33fb6999c65be42932fd.

Conflicts:
	arch/arm/configs/sultan_defconfig
Revert "arm/crypto: Add optimized AES and SHA1 routines"

This reverts commit dc32695767d66e7657c185833d87bfb5219e04a2.

Conflicts:
	arch/arm/Makefile
crypto: Import from mrg666
arm/crypto: Add optimized AES and SHA1 routines

Add assembler versions of AES and SHA1 for ARM platforms.  This has provided
up to a 50% improvement in IPsec/TCP throughout for tunnels using AES128/SHA1.

Platform   CPU SPeed    Endian   Before (bps)   After (bps)   Improvement

IXP425      533 MHz      big     11217042        15566294        ~38%
KS8695      166 MHz     little    3828549         5795373        ~51%

Signed-off-by: David McCullough <ucdevel@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Conflicts:
	crypto/Kconfig

Conflicts:
	arch/arm/Makefile
backport Qualcomm Crypto Engine from CAF MSM-3.4 kernel

Conflicts:
	drivers/crypto/msm/ota_crypto.c
	drivers/crypto/msm/qce.c
	drivers/crypto/msm/qce.h
	drivers/crypto/msm/qce40.c
	drivers/crypto/msm/qce40.h
	drivers/crypto/msm/qce_ota.h
	drivers/crypto/msm/qcedev.c
	drivers/crypto/msm/qcrypto.c
	drivers/crypto/msm/qcryptohw_30.h
	drivers/crypto/msm/qcryptohw_40.h
	include/linux/qcota.h
drivers: crypto: Import from mrg666
sultan_defconfig: Update and r44
msm: audio: qdsp6v3: Add size safety check to ACDB driver

Check that the size sent by userspace is not larger
then the internal amount allowed. This protects
against overflowing the stack due to an invalid size.
lib: genalloc: Change chunk allocation to vmalloc

Change the chunk allocation from kmalloc to vmalloc for
allocations greater than a page. This allows large
chunks to be allocated from physically non-contiguous
memory and increases the chance of the allocation
succeeding.

(cherry picked from commit 0614b96)

Conflicts:

	lib/genalloc.c

(cherry picked from commit 64cf718)

Change-Id: Ied97c888b967c4433519cb47e972f7a0f2281d71
CRs-fixed: 387655
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()

Use the observation that it is more efficient to check the wakeup
variable once before the loop reporting tasks that were not
frozen in try_to_freeze_tasks() than to do that in every step of that
loop.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Conflicts:

	kernel/power/process.c

Change-Id: I0bd9e71b638e565773f4861899ca175f82f2a4cc
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
msm: rpm: Replace mutex_lock_interruptible with mutex_lock

mutex_lock_interruptible() bails on signal pending. Instead use the
mutex_lock() variant and let the caller handle the pending signal
condition.

Change-Id: Ib06953731a7e4eb367358148bde202dfbdf556df
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
(cherry picked from commit 4f3b37232a708d6e8cf2f082f95d83f49d3a730c)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
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: 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>
mfd: pm8xxx-misc: Fix pm8xxx_smpl_control so that reset on SMPL works

pm8xxx_smpl_control currently sets power-off register values in
both the power-off and reset code paths for PM8018 and PM8921.
Correct this so that reset on sudden momentary power loss
(SMPL) works properly.

CRs-Fixed: 336620
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit c06e0d6283ece540e7a21618f3585e71a5d4dda0)

Change-Id: I7eae8a781a9651778ada48f82f939dd40a7e196f
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
arm: irq: Remove check for hardirq mask size

SPARSE_IRQ gives the freedom to use high, discontiguous IRQ
numbers at very low memory costs. But even with SPARSE_IRQ, the
highest interrupt number of the system is limited by NR_IRQS,
since NR_IRQS defines the number of IRQ_BITMAP_BITS.

NR_IRQS is currently limited to 1024 on ARM, as of the following
commit:

commit 5a5fb7dbe88dd57dc2bef0f3be9da991e789612d
Author: Steven Rostedt <srostedt@redhat.com>
Date:   Thu Feb 12 10:53:37 2009 -0500

    preempt-count: force hardirq-count to max of 10

This implies that architectures having more than 1024 interrupts
cannot manage. Let's remove the constraint on nesting level,
since as the commit above mentions, we're probably bound by stack
size at that point, anyways.

Change-Id: Ic4af331874a8fda66e2c94ef80ad73314badd74d
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
msm: pil-dsps: Assert peripheral reset in addition to proc reset

Failure to assert the peripheral reset in addition to the
processor reset causes state to be maintained across reboots.
Assert the peripheral reset to fully reset the dsps.

Change-Id: I737271a9ffa42253894f83dfd856fb3419ef8275
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
tick-sched: change the cpu that updates rq_stats

It can happen that the scheduler tick stops on cpu 0 but keeps
running on some other cpu. Make the cpu in-charge of updating
the jiffies also update the rq_stats.

Change-Id: Idb1a8132bd96500c68c516b4a99663965cec28e1
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
sultan_defconfig: Disable MSM_CPU_FREQ_SET_MIN_MAX

Fixes thermald restoring the incorrect frequency.
thermal: Import proper msm8x60 temperature sensor driver from mrg666's kernel

https://github.com/mrg666/android_kernel_shooter/commit/0829832944c4d0da5caaa6cc47e9bac5ec42266e