--- /dev/null
+From abbotti@mev.co.uk Tue Aug 3 12:41:35 2010
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Fri, 30 Jul 2010 14:42:28 +0100
+Subject: comedi: Uncripple 8255-based DIO subdevices
+To: <stable@kernel.org>
+Cc: Ian Abbott <abbotti@mev.co.uk>
+Message-ID: <1280497348-5885-1-git-send-email-abbotti@mev.co.uk>
+
+
+(Note: upstream comedi configuration has been overhauled, so this patch
+does not apply there.)
+
+Several comedi drivers call subdev_8255_init() (declared in
+"drivers/staging/comedi/drivers/8255.h") to set up one or more DIO
+subdevices. This should be provided by the 8255.ko module, but unless
+the CONFIG_COMEDI_8255 or CONFIG_COMEDI_8255_MODULE macro is defined,
+the 8255.h header uses a dummy inline version of the function instead.
+This means the comedi devices end up with an "unused" subdevice with 0
+channels instead of a "DIO" subdevice with 24 channels!
+
+This patch provides a non-interactive COMEDI_8255 option and selects it
+whenever the COMEDI_PCI_DRIVERS or COMEDI_PCMCIA_DRIVERS options are
+selected.
+
+Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/comedi/Kconfig | 5 +++++
+ drivers/staging/comedi/drivers/Makefile | 4 +++-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/comedi/Kconfig
++++ b/drivers/staging/comedi/Kconfig
+@@ -16,6 +16,7 @@ config COMEDI_DEBUG
+ config COMEDI_PCI_DRIVERS
+ tristate "Comedi PCI drivers"
+ depends on COMEDI && PCI
++ select COMEDI_8255
+ default N
+ ---help---
+ Enable lots of comedi PCI drivers to be built
+@@ -23,6 +24,7 @@ config COMEDI_PCI_DRIVERS
+ config COMEDI_PCMCIA_DRIVERS
+ tristate "Comedi PCMCIA drivers"
+ depends on COMEDI && PCMCIA && PCCARD
++ select COMEDI_8255
+ default N
+ ---help---
+ Enable lots of comedi PCMCIA and PCCARD drivers to be built
+@@ -33,3 +35,6 @@ config COMEDI_USB_DRIVERS
+ default N
+ ---help---
+ Enable lots of comedi USB drivers to be built
++
++config COMEDI_8255
++ tristate
+--- a/drivers/staging/comedi/drivers/Makefile
++++ b/drivers/staging/comedi/drivers/Makefile
+@@ -8,8 +8,10 @@ obj-$(CONFIG_COMEDI) += comedi_test.o
+ obj-$(CONFIG_COMEDI) += comedi_parport.o
+ obj-$(CONFIG_COMEDI) += pcm_common.o
+
++# Comedi 8255 module
++obj-$(CONFIG_COMEDI_8255) += 8255.o
++
+ # Comedi PCI drivers
+-obj-$(CONFIG_COMEDI_PCI_DRIVERS) += 8255.o
+ obj-$(CONFIG_COMEDI_PCI_DRIVERS) += acl7225b.o
+ obj-$(CONFIG_COMEDI_PCI_DRIVERS) += addi_apci_035.o
+ obj-$(CONFIG_COMEDI_PCI_DRIVERS) += addi_apci_1032.o
--- /dev/null
+From de51257aa301652876ab6e8f13ea4eadbe4a3846 Mon Sep 17 00:00:00 2001
+From: Hugh Dickins <hughd@google.com>
+Date: Fri, 30 Jul 2010 10:58:26 -0700
+Subject: mm: fix ia64 crash when gcore reads gate area
+
+From: Hugh Dickins <hughd@google.com>
+
+commit de51257aa301652876ab6e8f13ea4eadbe4a3846 upstream.
+
+Debian's ia64 autobuilders have been seeing kernel freeze or reboot
+when running the gdb testsuite (Debian bug 588574): dannf bisected to
+2.6.32 62eede62dafb4a6633eae7ffbeb34c60dba5e7b1 "mm: ZERO_PAGE without
+PTE_SPECIAL"; and reproduced it with gdb's gcore on a simple target.
+
+I'd missed updating the gate_vma handling in __get_user_pages(): that
+happens to use vm_normal_page() (nowadays failing on the zero page),
+yet reported success even when it failed to get a page - boom when
+access_process_vm() tried to copy that to its intermediate buffer.
+
+Fix this, resisting cleanups: in particular, leave it for now reporting
+success when not asked to get any pages - very probably safe to change,
+but let's not risk it without testing exposure.
+
+Why did ia64 crash with 16kB pages, but succeed with 64kB pages?
+Because setup_gate() pads each 64kB of its gate area with zero pages.
+
+Reported-by: Andreas Barth <aba@not.so.argh.org>
+Bisected-by: dann frazier <dannf@debian.org>
+Signed-off-by: Hugh Dickins <hughd@google.com>
+Tested-by: dann frazier <dannf@dannf.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/memory.c | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+--- a/mm/memory.c
++++ b/mm/memory.c
+@@ -1385,10 +1385,20 @@ int __get_user_pages(struct task_struct
+ return i ? : -EFAULT;
+ }
+ if (pages) {
+- struct page *page = vm_normal_page(gate_vma, start, *pte);
++ struct page *page;
++
++ page = vm_normal_page(gate_vma, start, *pte);
++ if (!page) {
++ if (!(gup_flags & FOLL_DUMP) &&
++ is_zero_pfn(pte_pfn(*pte)))
++ page = pte_page(*pte);
++ else {
++ pte_unmap(pte);
++ return i ? : -EFAULT;
++ }
++ }
+ pages[i] = page;
+- if (page)
+- get_page(page);
++ get_page(page);
+ }
+ pte_unmap(pte);
+ if (vmas)
--- /dev/null
+From b608b283a962caaa280756bc8563016a71712acf Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Fri, 30 Jul 2010 15:31:54 -0400
+Subject: NFS: kswapd must not block in nfs_release_page
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+commit b608b283a962caaa280756bc8563016a71712acf upstream.
+
+See https://bugzilla.kernel.org/show_bug.cgi?id=16056
+
+If other processes are blocked waiting for kswapd to free up some memory so
+that they can make progress, then we cannot allow kswapd to block on those
+processes.
+
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nfs/file.c | 13 +++++++++++--
+ fs/nfs/write.c | 4 ++--
+ include/linux/nfs_fs.h | 1 +
+ 3 files changed, 14 insertions(+), 4 deletions(-)
+
+--- a/fs/nfs/file.c
++++ b/fs/nfs/file.c
+@@ -27,6 +27,7 @@
+ #include <linux/pagemap.h>
+ #include <linux/aio.h>
+ #include <linux/gfp.h>
++#include <linux/swap.h>
+
+ #include <asm/uaccess.h>
+ #include <asm/system.h>
+@@ -489,11 +490,19 @@ static void nfs_invalidate_page(struct p
+ */
+ static int nfs_release_page(struct page *page, gfp_t gfp)
+ {
++ struct address_space *mapping = page->mapping;
++
+ dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);
+
+ /* Only do I/O if gfp is a superset of GFP_KERNEL */
+- if ((gfp & GFP_KERNEL) == GFP_KERNEL)
+- nfs_wb_page(page->mapping->host, page);
++ if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL) {
++ int how = FLUSH_SYNC;
++
++ /* Don't let kswapd deadlock waiting for OOM RPC calls */
++ if (current_is_kswapd())
++ how = 0;
++ nfs_commit_inode(mapping->host, how);
++ }
+ /* If PagePrivate() is set, then the page is not freeable */
+ if (PagePrivate(page))
+ return 0;
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -1379,7 +1379,7 @@ static const struct rpc_call_ops nfs_com
+ .rpc_release = nfs_commit_release,
+ };
+
+-static int nfs_commit_inode(struct inode *inode, int how)
++int nfs_commit_inode(struct inode *inode, int how)
+ {
+ LIST_HEAD(head);
+ int may_wait = how & FLUSH_SYNC;
+@@ -1443,7 +1443,7 @@ out_mark_dirty:
+ return ret;
+ }
+ #else
+-static int nfs_commit_inode(struct inode *inode, int how)
++int nfs_commit_inode(struct inode *inode, int how)
+ {
+ return 0;
+ }
+--- a/include/linux/nfs_fs.h
++++ b/include/linux/nfs_fs.h
+@@ -479,6 +479,7 @@ extern int nfs_wb_all(struct inode *inod
+ extern int nfs_wb_page(struct inode *inode, struct page* page);
+ extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
+ #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
++extern int nfs_commit_inode(struct inode *, int);
+ extern struct nfs_write_data *nfs_commitdata_alloc(void);
+ extern void nfs_commit_free(struct nfs_write_data *wdata);
+ #endif