Revert "crypto: ablk_helper - Replace memcpy with struct assignment"

This reverts commit 45e78d9a61fd4fb9a523f2fb1ef1de1379a7f866.
Make file update lol?
Revert "ARM: add support for bit sliced AES using NEON instructions"

This reverts commit ad04b41a3a41369eccfad5a07ad2cfabbf8ed268.
Revert "Revert "kernel: rng: Add IOCTL support to disable bus bandwidth""
This reverts commit 911fb8222bf5f4df424368a27b1c9f513db0a9d2

Change-Id: If9d4d8be7690c2cd7d4fffba084edb7247042dd0

Conflicts:
	include/linux/qrng.h
hwrng: add randomness to system from rng sources

When bringing a new RNG source online, it seems like it would make sense
to use some of its bytes to make the system entropy pool more random,
as done with all sorts of other devices that contain per-device or
per-boot differences.

Change-Id: I957c96f12248d8aaff03bf789ac55d62f219fe5a
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
staging: android: lowmemorykiller: select a new task to kill

Under certain circumstances, a process may take time to handle a SIGKILL.
When lowmemkiller is called again shortly after, it would pick the same
process to kill over and over, so that we cann't get free memory for long time.

Solution is to check fatal_signal_pending() on the selected task, and if it's
already pending, select a new task to kill.

Cherry-pick 5e3358093351e5d48e21250e31896b855542f22c
Reviewed-on: http://gerrit.pcs.mot.com/479831

Change-Id: I53445114451ffaba293f3c7174fb0b01ed0d34b6
Signed-off-by: Tianshui Shi <kfp634@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/505410
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
(cherry picked from commit da093001caf06ed2296b4f79c84cc48ce713eac6)

Signed-off-by: Luis Cruz <ljc2491@gmail.com>
kernel: smp: trylock when stopping CPU

On current Falcon platform, we have 4 CPUs. When one CPU panic and issue
IPI_CPU_STOP, the other three CPUs may get triggered to handle ipi_cpu_stop
and hold stop_lock spin lock at the same time, which would introduce spin
lockup finally.

The change uses spin_trylock instead to avoid the other CPUs lockup when panic

Change-Id: I25642f83143e4078e86cdb0fc9a2c6f04bfa1cd6
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
ARM: fault.c: try to fix up exception during oops

During oops processing, memory around registers are displayed
when displaying regs. Memory reading is attempted using
probe_kernel_address(). If the memory is mapped to temporarily
unavailable external register (e.g. clock is off) or invalid
address, the data abort caused by the reading attempt will enter
oops processing again. This re-entrance will be avoided by adding
checking for exception table.

Change-Id: I2d96dee6f2ce01d83ff34325d1e6ae5fb60f0d96
Signed-off-by: Yuanyuan Zhong <zyy@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/570223
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
power: enable wakeup_sources in user build

Make sure wakeup_sources exist in debugfs in user build
when CONFIG_DEBUG_FS removed.

Change-Id: I5273465826e6d09ba4a669f52568aed9584e83af
Signed-off-by: Ke Lv <a2435c@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/547258
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
cpuidle: remove cross-cpu IPI by new latency request.

when drivers request new latency requirement, it's not necessary to
immediately wake up another cpu by sending cross-cpu IPI, we can consider
the new latency to be taken into effect after next wakeup from idle,
this can save the unnecessary wakeup cost, and reduce the risk that
drivers may request latency in irq disabled context.

[<c08e0cc0>] (__irq_svc+0x40/0x70) from [<c00e801c>] (smp_call_function_single+0x16c/0x240)
[<c00e801c>] (smp_call_function_single+0x16c/0x240) from [<c00e855c>] (smp_call_function+0x40/0x6c)
[<c00e855c>] (smp_call_function+0x40/0x6c) from [<c0601c9c>] (cpuidle_latency_notify+0x18/0x20)
[<c0601c9c>] (cpuidle_latency_notify+0x18/0x20) from [<c00b7c28>] (blocking_notifier_call_chain+0x74/0x94)
[<c00b7c28>] (blocking_notifier_call_chain+0x74/0x94) from [<c00d563c>] (pm_qos_update_target+0xe0/0x128)
[<c00d563c>] (pm_qos_update_target+0xe0/0x128) from [<c0620d3c>] (msmsdcc_enable+0xac/0x158)
[<c0620d3c>] (msmsdcc_enable+0xac/0x158) from [<c06050e0>] (mmc_try_claim_host+0xb0/0xb8)
[<c06050e0>] (mmc_try_claim_host+0xb0/0xb8) from [<c0605318>] (mmc_start_bkops.part.15+0x50/0x2f4)
[<c0605318>] (mmc_start_bkops.part.15+0x50/0x2f4) from [<c00ab768>] (process_one_work+0x124/0x55c)
[<c00ab768>] (process_one_work+0x124/0x55c) from [<c00abfc8>] (worker_thread+0x178/0x45c)
[<c00abfc8>] (worker_thread+0x178/0x45c) from [<c00b0b24>] (kthread+0x84/0x90)
[<c00b0b24>] (kthread+0x84/0x90) from [<c000fdd4>] (kernel_thread_exit+0x0/0x8)
Disabling lock debugging due to kernel taint
coresight-etb coresight-etb.0: ETB aborted
Kernel panic - not syncing: softlockup: hung tasks

Change-Id: Id0e226b72498b3b97df0add614703e861c389798
Signed-off-by: Guojian Chen <a21757@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/532702
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Christopher Fries <qcf001@motorola.com>
Reviewed-by: David Ding <dding@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit 27e75e21c4a1bf7b551c7cbb6d1c603a361b2164)
staging: android: persistent_ram: allow printing to old buf

This change adds interface which can be used to print to old
persistent ram. We'll be able to add some useful annotations
to last_kmsg.

Change-Id: I4b6aaaaf3285d31b2e1ac0244d7ba01399bb7fa6
Signed-off-by: Yuanyuan Zhong <a6510c@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/504784
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
(cherry picked from commit 616fadfe57503a765d3034fa33dab0445d3f1967)
staging: android: binder:add ioctl BINDER_GET_PEER_PID

Add new ioctl BINDER_GET_PEER_PID to let user-space app to
inquire peer's pid of current transaction.

This is ported from

 *(CR): Scorpion_mini:UT: System Server Watchdog
  Reviewed-on: http://gerrit.pcs.mot.com/466351

Change-Id: Idfffd7e3bb9a81e52068ba599c25e605b612675e
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/506479
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
(cherry picked from commit 40b6938286a96c80f27ad9ccbe013b44599dd9ad)

Conflicts:
	drivers/staging/android/binder.h
staging: android: persistent_ram: free temporary buffer

When there is no valid old persistent_ram buffer, we need to free
the temporary buffers which are supposed to be merged into old
persistent_ram buffer.

Change-Id: I2fc06dbb78a98f0734fc866fa7ef92a140578bb7
Signed-off-by: Yuanyuan Zhong <a6510c@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/508951
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
(cherry picked from commit f540c1b3bf666ee1a5f288e76e2774293b3ed5e9)
staging: android: fdleak_dbg: Debugging FD leak

File Descriptor leak checking will be disabled in "user" build,
but enabled in "userdebug" and "eng" builds. When enabled, if
a process tries to create a big file descriptor (i.e. >= 512),
or to inject a big file descriptor into a remote process via
Binder IPC, the culprit thread's backtrace will be dumped in
Android "main" log.

If the culprit process' executable file is /system/bin/app_process,
the process must be an Android process with one SignalCatcher thread.
Then kernel sends SIGUSR1 to the process and waits <= 100ms until
the process' SignalCatcher thread finishes dumping the Java and
native backtrace of the culprit thread.

If the culprit process' executable file is not /system/bin/app_process,
kernel considers the culprit thread as a non-Java pthread, and launches
"/system/bin/helsmon start log_backtrace -p <culprit_thread_tid> --big_fd_created <fd>"
, which requests "/system/bin/helsmond" to dump the culprit thread's
native backtrace

Use http://zch68maindev.ap.mot.com/stabdev/tools/tombstones.php
to parse the native backtrace

Change-Id: I1a6d04007b9e901c66b22e5c655753473b828c19
Signed-off-by: GAO LIANG-TAO <w20048@motorola.com>
Change-Id: I0d8ef47b679a7162c2c0c4da7438e888913dc7a1
Reviewed-on: http://gerrit.pcs.mot.com/512022
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit fef661186e4f33758ecf2b71088903c48b01b626)
staging: android: binder: Debugging FD leak

Signed-off-by: GAO LIANG-TAO <w20048@motorola.com>
(cherry picked from commit cdae4b7951c96c28030daf3d801dcc322989c946)

Change-Id: Ic876b03f82cc8d400c9bd5901001ff0852afef84
staging: android: fdleak_dbg: Use MIN_BIG_FD as bottom line

Signed-off-by: GAO LIANG-TAO <w20048@motorola.com>
Change-Id: Ifb337feb4667e7194d029389f413e63357fb74b6
Reviewed-on: http://gerrit.pcs.mot.com/513326
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit 866789473ec06db9524ef3befa5f232d8425fa7d)
android: binder: reduce memory for binder debugfs

Reduce the amount of memory the binder debugfs seq_file's need
to output the large amount of data they provide.  This breaks up
the individual reads into smaller objects to limit the kmalloc'd
memory to a PAGE.  This helps reduce OOM conditions when these
files are read in mildly fragmented systems.

PROPAGATED_from: (CR)
Change-Id: I368573914f73975321270ea1cafe3fb3ef7de28a
Signed-off-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/391877
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Igor Kovalenko <Igor.Kovalenko@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Christopher Fries <C.Fries@motorola.com>
(cherry picked from commit 9f6c9a4758d372039f1bef9b22dc7c90b3164558)

Conflicts:

	drivers/staging/android/binder.c

Signed-off-by: Jason Hrycay <jason.hrycay@motorola.com>
Change-Id: Ibdaa5a659ba2267a17716139da601a7711dd5fd7
Reviewed-on: http://gerrit.pcs.mot.com/520867
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Reviewed-by: Christopher Fries <qcf001@motorola.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit 2a4028119f6b88b6d26a37383935edc77af388d3)
Signed-off-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
staging: android: fdleak_dbg: Improve FD leak debugging

(CR) enabled FD Leak debugging in Android platform.
However, often when a big FD is reopened the previous backtrace log
is useless; as a result the log has a lot of useless backtrace dumps
of reused big FDs.

This CR improves FD Leak debugging in that it doesn't spam the log
with too many useless backtraces at the time of big FD creation;
instead it shows the united big FD backtraces at the time of bug
(ANR/ForceClose/Tombstone/SystemServerWatchdogReset)
in occurrence-count descending order.

Signed-off-by: GAO LIANG-TAO <w20048@motorola.com>
Change-Id: I8c30b2cdfed2065484389b70d5b1fe5527b0cd14
Reviewed-on: http://gerrit.pcs.mot.com/524958
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
SLT-Approved: Gerrit Code Review <gerrit-blurdev@motorola.com>
(cherry picked from commit 257f0fb1bf1514bb3914706f2e60ddfd63bcbe95)
trace: allow memkill tracing to be selectively enabled

Change-Id: I8a50d6b121192b0dc94e2a9a0e05246a47045e81
Signed-off-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/482673
Reviewed-on: http://gerrit.pcs.mot.com/513906
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Thirumarai Selvi S <a16462@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit fd9bd32cd8f005b0d2f6438935fdd0bc9654c938)
staging: android: persistent_ram: add ram_add API

Add new API that simply adds a new persistent ram to the list. This is
almost same as persistent_ram_early_init except it doesn't reserve the
memory block. This new API is to be utilized by DT-based systems where
the reserved block is done in the kernel's mm system.

Change-Id: I769e03e7b1dae6e12f883ecd82f0e5542fe5f1aa
Signed-off-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/538632
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Reviewed-by: John Michelau <w14107@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>