Squashed update of kernel from 3.4.76 to 3.4.77
Revert "staging: zram: Add auto loading of module if user opens /dev/zram."

This reverts commit c70bda992c12e593e411c02a52e4bd6985407539.

It's incorrect, Kay writes:
	Please just remove it. "devname" is meant to be used for
	single-instance devices with a static dev_t, never for things
	like zramX.

	It will not do anything useful here, it does nothing really
	without a statically assigned dev_t, and it should not be used
	for devices of this kind anyway.

Reported-by: Tom Gundersen <teg@jklm.no>
Reported-by: Kay Sievers <kay@vrfy.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: zram: Fix access of NULL pointer

commit 46a51c80216cb891f271ad021f59009f34677499 upstream.

This patch fixes the bug in reset_store caused by accessing NULL pointer.

The bdev gets its value from bdget_disk() which could fail when memory
pressure is severe and hence can return NULL because allocation of
inode in bdget could fail.

Hence, this patch introduces a check for bdev to prevent reference to a
NULL pointer in the later part of the code. It also removes unnecessary
check of bdev for fsync_bdev().

Acked-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: zram: Fix memory leak by refcount mismatch

commit 1b672224d128ec2570eb37572ff803cfe452b4f7 upstream.

As suggested by Minchan Kim and Jerome Marchand "The code in reset_store
get the block device (bdget_disk()) but it does not put it (bdput()) when
it's done using it. The usage count is therefore incremented but never
decremented."

This patch also puts bdput() for all error cases.

Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usb: msm72k_otg: Update OTG status management
usb: msm72k_otg: Allow USB bus overdraw for Legacy OTG

This commit allow to set a new option in kernel config:
USB_MSM_OTG_72K_ALLOW_BUS_OVERDRAW

The option allows USB bus overdraw when using peripherals
attached via OTG on Legacy Qualcomm on-chip USB controller
Update defconfigs
exFAT: Update to v1.2.5

Change-Id: I6a43a674e5edc599b00a902247539b11569f4e6f
defconfig: Disable NTFS and build exFAT as built-in

 * CM uses ntfs-3g fuse for NTFS.
Revert lowmem and vmalloc patches

Revert "mm: make is_vmalloc_addr lockless"

This reverts commit 675539b2812b0db12490210ed079185f933a1b3b.

Revert "Kconfig: Add menu choice option to reclaim virtual memory"

This reverts commit a447197635ef394d8e9270bbcc7049f8beb20e75.

Revert "Kconfig: Add config option to support vmalloc savings"

This reverts commit f5130adb4c3abd7cbe977f7304bf6fb3ced84fc7.

Revert "mm: Update is_vmalloc_addr to account for vmalloc savings"

This reverts commit 62da64efd769329b19ca1602d5bb5c4ff564a682.

Revert "msm: Increase the kernel virtual area to include lowmem"

This reverts commit 274df3aaf5836c671823318d20ccfac962b4e411.

Revert "msm: Allow lowmem to be non contiguous and mixed."

This reverts commit 258fe02b4797883aef9823a8d1c336ada71a7516.
msm7x30: Increase ION_VIDC size

 * Needed for Netflix, or else it runs out of memory.
ARM: vfp: initialize vfp driver before cpufreq

After the below commit, cpufreq driver is initialized before vfp_init().
Commit 78727d2 ("msm: cpufreq: Initialize cpufreq driver early at boot")

Because of this, CPUs can enter idle during vfp_init().
The following deadlock situation can be occurred.

CPU2/3:
cpu_idle()
cpu_pm_enter()
read_lock(&cpu_pm_notifier_lock)

CPU0:
vfp_init()
cpu_pm_register_notifier()
write_lock_irqsave(&cpu_pm_notifier_lock, flags)

For avoid this problem, move vfp_init to rootfs_initcall.

Change-Id: Ib8a29f1ecfd19d187d2532d8a816da9519cdcd70
Signed-off-by: Bongkyu Kim <bongkyu.kim@lge.com>
ARM: vfpmodule: Move bounce stats file to seq_file and friends

In future kernels create_proc_entry() is going to be removed.
Let's modernize this code and use regular file operations and
seq_printf() to avoid experiencing compilation problems in future
kernels.

Change-Id: Ie53663e099ff72a3eec84df7c3f77e15c0e539be
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
ARM: move VFP init to an earlier boot stage

In order to use the NEON unit in the kernel, we should
initialize it a bit earlier in the boot process so NEON users
that like to do a quick benchmark at load time (like the
xor_blocks or RAID-6 code) find the NEON/VFP unit already
enabled.

Replaced late_initcall() with core_initcall().

Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
Acked-by: Nicolas Pitre <nico at linaro.org>

Signed-off-by: Paul Reioux <reioux@gmail.com>
ARM: be strict about FP exceptions in kernel mode

The support code in vfp_support_entry does not care whether the
exception that caused it to be invoked occurred in kernel mode or
in user mode. However, neither condition that could trigger this
exception (lazy restore and VFP bounce to support code) is
currently allowable in kernel mode.

In either case, print a message describing the condition before
letting the undefined instruction handler run its course and trigger
an oops.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
Acked-by: Nicolas Pitre <nico at linaro.org>
Signed-off-by: Paul Reioux <reioux@gmail.com>
ARM: add support for kernel mode NEON

In order to safely support the use of NEON instructions in
kernel mode, some precautions need to be taken:
- the userland context that may be present in the registers (even
  if the NEON/VFP is currently disabled) must be stored under the
  correct task (which may not be 'current' in the UP case),
- to avoid having to keep track of additional vfpstates for the
  kernel side, disallow the use of NEON in interrupt context
  and run with preemption disabled,
- after use, re-enable preemption and re-enable the lazy restore
  machinery by disabling the NEON/VFP unit.

This patch adds the functions kernel_neon_begin() and
kernel_neon_end() which take care of the above. It also adds
the Kconfig symbol KERNEL_MODE_NEON to enable it.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Paul Reioux <reioux@gmail.com>
ARM: crypto: add NEON accelerated XOR implementation

Add a source file xor-neon.c (which is really just the reference
C implementation passed through the GCC vectorizer) and hook it
up to the XOR framework.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
ARM: 7835/2: fix modular build of xor_blocks() with NEON enabled

Commit 0195659 introduced a NEON accelerated version of the xor_blocks()
function, but it needs the changes in this patch to allow it to be built
as a module rather than statically into the kernel.

This patch creates a separate module xor-neon.ko which exports the NEON
inner xor_blocks() functions depended upon by the regular xor.ko if it
is built with CONFIG_KERNEL_MODE_NEON=y

Reported-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: only allow kernel mode neon with AEABI

This prevents the linker erroring with:

arm-linux-ld: error: arch/arm/lib/xor-neon.o uses VFP instructions, whereas arch/arm/lib/built-in.o does not
arm-linux-ld: failed to merge target specific data of file arch/arm/lib/xor-neon.o

This is due to the non-neon files being marked as containing FPA data/
instructions (even though they do not) being mixed with files which
contain VFP, which is an incompatible floating point format.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
msm: Remove all references to pmem from audio files

PMEM is no longer supported. Remove all references to it.

Change-Id: If68c41901b8fb0b9382650c3123a68958f769761
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>