Logger from 3.8
staging: android: logger: Allow a UID to read it's own log entries

Modify the kernel logger to record the UID associated with
the log entries. Always allow the same UID which generated a
log message to read the log message.

Allow anyone in the logs group, or anyone with CAP_SYSLOG, to
read all log entries.

In addition, allow the client to upgrade log formats, so they
can get additional information from the kernel.

Cc: Android Kernel Team <kernel-team@android.com>
Cc: Nick Kralevich <nnk@google.com>
Signed-off-by: Nick Kralevich <nnk@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: stratosk <stratosk@semaphore.gr>
[v4] binfmt_elf.c: use get_random_int() to fix entropy depleting
slub: zero page to fix boot crashes

Latest mmotm rarely boots if SLUB is enabled: earlyprintk=vga shows
it crashing with various backtraces.  The memset has now been removed
from kmem_cache_open(), so kmem_cache_init() needs to zero its page.
This gets SLUB booting reliably again.

Signed-off-by: Hugh Dickins <hughd@google.com>
panic: fix incomplete panic log in panic()

Panic log should be printed on the console, but if someone lock the
console when panic, console won't print out panic log.

The incomplete panic log issue will happen in below scenarios:
1. One task call console_lock(), then panic happend before it call
console_unlock(). No panic log can be printed.
2. Cpu 0 call panic()->Cpu 1 call console_lock()->Cpu 0 call
smp_send_stop()
Cpu 1 will be stopped and can't unlock console,only top part of panic log
will be printed.

So unlock console anyway in panic() to keep panic log printed.

Signed-off-by: Qing Zhu <qzhu@marvell.com>
irq: potential integer wrapping __setup_irq()

"thread_mask" is an unsigned long.  It's better to use 1UL here so we
can take advantage of the high bits as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
irq: Set CPU affinity as soon as the irq thread is created

In an embedded target where IRQ affinities are pre-configured during
boot-time (and not modified through /proc/irq/../smp_affinity) during
run-time, the extra latency due to irq_thread_check_affinity can be
avoided during processing of the first interrupt with this patch.
Thoughts?

backported from Linux 3.5+ by faux123
time: cast ->raw_interval to u64 to avoid shift overflow

We fixed a bunch of integer overflows in timekeeping code during the 3.6
cycle.  I did an audit based on that and found this potential overflow.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
backported from Linux 3.6+ to Tuna Hybrid kernel by faux123
kernel/timer: Optimise apply_slack() for size and speed.

To apply proper slack, the original algorithm used to prepare a mask and
then apply the mask to obtain the appropriately rounded-off absolute
time the timer expires.

This patch modifies the masking logic to a bit-shift logic, therby
reducing the complexity and number of operations. Thus obtaining a minor
speed-up.

Signed-off-by: Chinmay V S <chinmay.v.s@pathpartnertech.com>
tuna_ak_defconfig: Disable SYSCALL_CHECK
Kernel Version: AK.080