--- /dev/null
+From cd9f040df6ce46573760a507cb88192d05d27d86 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Sun, 18 Jul 2010 09:44:37 -0700
+Subject: drm/i915: add 'reclaimable' to i915 self-reclaimable page allocations
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit cd9f040df6ce46573760a507cb88192d05d27d86 upstream.
+
+The hibernate issues that got fixed in commit 985b823b9192 ("drm/i915:
+fix hibernation since i915 self-reclaim fixes") turn out to have been
+incomplete. Vefa Bicakci tested lots of hibernate cycles, and without
+the __GFP_RECLAIMABLE flag the system eventually fails to resume.
+
+With the flag added, Vefa can apparently hibernate forever (or until he
+gets bored running his automated scripts, whichever comes first).
+
+The reclaimable flag was there originally, and was one of the flags that
+were dropped (unintentionally) by commit 4bdadb978569 ("drm/i915:
+Selectively enable self-reclaim") that introduced all these problems,
+but I didn't want to just blindly add back all the flags in commit
+985b823b9192, and it looked like __GFP_RECLAIM wasn't necessary. It
+clearly was.
+
+I still suspect that there is some subtle reason we're missing that
+causes the problems, but __GFP_RECLAIMABLE is certainly not wrong to use
+in this context, and is what the code historically used. And we have no
+idea what the causes the corruption without it.
+
+Reported-and-tested-by: M. Vefa Bicakci <bicave@superonline.com>
+Cc: Dave Airlie <airlied@gmail.com>
+Cc: Chris Wilson <chris@chris-wilson.co.uk>
+Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/i915/i915_gem.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -2264,6 +2264,7 @@ i915_gem_object_get_pages(struct drm_gem
+ page = read_cache_page_gfp(mapping, i,
+ GFP_HIGHUSER |
+ __GFP_COLD |
++ __GFP_RECLAIMABLE |
+ gfpmask);
+ if (IS_ERR(page))
+ goto err_pages;
--- /dev/null
+From 985b823b919273fe1327d56d2196b4f92e5d0fae Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Fri, 2 Jul 2010 10:04:42 +1000
+Subject: drm/i915: fix hibernation since i915 self-reclaim fixes
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 985b823b919273fe1327d56d2196b4f92e5d0fae upstream.
+
+Since commit 4bdadb9785696439c6e2b3efe34aa76df1149c83 ("drm/i915:
+Selectively enable self-reclaim"), we've been passing GFP_MOVABLE to the
+i915 page allocator where we weren't before due to some over-eager
+removal of the page mapping gfp_flags games the code used to play.
+
+This caused hibernate on Intel hardware to result in a lot of memory
+corruptions on resume. See for example
+
+ http://bugzilla.kernel.org/show_bug.cgi?id=13811
+
+Reported-by: Evengi Golov (in bugzilla)
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Tested-by: M. Vefa Bicakci <bicave@superonline.com>
+Cc: Chris Wilson <chris@chris-wilson.co.uk>
+Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/i915/i915_gem.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -2262,7 +2262,7 @@ i915_gem_object_get_pages(struct drm_gem
+ mapping = inode->i_mapping;
+ for (i = 0; i < page_count; i++) {
+ page = read_cache_page_gfp(mapping, i,
+- mapping_gfp_mask (mapping) |
++ GFP_HIGHUSER |
+ __GFP_COLD |
+ gfpmask);
+ if (IS_ERR(page))
mm-make-the-vma-list-be-doubly-linked.patch
mm-make-the-mlock-stack-guard-page-checks-stricter.patch
mm-make-stack-guard-page-logic-use-vm_prev-pointer.patch
+drm-i915-fix-hibernation-since-i915-self-reclaim-fixes.patch
+drm-i915-add-reclaimable-to-i915-self-reclaimable-page-allocations.patch
+slab-fix-object-alignment.patch
+sunxvr500-ignore-secondary-output-pci-devices.patch
+sparc64-add-missing-id-to-parport-probing-code.patch
+sparc64-fix-rwsem-constant-bug-leading-to-hangs.patch
+sparc64-fix-atomic64_t-routine-return-values.patch
--- /dev/null
+From 1ab335d8f85792e3b107ff8237d53cf64db714df Mon Sep 17 00:00:00 2001
+From: Carsten Otte <cotte@de.ibm.com>
+Date: Fri, 6 Aug 2010 18:19:22 +0200
+Subject: slab: fix object alignment
+
+From: Carsten Otte <cotte@de.ibm.com>
+
+commit 1ab335d8f85792e3b107ff8237d53cf64db714df upstream.
+
+This patch fixes alignment of slab objects in case CONFIG_DEBUG_PAGEALLOC is
+active.
+Before this spot in kmem_cache_create, we have this situation:
+- align contains the required alignment of the object
+- cachep->obj_offset is 0 or equals align in case of CONFIG_DEBUG_SLAB
+- size equals the size of the object, or object plus trailing redzone in case
+ of CONFIG_DEBUG_SLAB
+
+This spot tries to fill one page per object if the object is in certain size
+limits, however setting obj_offset to PAGE_SIZE - size does break the object
+alignment since size may not be aligned with the required alignment.
+This patch simply adds an ALIGN(size, align) to the equation and fixes the
+object size detection accordingly.
+
+This code in drivers/s390/cio/qdio_setup_init has lead to incorrectly aligned
+slab objects (sizeof(struct qdio_q) equals 1792):
+ qdio_q_cache = kmem_cache_create("qdio_q", sizeof(struct qdio_q),
+ 256, 0, NULL);
+
+Acked-by: Christoph Lameter <cl@linux.com>
+Signed-off-by: Carsten Otte <cotte@de.ibm.com>
+Signed-off-by: Pekka Enberg <penberg@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/slab.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/mm/slab.c
++++ b/mm/slab.c
+@@ -2249,8 +2249,8 @@ kmem_cache_create (const char *name, siz
+ }
+ #if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
+ if (size >= malloc_sizes[INDEX_L3 + 1].cs_size
+- && cachep->obj_size > cache_line_size() && size < PAGE_SIZE) {
+- cachep->obj_offset += PAGE_SIZE - size;
++ && cachep->obj_size > cache_line_size() && ALIGN(size, align) < PAGE_SIZE) {
++ cachep->obj_offset += PAGE_SIZE - ALIGN(size, align);
+ size = PAGE_SIZE;
+ }
+ #endif
--- /dev/null
+From f305fbd22d54a0d9c906697c4c38945d37d6bc24 Mon Sep 17 00:00:00 2001
+From: David S. Miller <davem@davemloft.net>
+Date: Wed, 4 Aug 2010 17:30:21 -0700
+Subject: sparc64: Add missing ID to parport probing code.
+
+From: David S. Miller <davem@davemloft.net>
+
+[ Upstream commit bf8253bf5e7cfe17dd53e3f6340a45b11d9fb51c ]
+
+SunBlade-2500 has 'parallel' device node with compatible
+property "pnpALI,1533,3" so add that to the ID table.
+
+Reported-by: Mikael Pettersson <mikpe@it.uu.se>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ arch/sparc/include/asm/parport.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/sparc/include/asm/parport.h
++++ b/arch/sparc/include/asm/parport.h
+@@ -228,6 +228,10 @@ static const struct of_device_id ecpp_ma
+ .name = "parallel",
+ .compatible = "ns87317-ecpp",
+ },
++ {
++ .name = "parallel",
++ .compatible = "pnpALI,1533,3",
++ },
+ {},
+ };
+
--- /dev/null
+From e68176c823a9ed4993f7fe34cd26717bc01b35ad Mon Sep 17 00:00:00 2001
+From: David S. Miller <davem@davemloft.net>
+Date: Wed, 18 Aug 2010 14:47:23 -0700
+Subject: sparc64: Fix atomic64_t routine return values.
+
+From: David S. Miller <davem@davemloft.net>
+
+[ Upstream commits 86fa04b8742ac681d470786f55e2403ada0075b2
+ and b10f997bb0f4e5b34d447f498fb85834a40d3acb ]
+
+Should return 'long' instead of 'int'.
+
+Thanks to Dimitris Michailidis and Tony Luck.
+
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ arch/sparc/include/asm/atomic_64.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/arch/sparc/include/asm/atomic_64.h
++++ b/arch/sparc/include/asm/atomic_64.h
+@@ -20,14 +20,14 @@
+ #define atomic64_set(v, i) (((v)->counter) = i)
+
+ extern void atomic_add(int, atomic_t *);
+-extern void atomic64_add(int, atomic64_t *);
++extern void atomic64_add(long, atomic64_t *);
+ extern void atomic_sub(int, atomic_t *);
+-extern void atomic64_sub(int, atomic64_t *);
++extern void atomic64_sub(long, atomic64_t *);
+
+ extern int atomic_add_ret(int, atomic_t *);
+-extern int atomic64_add_ret(int, atomic64_t *);
++extern long atomic64_add_ret(long, atomic64_t *);
+ extern int atomic_sub_ret(int, atomic_t *);
+-extern int atomic64_sub_ret(int, atomic64_t *);
++extern long atomic64_sub_ret(long, atomic64_t *);
+
+ #define atomic_dec_return(v) atomic_sub_ret(1, v)
+ #define atomic64_dec_return(v) atomic64_sub_ret(1, v)
+@@ -91,7 +91,7 @@ static inline int atomic_add_unless(atom
+ ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
+ #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
+
+-static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
++static inline long atomic64_add_unless(atomic64_t *v, long a, long u)
+ {
+ long c, old;
+ c = atomic64_read(v);
--- /dev/null
+From 4ab3a5d96ab725c8eed154f61850104ba1be263f Mon Sep 17 00:00:00 2001
+From: David S. Miller <davem@davemloft.net>
+Date: Tue, 17 Aug 2010 17:09:53 -0700
+Subject: sparc64: Fix rwsem constant bug leading to hangs.
+
+From: David S. Miller <davem@davemloft.net>
+
+[ Upstream commit ef201bebe5afc91a2b99b45dacc8c6dd88ca9e58 ]
+
+As noticed by Linus, it is critical that some of the
+rwsem constants be signed. Yet, hex constants are
+unsigned unless explicitly casted or negated.
+
+The most critical one is RWSEM_WAITING_BIAS.
+
+This bug was exacerbated by commit
+424acaaeb3a3932d64a9b4bd59df6cf72c22d8f3 ("rwsem: wake queued readers
+when writer blocks on active read lock")
+
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ arch/sparc/include/asm/rwsem-const.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/sparc/include/asm/rwsem-const.h
++++ b/arch/sparc/include/asm/rwsem-const.h
+@@ -5,7 +5,7 @@
+ #define RWSEM_UNLOCKED_VALUE 0x00000000
+ #define RWSEM_ACTIVE_BIAS 0x00000001
+ #define RWSEM_ACTIVE_MASK 0x0000ffff
+-#define RWSEM_WAITING_BIAS 0xffff0000
++#define RWSEM_WAITING_BIAS (-0x00010000)
+ #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
+ #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
+
--- /dev/null
+From ff67b6b75751461970363f1266a5db8088ed4977 Mon Sep 17 00:00:00 2001
+From: David S. Miller <davem@davemloft.net>
+Date: Sun, 4 Apr 2010 01:12:50 -0700
+Subject: sunxvr500: Ignore secondary output PCI devices.
+
+From: David S. Miller <davem@davemloft.net>
+
+[ Upstream commit bdd32ce95f79fb5cc964cd789d7ae4500bba7c6f ]
+
+These just represent the secondary and further heads attached to the
+card, and they have different sets of PCI bar registers to map.
+
+So don't try to drive them in the main driver.
+
+Reported-by: Frans van Berckel <fberckel@xs4all.nl>
+Tested-by: Frans van Berckel <fberckel@xs4all.nl>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/video/sunxvr500.c | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+--- a/drivers/video/sunxvr500.c
++++ b/drivers/video/sunxvr500.c
+@@ -242,11 +242,27 @@ static int __devinit e3d_set_fbinfo(stru
+ static int __devinit e3d_pci_register(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
+ {
++ struct device_node *of_node;
++ const char *device_type;
+ struct fb_info *info;
+ struct e3d_info *ep;
+ unsigned int line_length;
+ int err;
+
++ of_node = pci_device_to_OF_node(pdev);
++ if (!of_node) {
++ printk(KERN_ERR "e3d: Cannot find OF node of %s\n",
++ pci_name(pdev));
++ return -ENODEV;
++ }
++
++ device_type = of_get_property(of_node, "device_type", NULL);
++ if (!device_type) {
++ printk(KERN_INFO "e3d: Ignoring secondary output device "
++ "at %s\n", pci_name(pdev));
++ return -ENODEV;
++ }
++
+ err = pci_enable_device(pdev);
+ if (err < 0) {
+ printk(KERN_ERR "e3d: Cannot enable PCI device %s\n",
+@@ -265,13 +281,7 @@ static int __devinit e3d_pci_register(st
+ ep->info = info;
+ ep->pdev = pdev;
+ spin_lock_init(&ep->lock);
+- ep->of_node = pci_device_to_OF_node(pdev);
+- if (!ep->of_node) {
+- printk(KERN_ERR "e3d: Cannot find OF node of %s\n",
+- pci_name(pdev));
+- err = -ENODEV;
+- goto err_release_fb;
+- }
++ ep->of_node = of_node;
+
+ /* Read the PCI base register of the frame buffer, which we
+ * need in order to interpret the RAMDAC_VID_*FB* values in