backports: simplify space regexp for src_line

The regexp doesn't require the extra brackets.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: fix wq_name_list initialization

As noted by Johannes this wasn't being initialized
without this.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: fix DMI_EXACT_MATCH() backport

DMI_EXACT_MATCH uses struct dmi_strmatch's new member exact_match:

	@@ -456,7 +456,8 @@ enum dmi_field {
	 };

	 struct dmi_strmatch {
	-       unsigned char slot;
	+       unsigned char slot:7;
	+       unsigned char exact_match:1;
		char substr[79];
	 };

Prior to 5017b285 we only had slot so to use DMI_EXACT_MATCH with its
intent we'd have to do something like slot |= 1 if its called. This
however assumes though that older code has the sanity check as changed
in 5017b285 on drivers/firmware/dmi_scan.c. dmi_scan.o gets linked
with CONFIG_DMI. At least for x86 that gets objects sprinkled on
arch/x86/, but more importantly CONFIG_DMI is bool. I've argued how I
envision us being able to backport core components before (see
0935deab for the hint) but as it is right now we can't. We only
backport things we can throw in as modular.

Since we only backport modularly for now we can't backport DMI_EXACT_MATCH()
and as such all entries defined with DMI_EXACT_MATCH() should be ifdef'd
out for usage only on kernels >= v3.11 but to help reduce code churn we
can also just force such entries to be ignored for now. We therefore
backport DMI_EXACT_MATCH() for now to match something that will not be
found.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backport: disable unused automatic backports

When an automatic backport isn't included due to not
being used (see commit 6e0475b599217eceb8e01a1e572c,
"gentree: add automatic backports only if needed"),
selecting BACKPORT_USERSEL_BUILD_ALL will make the
build fail. Avoid this by disabling such symbols in
the Kconfig.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: copy over mfd/max8998.h mfd/max8998-private.h

This is required by CONFIG_REGULATOR_MAX8998
which builds drivers/regulator/max8998.c as of
next-20130703.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: backport of_get_child_by_name() support

This was added via 9c19761a. While at it clean up the backported
header a bit to make backporting more OF stuff more manageable.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 9c19761a
v3.7-rc1~123^2~4

commit 9c19761a7ecdc86abb2fba0feb81e8952eccc1f1
Author: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Date:   Tue Sep 18 08:10:28 2012 +0100

    dt: introduce of_get_child_by_name to get child node by name

    This patch introduces of_get_child_by_name function to get a child node
    by its name in a given parent node.

    Without this patch each driver code has to iterate the parent and do
    a string compare, However having of_get_child_by_name libary function would
    avoid code duplication, errors and is more convenient.

    Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
    Signed-off-by: Rob Herring <rob.herring@calxeda.com>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: enable kconfig language on dependencies file

Certain complex features that are backported may be be
limitted to a certain target build configuration. An example
can be if a backported feature is not yet backported with
support for lockdep. In order to avoid build failures with
these types of restrictions allow for specifying build
configuration dependencies on backported upstream kconfig
symbols other than just kernel versioning contstraints.

This adds support for specifying upstream kconfig constaints
other than kernel versioning by adding kconfig language
extensions on the dependencies file. This will update the
copied over upstream Kconfig file for the symbol specified
with the kconfig constraints specified.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: backport ww_mutex support

This backports the kernel's wound/wait style locks 040a0a371,
using the linux-stable v3.11-rc2 as a base for development.
Given the complexity to support debugging mutexes this backport
implementation is simplified by only making this feature availabe
if you to have DEBUG_MUTEXES and DEBUG_LOCK_ALLOC disabled.

Given that ww mutex is required for DRM this also means we must
update the kconfig for DRM and require you to also not be able to build
DRM if you have either of these options enabled. Support for
DEBUG_MUTEXES and DEBUG_LOCK_ALLOC can be added later by anyone
daring. This uses the new dependencies file kconfig language
extension to specify the backport feature build restrictions
for DRM.

Part of the ww mutex addition to the kernel required modifying
the fast path mutex locking scheme by requiring you to deal
with the slow path alternatives on your own (refer to a41b56ef).
The reason for this change was that the mutex fastpath implementation
assumed your slowpath alternative can only be passed one argument
and the addition of ww mutexes requires dealing with the slow
path with a context passed.

It'd be painful to backport all asm for an optimized fastpath
implementation so we penalize the backport ww mutex fast path
by using the generic atomic_dec_return().

To backport a clean our own mutex_lock_common() with the least
amount of changes against upstream commits 2bd2c92c and 41fcb9f2
also needed to be backported. Commit 2bd2c92c dealt with adding
support for queue mutex spinners with an MCS lock, since this
cannot be backported for older kernels we provide empty inlines.
Commit 41fcb9f2 just removed SCHED_FEAT_OWNER_SPIN as it was an
early hack, the only thing required to backport this commit was
to provide an alternative declaration for mutex_spin_on_owner()
as it was declared non-inline for older kernels.

Finally c5491ea7 required backporting schedule_preempt_disabled()
as well but that just consisted of carrying over the original
implementation. Since its not exported we need to reimplement
it to make it available to our internal core ww mutex port.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 040a0a371
v3.11-rc1~147^2~5

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains a41b56ef
v3.11-rc1~147^2~6

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 2bd2c92c
v3.10-rc1~200^2~3

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 41fcb9f2
v3.10-rc1~200^2~5

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains c5491ea7
v3.4-rc1~3^2~27

commit 040a0a37100563754bb1fee6ff6427420bcfa609
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Jun 24 10:30:04 2013 +0200

    mutex: Add support for wound/wait style locks

    Wound/wait mutexes are used when other multiple lock
    acquisitions of a similar type can be done in an arbitrary
    order. The deadlock handling used here is called wait/wound in
    the RDBMS literature: The older tasks waits until it can acquire
    the contended lock. The younger tasks needs to back off and drop
    all the locks it is currently holding, i.e. the younger task is
    wounded.

    For full documentation please read Documentation/ww-mutex-design.txt.

    References: https://lwn.net/Articles/548909/
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Acked-by: Rob Clark <robdclark@gmail.com>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: dri-devel@lists.freedesktop.org
    Cc: linaro-mm-sig@lists.linaro.org
    Cc: rostedt@goodmis.org
    Cc: daniel@ffwll.ch
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Link: http://lkml.kernel.org/r/51C8038C.9000106@canonical.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

commit a41b56efa70e060f650aeb54740aaf52044a1ead
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Thu Jun 20 13:31:05 2013 +0200

    arch: Make __mutex_fastpath_lock_retval return whether fastpath succeeded or not

    This will allow me to call functions that have multiple
    arguments if fastpath fails. This is required to support ticket
    mutexes, because they need to be able to pass an extra argument
    to the fail function.

    Originally I duplicated the functions, by adding
    __mutex_fastpath_lock_retval_arg. This ended up being just a
    duplication of the existing function, so a way to test if
    fastpath was called ended up being better.

    This also cleaned up the reservation mutex patch some by being
    able to call an atomic_set instead of atomic_xchg, and making it
    easier to detect if the wrong unlock function was previously
    used.

    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: dri-devel@lists.freedesktop.org
    Cc: linaro-mm-sig@lists.linaro.org
    Cc: robclark@gmail.com
    Cc: rostedt@goodmis.org
    Cc: daniel@ffwll.ch
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Link: http://lkml.kernel.org/r/20130620113105.4001.83929.stgit@patser
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

commit 2bd2c92cf07cc4a373bf316c75b78ac465fefd35
Author: Waiman Long <Waiman.Long@hp.com>
Date:   Wed Apr 17 15:23:13 2013 -0400

    mutex: Queue mutex spinners with MCS lock to reduce cacheline contention

    <-- snip -->

commit 41fcb9f230bf773656d1768b73000ef720bf00c3
Author: Waiman Long <Waiman.Long@hp.com>
Date:   Wed Apr 17 15:23:11 2013 -0400

    mutex: Move mutex spinning code from sched/core.c back to mutex.c

    <-- snip -->

commit c5491ea779793f977d282754db478157cc409d82
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Mon Mar 21 12:09:35 2011 +0100

    sched/rt: Add schedule_preempt_disabled()

    <-- snip -->

Cc: maarten.lankhorst@canonical.com
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: rostedt@goodmis.org
Cc: daniel@ffwll.ch
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: backport cross-device reservation support

This backports cross-device reservation support.
Given that this feature is built around the
CONFIG_DMA_SHARED_BUFFER and given that some older kernels
will have DMA_SHARED_BUFFER without cross device reservation
support we can't use the c-file and h-file backports Kconfig
trick to automatically backport this feature from the
target git tree.

commit 786d7257e537da0674c02e16e3b30a44665d1cee
Author: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Date:   Thu Jun 27 13:48:16 2013 +0200

    reservation: cross-device reservation support, v4

    This adds support for a generic reservations framework that can be
    hooked up to ttm and dma-buf and allows easy sharing of reservations
    across devices.

    The idea is that a dma-buf and ttm object both will get a pointer
    to a struct reservation_object, which has to be reserved before
    anything is done with the contents of the dma-buf.

    Changes since v1:
     - Fix locking issue in ticket_reserve, which could cause
       mutex_unlock
       to be called too many times.
    Changes since v2:
     - All fence related calls and members have been taken out for now,
       what's left is the bare minimum to be useful for ttm locking conversion.
    Changes since v3:
     - Removed helper functions too. The documentation has an example
       implementation for locking. With the move to ww_mutex there is no
       need to have much logic any more.

    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Reviewed-by: Jerome Glisse <jglisse@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

Cc: maarten.lankhorst@canonical.com
Cc: jglisse@redhat.com
Cc: airlied@redhat.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: refresh patches for next-20130703

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.79              [  OK  ]
18  3.1.10              [  OK  ]
19  3.10-rc1            [  OK  ]
20  3.2.45              [  OK  ]
21  3.3.8               [  OK  ]
22  3.4.46              [  OK  ]
23  3.5.7               [  OK  ]
24  3.6.11              [  OK  ]
25  3.7.10              [  OK  ]
26  3.8.13              [  OK  ]
27  3.9.3               [  OK  ]

real    32m59.877s
user    880m31.524s
sys     124m11.996s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: fix patches for next-20130709

A hunk context was off for alx.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: copy over s2mps11.h

This is required by s2mps11 as of at least next-20130709.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: refresh patches for next-20130709

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backports: refresh patches for next-20130712

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.79              [  OK  ]
18  3.1.10              [  OK  ]
19  3.10-rc1            [  OK  ]
20  3.2.45              [  OK  ]
21  3.3.8               [  OK  ]
22  3.4.46              [  OK  ]
23  3.5.7               [  OK  ]
24  3.6.11              [  OK  ]
25  3.7.10              [  OK  ]
26  3.8.13              [  OK  ]
27  3.9.3               [  OK  ]

real    34m34.417s
user    933m25.264s
sys     129m41.580s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>