--- /dev/null
+From 2167e2399dc5e69c62db56d933e9c8cbe107620a Mon Sep 17 00:00:00 2001
+From: Bjørn Mork <bjorn@mork.no>
+Date: Tue, 3 Dec 2013 12:14:32 +0100
+Subject: cpufreq: fix garbage kobjects on errors during suspend/resume
+
+From: Bjørn Mork <bjorn@mork.no>
+
+commit 2167e2399dc5e69c62db56d933e9c8cbe107620a upstream.
+
+This is effectively a revert of commit 5302c3fb2e62 ("cpufreq: Perform
+light-weight init/teardown during suspend/resume"), which enabled
+suspend/resume optimizations leaving the sysfs files in place.
+
+Errors during suspend/resume are not handled properly, leaving
+dead sysfs attributes in case of failures. There are are number of
+functions with special code for the "frozen" case, and all these
+need to also have special error handling.
+
+The problem is easy to demonstrate by making cpufreq_driver->init()
+or cpufreq_driver->get() fail during resume.
+
+The code is too complex for a simple fix, with split code paths
+in multiple blocks within a number of functions. It is therefore
+best to revert the patch enabling this code until the error handling
+is in place.
+
+Examples of problems resulting from resume errors:
+
+WARNING: CPU: 0 PID: 6055 at fs/sysfs/file.c:343 sysfs_open_file+0x77/0x212()
+missing sysfs attribute operations for kobject: (null)
+Modules linked in: [stripped as irrelevant]
+CPU: 0 PID: 6055 Comm: grep Tainted: G D 3.13.0-rc2 #153
+Hardware name: LENOVO 2776LEG/2776LEG, BIOS 6EET55WW (3.15 ) 12/19/2011
+ 0000000000000009 ffff8802327ebb78 ffffffff81380b0e 0000000000000006
+ ffff8802327ebbc8 ffff8802327ebbb8 ffffffff81038635 0000000000000000
+ ffffffff811823c7 ffff88021a19e688 ffff88021a19e688 ffff8802302f9310
+Call Trace:
+ [<ffffffff81380b0e>] dump_stack+0x55/0x76
+ [<ffffffff81038635>] warn_slowpath_common+0x7c/0x96
+ [<ffffffff811823c7>] ? sysfs_open_file+0x77/0x212
+ [<ffffffff810386e3>] warn_slowpath_fmt+0x41/0x43
+ [<ffffffff81182dec>] ? sysfs_get_active+0x6b/0x82
+ [<ffffffff81182382>] ? sysfs_open_file+0x32/0x212
+ [<ffffffff811823c7>] sysfs_open_file+0x77/0x212
+ [<ffffffff81182350>] ? sysfs_schedule_callback+0x1ac/0x1ac
+ [<ffffffff81122562>] do_dentry_open+0x17c/0x257
+ [<ffffffff8112267e>] finish_open+0x41/0x4f
+ [<ffffffff81130225>] do_last+0x80c/0x9ba
+ [<ffffffff8112dbbd>] ? inode_permission+0x40/0x42
+ [<ffffffff81130606>] path_openat+0x233/0x4a1
+ [<ffffffff81130b7e>] do_filp_open+0x35/0x85
+ [<ffffffff8113b787>] ? __alloc_fd+0x172/0x184
+ [<ffffffff811232ea>] do_sys_open+0x6b/0xfa
+ [<ffffffff811233a7>] SyS_openat+0xf/0x11
+ [<ffffffff8138c812>] system_call_fastpath+0x16/0x1b
+
+The failure to restore cpufreq devices on cancelled hibernation is
+not a new bug. It is caused by the ACPI _PPC call failing unless the
+hibernate is completed. This makes the acpi_cpufreq driver fail its
+init.
+
+Previously, the cpufreq device could be restored by offlining the
+cpu temporarily. And as a complete hibernation cycle would do this,
+it would be automatically restored most of the time. But after
+commit 5302c3fb2e62 the leftover sysfs attributes will block any
+device add action. Therefore offlining and onlining CPU 1 will no
+longer restore the cpufreq object, and a complete suspend/resume
+cycle will replace it with garbage.
+
+Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
+Signed-off-by: Bjørn Mork <bjorn@mork.no>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/cpufreq.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/cpufreq/cpufreq.c
++++ b/drivers/cpufreq/cpufreq.c
+@@ -2044,9 +2044,6 @@ static int cpufreq_cpu_callback(struct n
+ dev = get_cpu_device(cpu);
+ if (dev) {
+
+- if (action & CPU_TASKS_FROZEN)
+- frozen = true;
+-
+ switch (action & ~CPU_TASKS_FROZEN) {
+ case CPU_ONLINE:
+ __cpufreq_add_dev(dev, NULL, frozen);
--- /dev/null
+From 813e8e3d6aaa0b511126cce15c16a931afffe768 Mon Sep 17 00:00:00 2001
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Tue, 3 Dec 2013 10:59:58 -0500
+Subject: cpuidle: Check for dev before deregistering it.
+
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+
+commit 813e8e3d6aaa0b511126cce15c16a931afffe768 upstream.
+
+If not, we could end up in the unfortunate situation where
+we dereference a NULL pointer b/c we have cpuidle disabled.
+
+This is the case when booting under Xen (which uses the
+ACPI P/C states but disables the CPU idle driver) - and can
+be easily reproduced when booting with cpuidle.off=1.
+
+BUG: unable to handle kernel NULL pointer dereference at (null)
+IP: [<ffffffff8156db4a>] cpuidle_unregister_device+0x2a/0x90
+.. snip..
+Call Trace:
+ [<ffffffff813b15b4>] acpi_processor_power_exit+0x3c/0x5c
+ [<ffffffff813af0a9>] acpi_processor_stop+0x61/0xb6
+ [<ffffffff814215bf>] __device_release_driver+0fffff81421653>] device_release_driver+0x23/0x30
+ [<ffffffff81420ed8>] bus_remove_device+0x108/0x180
+ [<ffffffff8141d9d9>] device_del+0x129/0x1c0
+ [<ffffffff813cb4b0>] ? unregister_xenbus_watch+0x1f0/0x1f0
+ [<ffffffff8141da8e>] device_unregister+0x1e/0x60
+ [<ffffffff814243e9>] unregister_cpu+0x39/0x60
+ [<ffffffff81019e03>] arch_unregister_cpu+0x23/0x30
+ [<ffffffff813c3c51>] handle_vcpu_hotplug_event+0xc1/0xe0
+ [<ffffffff813cb4f5>] xenwatch_thread+0x45/0x120
+ [<ffffffff810af010>] ? abort_exclusive_wait+0xb0/0xb0
+ [<ffffffff8108ec42>] kthread+0xd2/0xf0
+ [<ffffffff8108eb70>] ? kthread_create_on_node+0x180/0x180
+ [<ffffffff816ce17c>] ret_from_fork+0x7c/0xb0
+ [<ffffffff8108eb70>] ? kthread_create_on_node+0x180/0x180
+
+This problem also appears in 3.12 and could be a candidate for backport.
+
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpuidle/cpuidle.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/cpuidle/cpuidle.c
++++ b/drivers/cpuidle/cpuidle.c
+@@ -448,7 +448,7 @@ EXPORT_SYMBOL_GPL(cpuidle_register_devic
+ */
+ void cpuidle_unregister_device(struct cpuidle_device *dev)
+ {
+- if (dev->registered == 0)
++ if (!dev || dev->registered == 0)
+ return;
+
+ cpuidle_pause_and_lock();
--- /dev/null
+From ac01810c9d2814238f08a227062e66a35a0e1ea2 Mon Sep 17 00:00:00 2001
+From: Laxman Dewangan <ldewangan@nvidia.com>
+Date: Mon, 25 Nov 2013 19:39:47 +0530
+Subject: irq: Enable all irqs unconditionally in irq_resume
+
+From: Laxman Dewangan <ldewangan@nvidia.com>
+
+commit ac01810c9d2814238f08a227062e66a35a0e1ea2 upstream.
+
+When the system enters suspend, it disables all interrupts in
+suspend_device_irqs(), including the interrupts marked EARLY_RESUME.
+
+On the resume side things are different. The EARLY_RESUME interrupts
+are reenabled in sys_core_ops->resume and the non EARLY_RESUME
+interrupts are reenabled in the normal system resume path.
+
+When suspend_noirq() failed or suspend is aborted for any other
+reason, we might omit the resume side call to sys_core_ops->resume()
+and therefor the interrupts marked EARLY_RESUME are not reenabled and
+stay disabled forever.
+
+To solve this, enable all irqs unconditionally in irq_resume()
+regardless whether interrupts marked EARLY_RESUMEhave been already
+enabled or not.
+
+This might try to reenable already enabled interrupts in the non
+failure case, but the only affected platform is XEN and it has been
+confirmed that it does not cause any side effects.
+
+[ tglx: Massaged changelog. ]
+
+Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
+Acked-by-and-tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Acked-by: Heiko Stuebner <heiko@sntech.de>
+Reviewed-by: Pavel Machek <pavel@ucw.cz>
+Cc: <ian.campbell@citrix.com>
+Cc: <rjw@rjwysocki.net>
+Cc: <len.brown@intel.com>
+Cc: <gregkh@linuxfoundation.org>
+Link: http://lkml.kernel.org/r/1385388587-16442-1-git-send-email-ldewangan@nvidia.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/irq/pm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/irq/pm.c
++++ b/kernel/irq/pm.c
+@@ -50,7 +50,7 @@ static void resume_irqs(bool want_early)
+ bool is_early = desc->action &&
+ desc->action->flags & IRQF_EARLY_RESUME;
+
+- if (is_early != want_early)
++ if (!is_early && want_early)
+ continue;
+
+ raw_spin_lock_irqsave(&desc->lock, flags);
--- /dev/null
+From d3f7d56a7a4671d395e8af87071068a195257bf6 Mon Sep 17 00:00:00 2001
+From: Shawn Landden <shawn@churchofgit.com>
+Date: Sun, 24 Nov 2013 22:36:28 -0800
+Subject: net: update consumers of MSG_MORE to recognize MSG_SENDPAGE_NOTLAST
+
+From: Shawn Landden <shawn@churchofgit.com>
+
+commit d3f7d56a7a4671d395e8af87071068a195257bf6 upstream.
+
+Commit 35f9c09fe (tcp: tcp_sendpages() should call tcp_push() once)
+added an internal flag MSG_SENDPAGE_NOTLAST, similar to
+MSG_MORE.
+
+algif_hash, algif_skcipher, and udp used MSG_MORE from tcp_sendpages()
+and need to see the new flag as identical to MSG_MORE.
+
+This fixes sendfile() on AF_ALG.
+
+v3: also fix udp
+
+Cc: Tom Herbert <therbert@google.com>
+Cc: Eric Dumazet <eric.dumazet@gmail.com>
+Cc: David S. Miller <davem@davemloft.net>
+Reported-and-tested-by: Shawn Landden <shawnlandden@gmail.com>
+Original-patch: Richard Weinberger <richard@nod.at>
+Signed-off-by: Shawn Landden <shawn@churchofgit.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ crypto/algif_hash.c | 3 +++
+ crypto/algif_skcipher.c | 3 +++
+ net/ipv4/udp.c | 3 +++
+ 3 files changed, 9 insertions(+)
+
+--- a/crypto/algif_hash.c
++++ b/crypto/algif_hash.c
+@@ -117,6 +117,9 @@ static ssize_t hash_sendpage(struct sock
+ if (flags & MSG_SENDPAGE_NOTLAST)
+ flags |= MSG_MORE;
+
++ if (flags & MSG_SENDPAGE_NOTLAST)
++ flags |= MSG_MORE;
++
+ lock_sock(sk);
+ sg_init_table(ctx->sgl.sg, 1);
+ sg_set_page(ctx->sgl.sg, page, size, offset);
+--- a/crypto/algif_skcipher.c
++++ b/crypto/algif_skcipher.c
+@@ -381,6 +381,9 @@ static ssize_t skcipher_sendpage(struct
+ if (flags & MSG_SENDPAGE_NOTLAST)
+ flags |= MSG_MORE;
+
++ if (flags & MSG_SENDPAGE_NOTLAST)
++ flags |= MSG_MORE;
++
+ lock_sock(sk);
+ if (!ctx->more && ctx->used)
+ goto unlock;
+--- a/net/ipv4/udp.c
++++ b/net/ipv4/udp.c
+@@ -1075,6 +1075,9 @@ int udp_sendpage(struct sock *sk, struct
+ if (flags & MSG_SENDPAGE_NOTLAST)
+ flags |= MSG_MORE;
+
++ if (flags & MSG_SENDPAGE_NOTLAST)
++ flags |= MSG_MORE;
++
+ if (!up->pending) {
+ struct msghdr msg = { .msg_flags = flags|MSG_MORE };
+
--- /dev/null
+From c97cf606e43b85a6cf158b810375dd77312024db Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Tue, 19 Nov 2013 16:34:14 -0500
+Subject: NFSv4: Update list of irrecoverable errors on DELEGRETURN
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+commit c97cf606e43b85a6cf158b810375dd77312024db upstream.
+
+If the DELEGRETURN errors out with something like NFS4ERR_BAD_STATEID
+then there is no recovery possible. Just quit without returning an error.
+
+Also, note that the client must not assume that the NFSv4 lease has been
+renewed when it sees an error on DELEGRETURN.
+
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/nfs4proc.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -4938,11 +4938,17 @@ static void nfs4_delegreturn_done(struct
+
+ trace_nfs4_delegreturn_exit(&data->args, &data->res, task->tk_status);
+ switch (task->tk_status) {
+- case -NFS4ERR_STALE_STATEID:
+- case -NFS4ERR_EXPIRED:
+ case 0:
+ renew_lease(data->res.server, data->timestamp);
+ break;
++ case -NFS4ERR_ADMIN_REVOKED:
++ case -NFS4ERR_DELEG_REVOKED:
++ case -NFS4ERR_BAD_STATEID:
++ case -NFS4ERR_OLD_STATEID:
++ case -NFS4ERR_STALE_STATEID:
++ case -NFS4ERR_EXPIRED:
++ task->tk_status = 0;
++ break;
+ default:
+ if (nfs4_async_handle_error(task, data->res.server, NULL) ==
+ -EAGAIN) {
--- /dev/null
+From 0576da2c08e3d332f1b0653030d28ab804585ab6 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Wed, 20 Nov 2013 23:07:42 +0100
+Subject: parisc: fix mmap(MAP_FIXED|MAP_SHARED) to already mmapped address
+
+From: Helge Deller <deller@gmx.de>
+
+commit 0576da2c08e3d332f1b0653030d28ab804585ab6 upstream.
+
+locale-gen on Debian showed a strange problem on parisc:
+mmap2(NULL, 536870912, PROT_NONE, MAP_SHARED, 3, 0) = 0x42a54000
+mmap2(0x42a54000, 103860, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 3, 0) = -1 EINVAL (Invalid argument)
+
+Basically it was just trying to re-mmap() a file at the same address
+which it was given by a previous mmap() call. But this remapping failed
+with EINVAL.
+
+The problem is, that when MAP_FIXED and MAP_SHARED flags were used, we didn't
+included the mapping-based offset when we verified the alignment of the given
+fixed address against the offset which we calculated it in the previous call.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/parisc/kernel/sys_parisc.c | 25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+--- a/arch/parisc/kernel/sys_parisc.c
++++ b/arch/parisc/kernel/sys_parisc.c
+@@ -61,8 +61,15 @@ static int get_offset(struct address_spa
+ return (unsigned long) mapping >> 8;
+ }
+
+-static unsigned long get_shared_area(struct address_space *mapping,
+- unsigned long addr, unsigned long len, unsigned long pgoff)
++static unsigned long shared_align_offset(struct file *filp, unsigned long pgoff)
++{
++ struct address_space *mapping = filp ? filp->f_mapping : NULL;
++
++ return (get_offset(mapping) + pgoff) << PAGE_SHIFT;
++}
++
++static unsigned long get_shared_area(struct file *filp, unsigned long addr,
++ unsigned long len, unsigned long pgoff)
+ {
+ struct vm_unmapped_area_info info;
+
+@@ -71,7 +78,7 @@ static unsigned long get_shared_area(str
+ info.low_limit = PAGE_ALIGN(addr);
+ info.high_limit = TASK_SIZE;
+ info.align_mask = PAGE_MASK & (SHMLBA - 1);
+- info.align_offset = (get_offset(mapping) + pgoff) << PAGE_SHIFT;
++ info.align_offset = shared_align_offset(filp, pgoff);
+ return vm_unmapped_area(&info);
+ }
+
+@@ -82,20 +89,18 @@ unsigned long arch_get_unmapped_area(str
+ return -ENOMEM;
+ if (flags & MAP_FIXED) {
+ if ((flags & MAP_SHARED) &&
+- (addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))
++ (addr - shared_align_offset(filp, pgoff)) & (SHMLBA - 1))
+ return -EINVAL;
+ return addr;
+ }
+ if (!addr)
+ addr = TASK_UNMAPPED_BASE;
+
+- if (filp) {
+- addr = get_shared_area(filp->f_mapping, addr, len, pgoff);
+- } else if(flags & MAP_SHARED) {
+- addr = get_shared_area(NULL, addr, len, pgoff);
+- } else {
++ if (filp || (flags & MAP_SHARED))
++ addr = get_shared_area(filp, addr, len, pgoff);
++ else
+ addr = get_unshared_area(addr, len);
+- }
++
+ return addr;
+ }
+
--- /dev/null
+From 8a37ea50e7acf8db6821ba094ca41384e7d8c70c Mon Sep 17 00:00:00 2001
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Date: Thu, 5 Dec 2013 02:01:55 +0100
+Subject: PNP: fix restoring devices after hibernation
+
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+
+commit 8a37ea50e7acf8db6821ba094ca41384e7d8c70c upstream.
+
+On returning from hibernation 'restore' callback is called,
+not 'resume'. Fix it.
+
+Fixes: eaf140b60ec9 (PNP: convert PNP driver bus legacy pm_ops to dev_pm_ops)
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pnp/driver.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- a/drivers/pnp/driver.c
++++ b/drivers/pnp/driver.c
+@@ -197,6 +197,11 @@ static int pnp_bus_freeze(struct device
+ return __pnp_bus_suspend(dev, PMSG_FREEZE);
+ }
+
++static int pnp_bus_poweroff(struct device *dev)
++{
++ return __pnp_bus_suspend(dev, PMSG_HIBERNATE);
++}
++
+ static int pnp_bus_resume(struct device *dev)
+ {
+ struct pnp_dev *pnp_dev = to_pnp_dev(dev);
+@@ -234,9 +239,14 @@ static int pnp_bus_resume(struct device
+ }
+
+ static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
++ /* Suspend callbacks */
+ .suspend = pnp_bus_suspend,
+- .freeze = pnp_bus_freeze,
+ .resume = pnp_bus_resume,
++ /* Hibernate callbacks */
++ .freeze = pnp_bus_freeze,
++ .thaw = pnp_bus_resume,
++ .poweroff = pnp_bus_poweroff,
++ .restore = pnp_bus_resume,
+ };
+
+ struct bus_type pnp_bus_type = {
--- /dev/null
+From 1aeef303b5d9e243c41d5b80f8bb059366514a10 Mon Sep 17 00:00:00 2001
+From: Liu Gang <Gang.Liu@freescale.com>
+Date: Fri, 22 Nov 2013 16:12:40 +0800
+Subject: powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536
+
+From: Liu Gang <Gang.Liu@freescale.com>
+
+commit 1aeef303b5d9e243c41d5b80f8bb059366514a10 upstream.
+
+For MPC8572/MPC8536, the status of GPIOs defined as output
+cannot be determined by reading GPDAT register, so the code
+use shadow data register instead. But the code may give the
+wrong status of GPIOs defined as input under some scenarios:
+
+1. If some pins were configured as inputs and were asserted
+high before booting the kernel, the shadow data has been
+initialized with those pin values.
+2. Some pins have been configured as output first and have
+been set to the high value, then reconfigured as input.
+
+The above cases will make the shadow data for those input
+pins to be set to high. Then reading the pin status will
+always return high even if the actual pin status is low.
+
+The code should eliminate the effects of the shadow data to
+the input pins, and the status of those pins should be
+read directly from GPDAT.
+
+Acked-by: Scott Wood <scottwood@freescale.com>
+Acked-by: Anatolij Gustschin <agust@denx.de>
+Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpio/gpio-mpc8xxx.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpio/gpio-mpc8xxx.c
++++ b/drivers/gpio/gpio-mpc8xxx.c
+@@ -69,10 +69,14 @@ static int mpc8572_gpio_get(struct gpio_
+ u32 val;
+ struct of_mm_gpio_chip *mm = to_of_mm_gpio_chip(gc);
+ struct mpc8xxx_gpio_chip *mpc8xxx_gc = to_mpc8xxx_gpio_chip(mm);
++ u32 out_mask, out_shadow;
+
+- val = in_be32(mm->regs + GPIO_DAT) & ~in_be32(mm->regs + GPIO_DIR);
++ out_mask = in_be32(mm->regs + GPIO_DIR);
+
+- return (val | mpc8xxx_gc->data) & mpc8xxx_gpio2mask(gpio);
++ val = in_be32(mm->regs + GPIO_DAT) & ~out_mask;
++ out_shadow = mpc8xxx_gc->data & out_mask;
++
++ return (val | out_shadow) & mpc8xxx_gpio2mask(gpio);
+ }
+
+ static int mpc8xxx_gpio_get(struct gpio_chip *gc, unsigned int gpio)
scsi-libsas-fix-usage-of-ata_tf_to_fis.patch
scsi-hpsa-do-not-discard-scsi-status-on-aborted-commands.patch
scsi-hpsa-return-0-from-driver-probe-function-on-success-not-1.patch
+nfsv4-update-list-of-irrecoverable-errors-on-delegreturn.patch
+pnp-fix-restoring-devices-after-hibernation.patch
+time-fix-1ns-tick-drift-w-generic_time_vsyscall_old.patch
+powerpc-gpio-fix-the-wrong-gpio-input-data-on-mpc8572-mpc8536.patch
+parisc-fix-mmap-map_fixed-map_shared-to-already-mmapped-address.patch
+xen-gnttab-leave-lazy-mmu-mode-in-the-case-of-a-m2p-override-failure.patch
+spi-pxa2xx-add-new-acpi-ids.patch
+cpuidle-check-for-dev-before-deregistering-it.patch
+cpufreq-fix-garbage-kobjects-on-errors-during-suspend-resume.patch
+update-of-blkg_stat-and-blkg_rwstat-may-happen-in-bh-context.patch
+irq-enable-all-irqs-unconditionally-in-irq_resume.patch
+net-update-consumers-of-msg_more-to-recognize-msg_sendpage_notlast.patch
--- /dev/null
+From 54acbd9688e6324470671525c7916011f1ff8081 Mon Sep 17 00:00:00 2001
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+Date: Tue, 12 Nov 2013 12:06:21 +0200
+Subject: spi/pxa2xx: add new ACPI IDs
+
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+
+commit 54acbd9688e6324470671525c7916011f1ff8081 upstream.
+
+Newer Intel PCHs with LPSS have the same SPI controllers than Haswell but
+ACPI IDs are different. Add these IDs to the driver list.
+
+Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spi/spi-pxa2xx.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/spi/spi-pxa2xx.c
++++ b/drivers/spi/spi-pxa2xx.c
+@@ -1077,6 +1077,8 @@ pxa2xx_spi_acpi_get_pdata(struct platfor
+ static struct acpi_device_id pxa2xx_spi_acpi_match[] = {
+ { "INT33C0", 0 },
+ { "INT33C1", 0 },
++ { "INT3430", 0 },
++ { "INT3431", 0 },
+ { "80860F0E", 0 },
+ { },
+ };
--- /dev/null
+From 4be77398ac9d948773116b6be4a3c91b3d6ea18c Mon Sep 17 00:00:00 2001
+From: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Date: Fri, 22 Nov 2013 11:44:51 -0800
+Subject: time: Fix 1ns/tick drift w/ GENERIC_TIME_VSYSCALL_OLD
+
+From: Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+commit 4be77398ac9d948773116b6be4a3c91b3d6ea18c upstream.
+
+Since commit 1e75fa8be9f (time: Condense timekeeper.xtime
+into xtime_sec - merged in v3.6), there has been an problem
+with the error accounting in the timekeeping code, such that
+when truncating to nanoseconds, we round up to the next nsec,
+but the balancing adjustment to the ntp_error value was dropped.
+
+This causes 1ns per tick drift forward of the clock.
+
+In 3.7, this logic was isolated to only GENERIC_TIME_VSYSCALL_OLD
+architectures (s390, ia64, powerpc).
+
+The fix is simply to balance the accounting and to subtract the
+added nanosecond from ntp_error. This allows the internal long-term
+clock steering to keep the clock accurate.
+
+While this fix removes the regression added in 1e75fa8be9f, the
+ideal solution is to move away from GENERIC_TIME_VSYSCALL_OLD
+and use the new VSYSCALL method, which avoids entirely the
+nanosecond granular rounding, and the resulting short-term clock
+adjustment oscillation needed to keep long term accurate time.
+
+[ jstultz: Many thanks to Martin for his efforts identifying this
+ subtle bug, and providing the fix. ]
+
+Originally-from: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Cc: Tony Luck <tony.luck@intel.com>
+Cc: Paul Mackerras <paulus@samba.org>
+Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Cc: Andy Lutomirski <luto@amacapital.net>
+Cc: Paul Turner <pjt@google.com>
+Cc: Steven Rostedt <rostedt@goodmis.org>
+Cc: Richard Cochran <richardcochran@gmail.com>
+Cc: Prarit Bhargava <prarit@redhat.com>
+Cc: Fenghua Yu <fenghua.yu@intel.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Link: http://lkml.kernel.org/r/1385149491-20307-1-git-send-email-john.stultz@linaro.org
+Signed-off-by: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/time/timekeeping.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/time/timekeeping.c
++++ b/kernel/time/timekeeping.c
+@@ -1347,7 +1347,7 @@ static inline void old_vsyscall_fixup(st
+ tk->xtime_nsec -= remainder;
+ tk->xtime_nsec += 1ULL << tk->shift;
+ tk->ntp_error += remainder << tk->ntp_error_shift;
+-
++ tk->ntp_error -= (1ULL << tk->shift) << tk->ntp_error_shift;
+ }
+ #else
+ #define old_vsyscall_fixup(tk)
--- /dev/null
+From 2c575026fae6e63771bd2a4c1d407214a8096a89 Mon Sep 17 00:00:00 2001
+From: Hong Zhiguo <zhiguohong@tencent.com>
+Date: Wed, 20 Nov 2013 10:35:05 -0700
+Subject: Update of blkg_stat and blkg_rwstat may happen in bh context.
+ While u64_stats_fetch_retry is only preempt_disable on 32bit UP system. This
+ is not enough to avoid preemption by bh and may read strange 64 bit value.
+
+From: Hong Zhiguo <zhiguohong@tencent.com>
+
+commit 2c575026fae6e63771bd2a4c1d407214a8096a89 upstream.
+
+Signed-off-by: Hong Zhiguo <zhiguohong@tencent.com>
+Acked-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ block/blk-cgroup.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/block/blk-cgroup.h
++++ b/block/blk-cgroup.h
+@@ -430,9 +430,9 @@ static inline uint64_t blkg_stat_read(st
+ uint64_t v;
+
+ do {
+- start = u64_stats_fetch_begin(&stat->syncp);
++ start = u64_stats_fetch_begin_bh(&stat->syncp);
+ v = stat->cnt;
+- } while (u64_stats_fetch_retry(&stat->syncp, start));
++ } while (u64_stats_fetch_retry_bh(&stat->syncp, start));
+
+ return v;
+ }
+@@ -498,9 +498,9 @@ static inline struct blkg_rwstat blkg_rw
+ struct blkg_rwstat tmp;
+
+ do {
+- start = u64_stats_fetch_begin(&rwstat->syncp);
++ start = u64_stats_fetch_begin_bh(&rwstat->syncp);
+ tmp = *rwstat;
+- } while (u64_stats_fetch_retry(&rwstat->syncp, start));
++ } while (u64_stats_fetch_retry_bh(&rwstat->syncp, start));
+
+ return tmp;
+ }
--- /dev/null
+From 14883a75ec76b44759385fb12629f4a0f1aef4e3 Mon Sep 17 00:00:00 2001
+From: Matt Wilson <msw@amazon.com>
+Date: Wed, 20 Nov 2013 12:11:35 -0800
+Subject: xen/gnttab: leave lazy MMU mode in the case of a m2p override failure
+
+From: Matt Wilson <msw@amazon.com>
+
+commit 14883a75ec76b44759385fb12629f4a0f1aef4e3 upstream.
+
+Commit f62805f1 introduced a bug where lazy MMU mode isn't exited if a
+m2p_add/remove_override call fails.
+
+Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Reviewed-by: David Vrabel <david.vrabel@citrix.com>
+Reviewed-by: Anthony Liguori <aliguori@amazon.com>
+Signed-off-by: Matt Wilson <msw@amazon.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/xen/grant-table.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/xen/grant-table.c
++++ b/drivers/xen/grant-table.c
+@@ -921,9 +921,10 @@ int gnttab_map_refs(struct gnttab_map_gr
+ ret = m2p_add_override(mfn, pages[i], kmap_ops ?
+ &kmap_ops[i] : NULL);
+ if (ret)
+- return ret;
++ goto out;
+ }
+
++ out:
+ if (lazy)
+ arch_leave_lazy_mmu_mode();
+
+@@ -954,9 +955,10 @@ int gnttab_unmap_refs(struct gnttab_unma
+ ret = m2p_remove_override(pages[i], kmap_ops ?
+ &kmap_ops[i] : NULL);
+ if (ret)
+- return ret;
++ goto out;
+ }
+
++ out:
+ if (lazy)
+ arch_leave_lazy_mmu_mode();
+