Merge tag 'AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.087' into caf
AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.087 based on quic/aosp/kk_3.5_rb1

Signed-off-by: dragon <dragon7780@hotmail.nl>
Merge tag 'AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.090' into caf
AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.090 based on quic/aosp/kk_3.5_rb1

Signed-off-by: dragon <dragon7780@hotmail.nl>
Merge tag 'AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.092' into caf
AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.092 based on quic/aosp/kk_3.5_rb1

Signed-off-by: dragon <dragon7780@hotmail.nl>
Revert "Merge tag 'AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.087' into caf"

This reverts commit b99fe14a87dd5af476312017ea6aa525311e1728.
Add /dev/frandom support

Signed-off-by: flar2 <asegaert@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
def: Add frandom

Signed-off-by: dragon <dragon7780@hotmail.nl>
msm8974: watchdog: Increase pet time by 10 sec to avoid false bites

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
staging: android: logger: Improve logging

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
CHROMIUM: clocksource: allow clocksources to be selected earlier during boot

Global and per-CPU timers ought to be initialized once SMP initialization
is complete.  Although the clocksources associated with these timers may
not be registered until later in the boot process, they should be ready
to go once registered.  We'd like to stop using the super low-resolution
boot clocksource (jiffies) as soon as possible since devices may rely on
accurate timekeeping while being brought up during boot, so move
clocksource_done_booting() to arch_initcall time so that we can switch
to a higher-resolution clocksrouce earlier in the boot process.

TEST=Pit and Lumpy both still boot reliably.  Boot time on Pit improves
considerably:
Before: [    3.032967] VFS: Mounted root ...
After:  [    1.855936] VFS: Mounted root ...
Lumpy boot time improves very slightly:
Before: [    1.786347] VFS: Mounted root ...
After:  [    1.754297] VFS: Mounted root ...

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
lib/scatterlist: error handling in __sg_alloc_table()

I was reviewing code which I suspected might allocate a zero size SG
table.  That will cause memory corruption.  Also we can't return before
doing the memset or we could end up using uninitialized memory in the
cleanup path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
kernel/fork.c: make dup_mm() static

dup_mm() is used only in kernel/fork.c

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
mm/ksm.c: use new hashtable implementation

Switch ksm to use the new hashtable implementation.  This reduces the
amount of generic unrelated code in the ksm module.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
ksm: Provide support to use deferred timers for scanner thread

KSM thread to scan pages is getting schedule on definite timeout.
That wakes up CPU from idle state and hence may affect the power
consumption. Provide an optional support to use deferred timer
which suites low-power use-cases.

To enable deferred timers,
$ echo 1 > /sys/kernel/mm/ksm/deferred_timer

Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
msm: watchdog-v2: use request_mem_region instead of request_region

Use request_mem_region api to request for allocating io resource in place
of request_region since the resource is actually not an io port resource
but io memory.

Signed-off-by: Aparna Das <adas@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
net/sunrpc: fix 'subbuf.[...]' may be used uninitialized in this function

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
ARM: make kernel oops easier to read

We don't need the offset for the first function name in each backtrace
entry; this needlessly consumes screen space.  This is virtually always
the first or second instruction in the called function.

Also, recognise stmfd instructions which include r10 as a valid stack
saving instruction, and when dumping the registers, dump six registers
per line rather than five, and fix the wrapping.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
ext4: remove unused ac_ex_scanned

When looking at a bug report with:

> kernel: EXT4-fs: 0 scanned, 0 found

I thought wow, 0 scanned, that's odd?  But it's not odd; it's printing
a variable that is initialized to 0 and never touched again.

It's never been used since the original merge, so I don't really even
know what the original intent was, either.

If anyone knows how to hook it up, speak now via patch, otherwise just
yank it so it's not making a confusing situation more confusing in
kernel logs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
ext4: address a benign compiler warning

When !defined(CONFIG_EXT4_DEBUG), mb_debug() should be defined as a
no_printk() statement instead of an empty statement in order to suppress
the following compiler warning:

fs/ext4/mballoc.c: In function ‘ext4_mb_cleanup_pa’:
fs/ext4/mballoc.c:2659:47: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
   mb_debug(1, "mballoc: %u PAs left\n", count);

Signed-off-by: Patrick Palka <patrick@parcs.ath.cx>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
ext4: remove unreachable code in ext4_can_extents_be_merged()

Commit ec22ba8e ("ext4: disable merging of uninitialized extents")
ensured that if either extent under consideration is uninit, we
decline to merge, and immediately return.

But right after that test, we test again for an uninit
extent; we can never hit this.  So just remove the impossible
test and associated variable.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>
ext4: remove unreachable code after ext4_can_extents_be_merged()

Commit ec22ba8e ("ext4: disable merging of uninitialized extents")
ensured that if either extent under consideration is uninit, we
decline to merge, and ext4_can_extents_be_merged() returns false.

So there is no need for the caller to then test whether the
extent under consideration is unitialized; if it were, we
wouldn't have gotten that far.

The comments were also inaccurate; ext4_can_extents_be_merged()
no longer XORs the states, it fails if *either* is uninit.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>

Conflicts:
	fs/ext4/extents.c

Signed-off-by: TomorrowLandAce <joaolrpaulo@gmail.com>