sched: Generalize sleep inside spinlock detection

The sleeping inside spinlock detection is actually used
for more general sleeping inside atomic sections
debugging: preemption disabled, rcu read side critical
sections, interrupts, interrupt disabled, etc...

Change the name of the config and its help section to
reflect its more general role.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>

Conflicts:
	lib/Kconfig.debug
Fix Display Freeze
Revert "Add test fixes for DSS freeze"

This reverts commit 631643f428097068c5050c815720d1ca6c05e653.
Revert "OMAP3 : DVFS: Defined round_rate and set_rate function for l3_ick clock"

This reverts commit 33da279a52ae19ccffe614fb9809634bfb560cd7.
ARM: 7668/1: fix memset-related crashes caused by recent GCC (4.7.2) optimizations

Recent GCC versions (e.g. GCC-4.7.2) perform optimizations based on
assumptions about the implementation of memset and similar functions.
The current ARM optimized memset code does not return the value of
its first argument, as is usually expected from standard implementations.

For instance in the following function:

void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
{
	memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter));
	waiter->magic = waiter;
	INIT_LIST_HEAD(&waiter->list);
}

compiled as:

800554d0 <debug_mutex_lock_common>:
800554d0:       e92d4008        push    {r3, lr}
800554d4:       e1a00001        mov     r0, r1
800554d8:       e3a02010        mov     r2, #16 ; 0x10
800554dc:       e3a01011        mov     r1, #17 ; 0x11
800554e0:       eb04426e        bl      80165ea0 <memset>
800554e4:       e1a03000        mov     r3, r0
800554e8:       e583000c        str     r0, [r3, #12]
800554ec:       e5830000        str     r0, [r3]
800554f0:       e5830004        str     r0, [r3, #4]
800554f4:       e8bd8008        pop     {r3, pc}

GCC assumes memset returns the value of pointer 'waiter' in register r0; causing
register/memory corruptions.

This patch fixes the return value of the assembly version of memset.
It adds a 'mov' instruction and merges an additional load+store into
existing load/store instructions.
For ease of review, here is a breakdown of the patch into 4 simple steps:

Step 1
======
Perform the following substitutions:
ip -> r8, then
r0 -> ip,
and insert 'mov ip, r0' as the first statement of the function.
At this point, we have a memset() implementation returning the proper result,
but corrupting r8 on some paths (the ones that were using ip).

Step 2
======
Make sure r8 is saved and restored when (! CALGN(1)+0) == 1:

save r8:
-       str     lr, [sp, #-4]!
+       stmfd   sp!, {r8, lr}

and restore r8 on both exit paths:
-       ldmeqfd sp!, {pc}               @ Now <64 bytes to go.
+       ldmeqfd sp!, {r8, pc}           @ Now <64 bytes to go.
(...)
        tst     r2, #16
        stmneia ip!, {r1, r3, r8, lr}
-       ldr     lr, [sp], #4
+       ldmfd   sp!, {r8, lr}

Step 3
======
Make sure r8 is saved and restored when (! CALGN(1)+0) == 0:

save r8:
-       stmfd   sp!, {r4-r7, lr}
+       stmfd   sp!, {r4-r8, lr}

and restore r8 on both exit paths:
        bgt     3b
-       ldmeqfd sp!, {r4-r7, pc}
+       ldmeqfd sp!, {r4-r8, pc}
(...)
        tst     r2, #16
        stmneia ip!, {r4-r7}
-       ldmfd   sp!, {r4-r7, lr}
+       ldmfd   sp!, {r4-r8, lr}

Step 4
======
Rewrite register list "r4-r7, r8" as "r4-r8".

Signed-off-by: Ivan Djelic <ivan.djelic@parrot.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: 7670/1: fix the memset fix

Commit 455bd4c430b0 ("ARM: 7668/1: fix memset-related crashes caused by
recent GCC (4.7.2) optimizations") attempted to fix a compliance issue
with the memset return value.  However the memset itself became broken
by that patch for misaligned pointers.

This fixes the above by branching over the entry code from the
misaligned fixup code to avoid reloading the original pointer.

Also, because the function entry alignment is wrong in the Thumb mode
compilation, that fixup code is moved to the end.

While at it, the entry instructions are slightly reworked to help dual
issue pipelines.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
fix gcc 4.8
backport OSS driver, to use moto lib
switch to OSS
Revert "Disable map2430_musb_set_vbus, fix boot without usb"

This reverts commit 70ae794bf09616a8d61fcc20ad79c1349eac0ee5.
Revert "usb: musb: omap2430: Detect incorrect USB transceiver event notifications."

This reverts commit 08adcbd9731b5b7d6d93cbd57c9769effc75d8c5.
Revert "Revert "Disable map2430_musb_set_vbus, fix boot without usb""

This reverts commit 49a01238314c8991dd8b84ec60c67245429f4fe4.
Merge back changes from ti upstream.

Conflicts:
	Makefile
	arch/arm/mach-omap2/Kconfig
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-44xx-tablet.c
	arch/arm/mach-omap2/board-omap4panda.c
	arch/arm/mach-omap2/devices.c
	arch/arm/mach-omap2/dvfs.c
	arch/arm/mach-omap2/omap2plus-cpufreq.c
	arch/arm/mach-omap2/omap_ion.c
	arch/arm/mach-omap2/omap_ion.h
	arch/arm/mach-omap2/pm44xx.c
	arch/arm/mach-omap2/sleep44xx.S
	arch/arm/mach-omap2/smartreflex-class1p5.c
	arch/arm/mach-omap2/smartreflex.c
	arch/arm/mach-omap2/usb-host.c
	arch/arm/mach-omap2/vp.c
	arch/arm/plat-omap/include/plat/common.h
	arch/arm/plat-omap/include/plat/gpu.h
	arch/arm/plat-omap/include/plat/usb.h
	arch/arm/plat-omap/iommu.c
	arch/arm/plat-omap/mailbox.c
	arch/arm/plat-omap/omap-pm-helper.c
	arch/ia64/include/asm/futex.h
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
	drivers/cpufreq/cpufreq_interactive.c
	drivers/gpu/drm/i915/intel_lvds.c
	drivers/gpu/drm/radeon/radeon_atombios.c
	drivers/gpu/drm/radeon/radeon_irq_kms.c
	drivers/gpu/ion/ion.c
	drivers/gpu/pvr/Kconfig
	drivers/gpu/pvr/Makefile
	drivers/gpu/pvr/buffer_manager.c
	drivers/gpu/pvr/mm.c
	drivers/gpu/pvr/module.c
	drivers/gpu/pvr/omap3/sysconfig.c
	drivers/gpu/pvr/omap3/syslocal.h
	drivers/gpu/pvr/omap3/sysutils_linux_wqueue_compat.c
	drivers/gpu/pvr/pvrversion.h
	drivers/gpu/pvr/sgx/sgxinit.c
	drivers/hwmon/fam15h_power.c
	drivers/i2c/busses/i2c-omap.c
	drivers/input/touchscreen/Kconfig
	drivers/media/video/tiler/tiler-main.c
	drivers/misc/Kconfig
	drivers/misc/Makefile
	drivers/misc/ti-st/Kconfig
	drivers/misc/ti-st/Makefile
	drivers/misc/ti-st/st_kim.c
	drivers/mmc/core/sdio.c
	drivers/net/usb/ipheth.c
	drivers/net/usb/usbnet.c
	drivers/power/twl6030_bci_battery.c
	drivers/staging/Kconfig
	drivers/staging/Makefile
	drivers/usb/class/cdc-wdm.c
	drivers/usb/host/ehci-omap.c
	drivers/usb/host/xhci-mem.c
	drivers/usb/host/xhci.h
	drivers/usb/musb/musb_core.c
	drivers/usb/serial/ftdi_sio.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
	drivers/usb/serial/ti_usb_3410_5052.h
	drivers/video/omap2/displays/Kconfig
	drivers/video/omap2/dss/Makefile
	drivers/video/omap2/dss/dispc.c
	drivers/video/omap2/dss/dsi.c
	drivers/video/omap2/dss/manager.c
	drivers/video/omap2/dsscomp/gralloc.c
	drivers/video/omap2/dsscomp/queue.c
	drivers/video/omap2/omapfb/omapfb-main.c
	drivers/video/omap2/omapfb/omapfb.h
	drivers/video/omap2/omaplfb/omaplfb_displayclass.c
	fs/proc/base.c
	fs/splice.c
	include/asm-generic/pgtable.h
	include/linux/input/touch_platform.h
	include/linux/ion.h
	include/net/sch_generic.h
	include/trace/events/cpufreq_interactive.h
	include/video/dsscomp.h
	include/video/omapdss.h
	kernel/futex.c
	net/ipv4/route.c
	net/ipv4/syncookies.c
	net/ipv4/tcp_ipv4.c
	net/netfilter/xt_qtaguid.c
	net/netfilter/xt_qtaguid_internal.h
	net/netfilter/xt_qtaguid_print.c
	net/wireless/util.c
	security/smc/s_version.h
	security/smc/tf_crypto_digest.c

Change-Id: I18fa0721ee1d1b6751100486ed3caa8c021a6537
Merge branch 'p-android-omap3-3.0' of https://github.com/Quarx2k/jordan-kernel into p-android-omap3-3.0