Merge tag 'v3.0.42' into cm-10.1

Conflicts resolved per Motorola 3.0.42 kernel

This is the 3.0.42 stable release

Conflicts:
	Documentation/HOWTO
	Documentation/stable_kernel_rules.txt
	Makefile
	arch/arm/kernel/head.S
	arch/arm/kernel/signal.c
	arch/arm/kernel/smp.c
	arch/arm/kernel/traps.c
	arch/arm/mm/tlb-v7.S
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
	drivers/hid/hid-multitouch.c
	drivers/hwmon/coretemp.c
	drivers/hwmon/fam15h_power.c
	drivers/md/dm-crypt.c
	drivers/mmc/core/sdio_irq.c
	drivers/net/tun.c
	drivers/net/usb/ipheth.c
	drivers/net/usb/usbnet.c
	drivers/usb/core/hub.c
	drivers/usb/core/quirks.c
	drivers/usb/host/ehci-hub.c
	drivers/usb/host/xhci-mem.c
	drivers/usb/host/xhci.h
	drivers/usb/serial/cp210x.c
	drivers/usb/serial/ftdi_sio_ids.h
	drivers/usb/serial/option.c
	drivers/usb/serial/qcserial.c
	drivers/usb/serial/ti_usb_3410_5052.c
	fs/ecryptfs/miscdev.c
	fs/namespace.c
	fs/nfs/write.c
	fs/proc/base.c
	include/asm-generic/pgtable.h
	include/drm/drm_pciids.h
	include/net/sch_generic.h
	kernel/irq/manage.c
	mm/vmalloc.c
	net/caif/caif_dev.c
	net/ipv4/fib_semantics.c
	net/wireless/util.c
	security/commoncap.c
	sound/soc/soc-dapm.c
Revert "IKHSS7-37843 : avoid Krait errata 32, fix WFE"

This reverts commit 12da8971d9465da708ad8bfea477aaeaa33d52a8.
arm: Make the WFE macro unconditional

Remove the condition argument from the WFE macro in the
spinlock code so it can support a WFE fixup needed on
certain Krait CPUs.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit 470d134db676e23982676061971a3a201f32b4a6)

Change-Id: Ic5f072ed40d3802b4d0d7f3339d2f5688cebc828
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
arm: Convert spinlocks to new inline assembly style

Refactor the inline assembly code in spinlock.h in
preparation for supporting the Krait safe WFE sequence.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit 68e1d7476e66911f9722a5dd82554e883cdb35ba)

Change-Id: I9f98c3a01fa1f0565723e7ba8e5a842a8f05e6b9
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
arm: Support the safe WFE sequence for Krait CPUs

Certain version of the Krait processor require a specific
code sequence to be executed prior to executing a WFE
instruction to permit that instruction to place the
processor into a low-power state.

Change-Id: I614f8ce24936c793c91d5c43c7a7931a04f11dda
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
arm: Don't disable interrupts during WFE fixup

Disabling interrupts during the Krait WFE fixup can result
in deadlock if a thread tries to acquire a spinlock that is
released from an interrupt context. Instead of disabling
interrupts, modify the interrupt handler to reset the fixup
condition to put the processor into a safe state in the
event that the interrupt came in during the fixup window.

CRs-Fixed: 383670
Change-Id: Id504f46d6f840dc32ca11ed2f813003143e60f2d
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit 1fd137804b489f7a0b4103d846cda13a07e26cdf)
ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+

The open-coded mutex implementation for ARMv6+ cores suffers from a
severe lack of barriers, so in the uncontended case we don't actually
protect any accesses performed during the critical section.

Furthermore, the code is largely a duplication of the ARMv6+ atomic_dec
code but optimised to remove a branch instruction, as the mutex fastpath
was previously inlined. Now that this is executed out-of-line, we can
reuse the atomic access code for the locking (in fact, we use the xchg
code as this produces shorter critical sections).

This patch uses the generic xchg based implementation for mutexes on
ARMv6+, which introduces barriers to the lock/unlock operations and also
has the benefit of removing a fair amount of inline assembly code.

Cc: <stable@vger.kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Reported-by: Shan Kang <kangshan0910@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
mutex: Place lock in contended state after fastpath_lock failure

ARM recently moved to asm-generic/mutex-xchg.h for its mutex
implementation after the previous implementation was found to be missing
some crucial memory barriers. However, this has revealed some problems
running hackbench on SMP platforms due to the way in which the
MUTEX_SPIN_ON_OWNER code operates.

The symptoms are that a bunch of hackbench tasks are left waiting on an
unlocked mutex and therefore never get woken up to claim it. This boils
down to the following sequence of events:

        Task A        Task B        Task C        Lock value
0                                                     1
1       lock()                                        0
2                     lock()                          0
3                     spin(A)                         0
4       unlock()                                      1
5                                   lock()            0
6                     cmpxchg(1,0)                    0
7                     contended()                    -1
8       lock()                                        0
9       spin(C)                                       0
10                                  unlock()          1
11      cmpxchg(1,0)                                  0
12      unlock()                                      1

At this point, the lock is unlocked, but Task B is in an uninterruptible
sleep with nobody to wake it up.

This patch fixes the problem by ensuring we put the lock into the
contended state if we fail to acquire it on the fastpath, ensuring that
any blocked waiters are woken up when the mutex is released.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Chris Mason <chris.mason@fusionio.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: <stable@vger.kernel.org>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-6e9lrw2avczr0617fzl5vqb8@git.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
ARM: 7559/1: smp: switch away from the idmap before updating init_mm.mm_count

When booting a secondary CPU, the primary CPU hands two sets of page
tables via the secondary_data struct:

	(1) swapper_pg_dir: a normal, cacheable, shared (if SMP) mapping
	    of the kernel image (i.e. the tables used by init_mm).

	(2) idmap_pgd: an uncached mapping of the .idmap.text ELF
	    section.

The idmap is generally used when enabling and disabling the MMU, which
includes early CPU boot. In this case, the secondary CPU switches to
swapper as soon as it enters C code:

	struct mm_struct *mm = &init_mm;
	unsigned int cpu = smp_processor_id();

	/*
	 * All kernel threads share the same mm context; grab a
	 * reference and switch to it.
	 */
	atomic_inc(&mm->mm_count);
	current->active_mm = mm;
	cpumask_set_cpu(cpu, mm_cpumask(mm));
	cpu_switch_mm(mm->pgd, mm);

This causes a problem on ARMv7, where the identity mapping is treated as
strongly-ordered leading to architecturally UNPREDICTABLE behaviour of
exclusive accesses, such as those used by atomic_inc.

This patch re-orders the secondary_start_kernel function so that we
switch to swapper before performing any exclusive accesses.

Cc: <stable@vger.kernel.org>
Cc: David McKay <david.mckay@st.com>
Reported-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
msm: camera: Port camera v4l2 architecture to 8x60

Add V4L2 version files for vfe31 files for use in
V4L2 8x60 solution. Also, add option to use
correct platform devices for 8x60 if V4L2 flag is turned
on.

Change-Id: Ia209c2648122c13e3b4e14d4f93dae7f45f5492e
Signed-off-by: Roja Rani Yarubandi <rojay@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/devices.h
	drivers/media/video/msm/sensors/msm_sensor.c
msm: fix mount angle for preview in external sensor.

The mount angle for external imx sensor should be
180 degrees.

Change-Id: I7198a3f1dfc308ffe714f22c9c7887b7a4801fef
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
Signed-off-by: Roja Rani Yarubandi <rojay@codeaurora.org>
msm: camera: MT9E013 v4l2 sensor driver.

This request adds board file configuration, clock configuration,
regulator setting and sensor register setting to enable MT9E013
sensor on v4l2 architecture for 8x60

Change-Id: Iefaca630815d76a5815c28052d8249dea9f06c4f
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
Signed-off-by: Roja Rani Yarubandi <rojay@codeaurora.org>
msm: camera: OV7692 v4l2 sensor driver.

Add board file configuration, clock configuration, regulator
setting and sensor register setting to enable OV7692 v4l2
sensor driver

CRs-fixed: 351530
Change-Id: Iff3d65cd388c48491391853e71fce2817f3b8c6b
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
Signed-off-by: Roja Rani Yarubandi <rojay@codeaurora.org>

Conflicts:
	drivers/media/video/msm/sensors/msm_sensor.c
Revert "Revert "msm: camera: Add camera driver support for ov5640 and ov7692""

This reverts commit 9a87ce27c28697aaa4080f27083a177aca54619e.
msm: camera: Fix for camera crash

In msm_server_control function add a check for src
and dest before calling memcpy function to avoid
kernel crash

Change-Id: I814f654c223892a21d585fef31bd6ef75254c108
CRs-Fixed: 444081
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Revert "Revert "mmc: sdio: optimized SDIO IRQ handling for single irq""

This reverts commit 59ba9b37834bd5dc86db895045d287ce598f853d.

Conflicts:
	drivers/mmc/core/sdio_irq.c
mmc: sdio: avoid spurious calls to interrupt handlers

Commit 06e8935feb ("optimized SDIO IRQ handling for single irq")
introduced some spurious calls to SDIO function interrupt handlers,
such as when the SDIO IRQ thread is started, or the safety check
performed upon a system resume.  Let's add a flag to perform the
optimization only when a real interrupt is signaled by the host
driver and we know there is no point confirming it.

Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
msm: vidc: Avoid memset of list elements in the buffer entry.

- Due to race condition between free buffer and flush output buffers,
  invalid buffer is getting accessed sometimes.
- Reset all the members in buffer entry except list elements.

Change-Id: Ia2a3bc4343fc557a6e6d7d9ad93a29a7ab3dfb81
CRs-Fixed: 411197
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
(cherry picked from commit 8105df366cf6b9f1ddbc15d561fb6a5f12540416)
Revert "IKVANQUISH-1660:Make VMWare support configurable"

This reverts commit f41304efd2ef6c2707f7c697871f5e467412769f.