]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
2.6.29 add last few patches for .1
authorChris Wright <chrisw@sous-sol.org>
Thu, 2 Apr 2009 06:41:57 +0000 (23:41 -0700)
committerChris Wright <chrisw@sous-sol.org>
Thu, 2 Apr 2009 06:41:57 +0000 (23:41 -0700)
review-2.6.29/series
review-2.6.29/sparc64-fix-mm-refcount-check-in-smp_flush_tlb_pending.patch [new file with mode: 0644]
review-2.6.29/sparc64-fix-reset-hangs-on-niagara-systems.patch [new file with mode: 0644]
review-2.6.29/sparc64-flush-tlb-before-releasing-pages.patch [new file with mode: 0644]
review-2.6.29/v4l-v4l2-common-remove-incorrect-module-test.patch [new file with mode: 0644]

index 23aab2daf7afe97dd4b43623e8b285baf04094fa..52ff6cbfda121e11518aabd64a714d9562e1a514 100644 (file)
@@ -40,3 +40,7 @@ lguest-wire-up-pte_update-pte_update_defer.patch
 lguest-fix-spurious-bug_on-on-invalid-guest-stack.patch
 cfg80211-fix-incorrect-assumption-on-last_request-for-11d.patch
 kvm-mmu-fix-another-largepage-memory-leak.patch
+sparc64-fix-mm-refcount-check-in-smp_flush_tlb_pending.patch
+sparc64-flush-tlb-before-releasing-pages.patch
+sparc64-fix-reset-hangs-on-niagara-systems.patch
+v4l-v4l2-common-remove-incorrect-module-test.patch
diff --git a/review-2.6.29/sparc64-fix-mm-refcount-check-in-smp_flush_tlb_pending.patch b/review-2.6.29/sparc64-fix-mm-refcount-check-in-smp_flush_tlb_pending.patch
new file mode 100644 (file)
index 0000000..9fe87e4
--- /dev/null
@@ -0,0 +1,69 @@
+From 8f44982d5ce31a9be34351bd1ace77c082416a63 Mon Sep 17 00:00:00 2001
+Message-Id: <20090331.155501.169274542.davem@davemloft.net>
+From: David S. Miller <davem@davemloft.net>
+Date: Fri, 27 Mar 2009 01:09:17 -0700
+Subject: sparc64: Fix MM refcount check in smp_flush_tlb_pending().
+
+[ Upstream commit f9384d41c02408dd404aa64d66d0ef38adcf6479 ]
+
+As explained by Benjamin Herrenschmidt:
+
+> CPU 0 is running the context, task->mm == task->active_mm == your
+> context. The CPU is in userspace happily churning things.
+>
+> CPU 1 used to run it, not anymore, it's now running fancyfsd which
+> is a kernel thread, but current->active_mm still points to that
+> same context.
+>
+> Because there's only one "real" user, mm_users is 1 (but mm_count is
+> elevated, it's just that the presence on CPU 1 as active_mm has no
+> effect on mm_count().
+>
+> At this point, fancyfsd decides to invalidate a mapping currently mapped
+> by that context, for example because a networked file has changed
+> remotely or something like that, using unmap_mapping_ranges().
+>
+> So CPU 1 goes into the zapping code, which eventually ends up calling
+> flush_tlb_pending(). Your test will succeed, as current->active_mm is
+> indeed the target mm for the flush, and mm_users is indeed 1. So you
+> will -not- send an IPI to the other CPU, and CPU 0 will continue happily
+> accessing the pages that should have been unmapped.
+
+To fix this problem, check ->mm instead of ->active_mm, and this
+means:
+
+> So if you test current->mm, you effectively account for mm_users == 1,
+> so the only way the mm can be active on another processor is as a lazy
+> mm for a kernel thread. So your test should work properly as long
+> as you don't have a HW that will do speculative TLB reloads into the
+> TLB on that other CPU (and even if you do, you flush-on-switch-in should
+> get rid of any crap here).
+
+And therefore we should be OK.
+
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/sparc/kernel/smp_64.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/sparc/kernel/smp_64.c
++++ b/arch/sparc/kernel/smp_64.c
+@@ -1031,7 +1031,7 @@ void smp_fetch_global_regs(void)
+  *    If the address space is non-shared (ie. mm->count == 1) we avoid
+  *    cross calls when we want to flush the currently running process's
+  *    tlb state.  This is done by clearing all cpu bits except the current
+- *    processor's in current->active_mm->cpu_vm_mask and performing the
++ *    processor's in current->mm->cpu_vm_mask and performing the
+  *    flush locally only.  This will force any subsequent cpus which run
+  *    this task to flush the context from the local tlb if the process
+  *    migrates to another cpu (again).
+@@ -1074,7 +1074,7 @@ void smp_flush_tlb_pending(struct mm_str
+       u32 ctx = CTX_HWBITS(mm->context);
+       int cpu = get_cpu();
+-      if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1)
++      if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
+               mm->cpu_vm_mask = cpumask_of_cpu(cpu);
+       else
+               smp_cross_call_masked(&xcall_flush_tlb_pending,
diff --git a/review-2.6.29/sparc64-fix-reset-hangs-on-niagara-systems.patch b/review-2.6.29/sparc64-fix-reset-hangs-on-niagara-systems.patch
new file mode 100644 (file)
index 0000000..4f5b608
--- /dev/null
@@ -0,0 +1,65 @@
+From 6397166e1e3e4397e2b18b36d6de6864588d3c96 Mon Sep 17 00:00:00 2001
+Message-Id: <20090331.155501.169274542.davem@davemloft.net>
+From: David S. Miller <davem@davemloft.net>
+Date: Sun, 29 Mar 2009 15:40:33 -0700
+Subject: sparc64: Fix reset hangs on Niagara systems.
+
+[ Upstream commit ffaba674090f287afe0c44fd8d978c64c03581a8 ]
+
+Hypervisor versions older than version 1.6.1 cannot handle
+leaving the profile counter overflow interrupt chirping
+when the system does a soft reset.
+
+So use a reboot notifier to shut off the NMI watchdog.
+
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/sparc/kernel/nmi.c |   23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+--- a/arch/sparc/kernel/nmi.c
++++ b/arch/sparc/kernel/nmi.c
+@@ -13,6 +13,7 @@
+ #include <linux/module.h>
+ #include <linux/kprobes.h>
+ #include <linux/kernel_stat.h>
++#include <linux/reboot.h>
+ #include <linux/slab.h>
+ #include <linux/kdebug.h>
+ #include <linux/delay.h>
+@@ -206,13 +207,33 @@ void nmi_adjust_hz(unsigned int new_hz)
+ }
+ EXPORT_SYMBOL_GPL(nmi_adjust_hz);
++static int nmi_shutdown(struct notifier_block *nb, unsigned long cmd, void *p)
++{
++      on_each_cpu(stop_watchdog, NULL, 1);
++      return 0;
++}
++
++static struct notifier_block nmi_reboot_notifier = {
++      .notifier_call = nmi_shutdown,
++};
++
+ int __init nmi_init(void)
+ {
++      int err;
++
+       nmi_usable = 1;
+       on_each_cpu(start_watchdog, NULL, 1);
+-      return check_nmi_watchdog();
++      err = check_nmi_watchdog();
++      if (!err) {
++              err = register_reboot_notifier(&nmi_reboot_notifier);
++              if (err) {
++                      nmi_usable = 0;
++                      on_each_cpu(stop_watchdog, NULL, 1);
++              }
++      }
++      return err;
+ }
+ static int __init setup_nmi_watchdog(char *str)
diff --git a/review-2.6.29/sparc64-flush-tlb-before-releasing-pages.patch b/review-2.6.29/sparc64-flush-tlb-before-releasing-pages.patch
new file mode 100644 (file)
index 0000000..1fbfb09
--- /dev/null
@@ -0,0 +1,39 @@
+From f82796ca4b9e40ef1ff372b4b5b6937e3f13b143 Mon Sep 17 00:00:00 2001
+Message-Id: <20090331.155501.169274542.davem@davemloft.net>
+From: David S. Miller <davem@davemloft.net>
+Date: Thu, 26 Mar 2009 01:28:53 -0700
+Subject: sparc64: Flush TLB before releasing pages.
+
+[ Upstream commit a552a42cfa91ab653128dff89a70c8dde7fed042 ]
+
+tlb_flush_mmu() needs to flush pending TLB entries before
+processing the mmu_gather ->pages list.
+
+Noticed by Benjamin Herrenschmidt.
+
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/sparc/include/asm/tlb_64.h |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/sparc/include/asm/tlb_64.h
++++ b/arch/sparc/include/asm/tlb_64.h
+@@ -58,6 +58,8 @@ static inline struct mmu_gather *tlb_gat
+ static inline void tlb_flush_mmu(struct mmu_gather *mp)
+ {
+       if (mp->need_flush) {
++              if (!mp->fullmm)
++                      flush_tlb_pending();
+               free_pages_and_swap_cache(mp->pages, mp->pages_nr);
+               mp->pages_nr = 0;
+               mp->need_flush = 0;
+@@ -78,8 +80,6 @@ static inline void tlb_finish_mmu(struct
+       if (mp->fullmm)
+               mp->fullmm = 0;
+-      else
+-              flush_tlb_pending();
+       /* keep the page table cache within bounds */
+       check_pgt_cache();
diff --git a/review-2.6.29/v4l-v4l2-common-remove-incorrect-module-test.patch b/review-2.6.29/v4l-v4l2-common-remove-incorrect-module-test.patch
new file mode 100644 (file)
index 0000000..6cd8c63
--- /dev/null
@@ -0,0 +1,64 @@
+From chrisw@hera.kernel.org  Wed Apr  1 23:18:58 2009
+Message-ID: <49D21938.3000907@linuxtv.org>
+Date: Tue, 31 Mar 2009 09:23:04 -0400
+From: Michael Krufky <mkrufky@linuxtv.org>
+To: stable@kernel.org
+Cc: Hans Verkuil <hverkuil@xs4all.nl>, Linux Media Mailing List <linux-media@vger.kernel.org>
+Subject: V4L: v4l2-common: remove incorrect MODULE test
+
+From: Hans Verkuil <hverkuil@xs4all.nl>
+
+upstream commit: d64260d58865004c6354e024da3450fdd607ea07
+
+v4l2-common doesn't have to be a module for it to call request_module().
+Just remove that test.
+
+Without this patch loading ivtv as a module while v4l2-common is compiled
+into the kernel will cause a delayed load of the i2c modules that ivtv
+needs since request_module is never called directly.
+
+While it is nice to see the delayed load in action, it is not so nice in
+that ivtv fails to do a lot of necessary i2c initializations and will oops
+later on with a division-by-zero.
+
+Thanks to Mark Lord for reporting this and helping me figure out what was
+wrong.
+
+Thanks-to: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Thanks-to: Mark Lord <lkml@rtr.ca>
+Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ drivers/media/video/v4l2-common.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/media/video/v4l2-common.c
++++ b/drivers/media/video/v4l2-common.c
+@@ -910,10 +910,10 @@ struct v4l2_subdev *v4l2_i2c_new_subdev(
+       struct i2c_board_info info;
+       BUG_ON(!dev);
+-#ifdef MODULE
++
+       if (module_name)
+               request_module(module_name);
+-#endif
++
+       /* Setup the i2c board info with the device type and
+          the device address. */
+       memset(&info, 0, sizeof(info));
+@@ -958,10 +958,10 @@ struct v4l2_subdev *v4l2_i2c_new_probed_
+       struct i2c_board_info info;
+       BUG_ON(!dev);
+-#ifdef MODULE
++
+       if (module_name)
+               request_module(module_name);
+-#endif
++
+       /* Setup the i2c board info with the device type and
+          the device address. */
+       memset(&info, 0, sizeof(info));