From: Greg Kroah-Hartman Date: Sun, 8 Dec 2013 20:17:51 +0000 (-0800) Subject: 3.10-stable patches X-Git-Tag: v3.4.74~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c4d71114a03e84320acdb84e211558246b9861d;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: irq-enable-all-irqs-unconditionally-in-irq_resume.patch net-update-consumers-of-msg_more-to-recognize-msg_sendpage_notlast.patch nfsv4-update-list-of-irrecoverable-errors-on-delegreturn.patch parisc-fix-mmap-map_fixed-map_shared-to-already-mmapped-address.patch powerpc-gpio-fix-the-wrong-gpio-input-data-on-mpc8572-mpc8536.patch time-fix-1ns-tick-drift-w-generic_time_vsyscall_old.patch update-of-blkg_stat-and-blkg_rwstat-may-happen-in-bh-context.patch xen-gnttab-leave-lazy-mmu-mode-in-the-case-of-a-m2p-override-failure.patch --- diff --git a/queue-3.10/irq-enable-all-irqs-unconditionally-in-irq_resume.patch b/queue-3.10/irq-enable-all-irqs-unconditionally-in-irq_resume.patch new file mode 100644 index 00000000000..7be5c32e6ae --- /dev/null +++ b/queue-3.10/irq-enable-all-irqs-unconditionally-in-irq_resume.patch @@ -0,0 +1,58 @@ +From ac01810c9d2814238f08a227062e66a35a0e1ea2 Mon Sep 17 00:00:00 2001 +From: Laxman Dewangan +Date: Mon, 25 Nov 2013 19:39:47 +0530 +Subject: irq: Enable all irqs unconditionally in irq_resume + +From: Laxman Dewangan + +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 +Acked-by-and-tested-by: Konrad Rzeszutek Wilk +Acked-by: Heiko Stuebner +Reviewed-by: Pavel Machek +Cc: +Cc: +Cc: +Cc: +Link: http://lkml.kernel.org/r/1385388587-16442-1-git-send-email-ldewangan@nvidia.com +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + 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); diff --git a/queue-3.10/net-update-consumers-of-msg_more-to-recognize-msg_sendpage_notlast.patch b/queue-3.10/net-update-consumers-of-msg_more-to-recognize-msg_sendpage_notlast.patch new file mode 100644 index 00000000000..5a632dd313b --- /dev/null +++ b/queue-3.10/net-update-consumers-of-msg_more-to-recognize-msg_sendpage_notlast.patch @@ -0,0 +1,71 @@ +From d3f7d56a7a4671d395e8af87071068a195257bf6 Mon Sep 17 00:00:00 2001 +From: Shawn Landden +Date: Sun, 24 Nov 2013 22:36:28 -0800 +Subject: net: update consumers of MSG_MORE to recognize MSG_SENDPAGE_NOTLAST + +From: Shawn Landden + +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 +Cc: Eric Dumazet +Cc: David S. Miller +Reported-and-tested-by: Shawn Landden +Original-patch: Richard Weinberger +Signed-off-by: Shawn Landden +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -1073,6 +1073,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 }; + diff --git a/queue-3.10/nfsv4-update-list-of-irrecoverable-errors-on-delegreturn.patch b/queue-3.10/nfsv4-update-list-of-irrecoverable-errors-on-delegreturn.patch new file mode 100644 index 00000000000..3b39183f8f0 --- /dev/null +++ b/queue-3.10/nfsv4-update-list-of-irrecoverable-errors-on-delegreturn.patch @@ -0,0 +1,44 @@ +From c97cf606e43b85a6cf158b810375dd77312024db Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Tue, 19 Nov 2013 16:34:14 -0500 +Subject: NFSv4: Update list of irrecoverable errors on DELEGRETURN + +From: Trond Myklebust + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/nfs4proc.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/fs/nfs/nfs4proc.c ++++ b/fs/nfs/nfs4proc.c +@@ -4401,11 +4401,17 @@ static void nfs4_delegreturn_done(struct + return; + + 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) { diff --git a/queue-3.10/parisc-fix-mmap-map_fixed-map_shared-to-already-mmapped-address.patch b/queue-3.10/parisc-fix-mmap-map_fixed-map_shared-to-already-mmapped-address.patch new file mode 100644 index 00000000000..cbc651105f1 --- /dev/null +++ b/queue-3.10/parisc-fix-mmap-map_fixed-map_shared-to-already-mmapped-address.patch @@ -0,0 +1,83 @@ +From 0576da2c08e3d332f1b0653030d28ab804585ab6 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Wed, 20 Nov 2013 23:07:42 +0100 +Subject: parisc: fix mmap(MAP_FIXED|MAP_SHARED) to already mmapped address + +From: Helge Deller + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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; + } + diff --git a/queue-3.10/powerpc-gpio-fix-the-wrong-gpio-input-data-on-mpc8572-mpc8536.patch b/queue-3.10/powerpc-gpio-fix-the-wrong-gpio-input-data-on-mpc8572-mpc8536.patch new file mode 100644 index 00000000000..0b7efcbda55 --- /dev/null +++ b/queue-3.10/powerpc-gpio-fix-the-wrong-gpio-input-data-on-mpc8572-mpc8536.patch @@ -0,0 +1,57 @@ +From 1aeef303b5d9e243c41d5b80f8bb059366514a10 Mon Sep 17 00:00:00 2001 +From: Liu Gang +Date: Fri, 22 Nov 2013 16:12:40 +0800 +Subject: powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536 + +From: Liu Gang + +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 +Acked-by: Anatolij Gustschin +Signed-off-by: Liu Gang +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + 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) diff --git a/queue-3.10/series b/queue-3.10/series index f9a555961cd..8ac4c4a984f 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -24,3 +24,11 @@ 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 net-smc91-fix-crash-regression-on-the-versatile.patch +nfsv4-update-list-of-irrecoverable-errors-on-delegreturn.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 +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 diff --git a/queue-3.10/time-fix-1ns-tick-drift-w-generic_time_vsyscall_old.patch b/queue-3.10/time-fix-1ns-tick-drift-w-generic_time_vsyscall_old.patch new file mode 100644 index 00000000000..2a0e99dd13b --- /dev/null +++ b/queue-3.10/time-fix-1ns-tick-drift-w-generic_time_vsyscall_old.patch @@ -0,0 +1,64 @@ +From 4be77398ac9d948773116b6be4a3c91b3d6ea18c Mon Sep 17 00:00:00 2001 +From: Martin Schwidefsky +Date: Fri, 22 Nov 2013 11:44:51 -0800 +Subject: time: Fix 1ns/tick drift w/ GENERIC_TIME_VSYSCALL_OLD + +From: Martin Schwidefsky + +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 +Cc: Tony Luck +Cc: Paul Mackerras +Cc: Benjamin Herrenschmidt +Cc: Andy Lutomirski +Cc: Paul Turner +Cc: Steven Rostedt +Cc: Richard Cochran +Cc: Prarit Bhargava +Cc: Fenghua Yu +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/1385149491-20307-1-git-send-email-john.stultz@linaro.org +Signed-off-by: John Stultz +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/timekeeping.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/time/timekeeping.c ++++ b/kernel/time/timekeeping.c +@@ -1328,7 +1328,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) diff --git a/queue-3.10/update-of-blkg_stat-and-blkg_rwstat-may-happen-in-bh-context.patch b/queue-3.10/update-of-blkg_stat-and-blkg_rwstat-may-happen-in-bh-context.patch new file mode 100644 index 00000000000..ea3f2a4e5bd --- /dev/null +++ b/queue-3.10/update-of-blkg_stat-and-blkg_rwstat-may-happen-in-bh-context.patch @@ -0,0 +1,46 @@ +From 2c575026fae6e63771bd2a4c1d407214a8096a89 Mon Sep 17 00:00:00 2001 +From: Hong Zhiguo +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 + +commit 2c575026fae6e63771bd2a4c1d407214a8096a89 upstream. + +Signed-off-by: Hong Zhiguo +Acked-by: Tejun Heo +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + block/blk-cgroup.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/block/blk-cgroup.h ++++ b/block/blk-cgroup.h +@@ -399,9 +399,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; + } +@@ -467,9 +467,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; + } diff --git a/queue-3.10/xen-gnttab-leave-lazy-mmu-mode-in-the-case-of-a-m2p-override-failure.patch b/queue-3.10/xen-gnttab-leave-lazy-mmu-mode-in-the-case-of-a-m2p-override-failure.patch new file mode 100644 index 00000000000..b54af545740 --- /dev/null +++ b/queue-3.10/xen-gnttab-leave-lazy-mmu-mode-in-the-case-of-a-m2p-override-failure.patch @@ -0,0 +1,50 @@ +From 14883a75ec76b44759385fb12629f4a0f1aef4e3 Mon Sep 17 00:00:00 2001 +From: Matt Wilson +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 + +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 +Cc: Boris Ostrovsky +Reviewed-by: David Vrabel +Reviewed-by: Anthony Liguori +Signed-off-by: Matt Wilson +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -920,9 +920,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(); + +@@ -953,9 +954,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(); +