scale reported batt% where <=3% reports as 0%

Change-Id: I7671ce58c2a0a5a4158d9d6e418b10af7fc7c5f9
Update fs/binfmt_elf.c

[v4] binfmt_elf.c: use get_random_int() to fix entropy depleting
Entropy is quickly depleted under normal operations like ls(1), cat(1),
etc...  between 2.6.30 to current mainline, for instance:




$ cat /proc/sys/kernel/random/entropy_avail
3428
$ cat /proc/sys/kernel/random/entropy_avail
2911
$cat /proc/sys/kernel/random/entropy_avail
2620




We observed this problem has been occurring since 2.6.30 with
fs/binfmt_elf.c: create_elf_tables()->get_random_bytes(), introduced by
f06295b44c296c8f ("ELF: implement AT_RANDOM for glibc PRNG seeding").




/*
 * Generate 16 random bytes for userspace PRNG seeding.
 */
get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes));




The patch introduces a wrapper around get_random_int() which has lower
overhead than calling get_random_bytes() directly.




With this patch applied:
$ cat /proc/sys/kernel/random/entropy_avail
2731
$ cat /proc/sys/kernel/random/entropy_avail
2802
$ cat /proc/sys/kernel/random/entropy_avail
2878




Analyzed by John Sobecki.




Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Dilger <aedilger@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Arnd Bergmann <arnn@arndb.de>
Cc: John Sobecki <john.sobecki@oracle.com>
Cc: James Morris <james.l.morris@oracle.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Ted Ts'o <tytso@mit.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Update MPU3050 kernel driver

1. Update MPU3050 drivers to Invensense MPU code update v3.3.4 ported from:
   https://android.googlesource.com/kernel/msm.git/+/android-msm-sony-cm-jb-3.0
2. Enable LSM303DLHA and LSM303DLHM as MPU3050 slaves instead of fake BMA150 and AK8975
3. Proper LSM303DLHA and LSM303DLHM power management when acting as MPU3050 slaves
4. Gyro & Magnetomer axis configuration changed

Change-Id: I48b03fdb5a45689cbc490ed88db60ed04657073f
Merge commit 'refs/changes/33/29733/12' of http://review.cyanogenmod.org/CyanogenMod/hp-kernel-tenderloin into ics
defconfig: increase available kgsl memory

This bumps the kgsl page_table count from 8 to 24 to help
prevent kgsl OOM errors. Also disables the "disable_shadow_writes"
as it's not clear that is needed and could increase performance.

Change-Id: I7073c2d2c7feb4d13bb8ef6759f46b6d56856acd
Merge commit 'refs/changes/34/33634/1' of http://review.cyanogenmod.org/CyanogenMod/hp-kernel-tenderloin into ics
Revert "Added wakelock short circuiting to allow wifi to sleep"

This reverts commit 2d5302d128f9875b1780c23b95754fc44826a19a.

This should no longer be needed with the latest ath6kl wifi driver
(CMTP v4.5) and how it handles WOW.
Merge commit 'refs/changes/33/33633/1' of http://review.cyanogenmod.org/CyanogenMod/hp-kernel-tenderloin into ics
video/msm: HACK to correct lcdc/mdp clocks ref counts

This corrects the reference counts for the pixel_lcdc, pixel_mdp
and mdp clocks. These clocks have incorrect reference counts due
to msm_clock_fixup in board-tenderloin. These clocks having incorrect
reference counts caused them to never be turned off and thus added
about 25-30 mA extra drain during sleep.

Change-Id: Ic1ccd89d604ab5537c0bb32c83b26bf30e561343
Merge commit 'refs/changes/32/33632/1' of http://review.cyanogenmod.org/CyanogenMod/hp-kernel-tenderloin into ics
tenderloin_wifi_power: add multiple enable/disable check

Change-Id: I3ae81f6635f96987c2d7de45e6b3773e0ecdda4f
Merge commit 'refs/changes/30/33630/1' of http://review.cyanogenmod.org/CyanogenMod/hp-kernel-tenderloin into ics
add backported vsprintf pV format

Needed by ath6kl module.

Change-Id: I52591e24fad1bd7ed80159b40dd96325d153c1f2
Merge commit 'refs/changes/29/33629/1' of http://review.cyanogenmod.org/CyanogenMod/hp-kernel-tenderloin into ics
Merge commit 'refs/changes/18/31618/1' of http://review.cyanogenmod.org/CyanogenMod/hp-kernel-tenderloin into ics
Remove ARM sha1 routines
Since commit 8827a4a
("lib/sha1: use the git implementation of SHA-1"), the ARM SHA1
routines no longer work. The reason? They depended on the larger
320-byte workspace, and now the sha1 workspace is just 16 words
(64 bytes). So the assembly version would overwrite the stack randomly.

The optimized asm version is also probably slower than the new improved
C version, so there's no reason to keep it around.  At least that was
the case in git, where what appears to be the same assembly language
version was removed two years ago because the optimized C BLK_SHA1 code
was faster.

Reported-and-tested-by: Joachim Eastwood <manabian@gmail.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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>