]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.7-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Feb 2013 19:30:50 +0000 (11:30 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Feb 2013 19:30:50 +0000 (11:30 -0800)
added patches:
drivers-rtc-rtc-pl031.c-restore-st-variant-functionality.patch
mm-don-t-overwrite-mm-def_flags-in-do_mlockall.patch
s390-timer-avoid-overflow-when-programming-clock-comparator.patch

queue-3.7/drivers-rtc-rtc-pl031.c-restore-st-variant-functionality.patch [new file with mode: 0644]
queue-3.7/mm-don-t-overwrite-mm-def_flags-in-do_mlockall.patch [new file with mode: 0644]
queue-3.7/s390-timer-avoid-overflow-when-programming-clock-comparator.patch [new file with mode: 0644]
queue-3.7/series

diff --git a/queue-3.7/drivers-rtc-rtc-pl031.c-restore-st-variant-functionality.patch b/queue-3.7/drivers-rtc-rtc-pl031.c-restore-st-variant-functionality.patch
new file mode 100644 (file)
index 0000000..05af3d6
--- /dev/null
@@ -0,0 +1,43 @@
+From 3399cfb5df9594495b876d1843a7165f77366b2b Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Tue, 12 Feb 2013 13:46:19 -0800
+Subject: drivers/rtc/rtc-pl031.c: restore ST variant functionality
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+commit 3399cfb5df9594495b876d1843a7165f77366b2b upstream.
+
+Commit e7e034e18a0a ("drivers/rtc/rtc-pl031.c: fix the missing operation
+on enable") accidentally broke the ST variants of PL031.
+
+The bit that is being poked as "clockwatch" enable bit for the ST
+variants does the work of bit 0 on this variant.  Bit 0 is used for a
+clock divider on the ST variants, and setting it to 1 will affect
+timekeeping in a very bad way.
+
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
+Cc: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>
+Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
+Cc: Alessandro Zummo <a.zummo@towertech.it>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-pl031.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/rtc/rtc-pl031.c
++++ b/drivers/rtc/rtc-pl031.c
+@@ -350,7 +350,9 @@ static int pl031_probe(struct amba_devic
+       /* Enable the clockwatch on ST Variants */
+       if (vendor->clockwatch)
+               data |= RTC_CR_CWEN;
+-      writel(data | RTC_CR_EN, ldata->base + RTC_CR);
++      else
++              data |= RTC_CR_EN;
++      writel(data, ldata->base + RTC_CR);
+       /*
+        * On ST PL031 variants, the RTC reset value does not provide correct
diff --git a/queue-3.7/mm-don-t-overwrite-mm-def_flags-in-do_mlockall.patch b/queue-3.7/mm-don-t-overwrite-mm-def_flags-in-do_mlockall.patch
new file mode 100644 (file)
index 0000000..b14023a
--- /dev/null
@@ -0,0 +1,49 @@
+From 9977f0f164d46613288e0b5778eae500dfe06f31 Mon Sep 17 00:00:00 2001
+From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+Date: Tue, 12 Feb 2013 13:46:20 -0800
+Subject: mm: don't overwrite mm->def_flags in do_mlockall()
+
+From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+
+commit 9977f0f164d46613288e0b5778eae500dfe06f31 upstream.
+
+With commit 8e72033f2a48 ("thp: make MADV_HUGEPAGE check for
+mm->def_flags") the VM_NOHUGEPAGE flag may be set on s390 in
+mm->def_flags for certain processes, to prevent future thp mappings.
+This would be overwritten by do_mlockall(), which sets it back to 0 with
+an optional VM_LOCKED flag set.
+
+To fix this, instead of overwriting mm->def_flags in do_mlockall(), only
+the VM_LOCKED flag should be set or cleared.
+
+Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+Reported-by: Vivek Goyal <vgoyal@redhat.com>
+Cc: Andrea Arcangeli <aarcange@redhat.com>
+Cc: Hugh Dickins <hughd@google.com>
+Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/mlock.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/mm/mlock.c
++++ b/mm/mlock.c
+@@ -517,11 +517,11 @@ SYSCALL_DEFINE2(munlock, unsigned long,
+ static int do_mlockall(int flags)
+ {
+       struct vm_area_struct * vma, * prev = NULL;
+-      unsigned int def_flags = 0;
+       if (flags & MCL_FUTURE)
+-              def_flags = VM_LOCKED;
+-      current->mm->def_flags = def_flags;
++              current->mm->def_flags |= VM_LOCKED;
++      else
++              current->mm->def_flags &= ~VM_LOCKED;
+       if (flags == MCL_FUTURE)
+               goto out;
diff --git a/queue-3.7/s390-timer-avoid-overflow-when-programming-clock-comparator.patch b/queue-3.7/s390-timer-avoid-overflow-when-programming-clock-comparator.patch
new file mode 100644 (file)
index 0000000..d8ec787
--- /dev/null
@@ -0,0 +1,47 @@
+From d911e03d097bdc01363df5d81c43f69432eb785c Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Tue, 29 Jan 2013 09:16:28 +0100
+Subject: s390/timer: avoid overflow when programming clock comparator
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit d911e03d097bdc01363df5d81c43f69432eb785c upstream.
+
+Since ed4f209 "s390/time: fix sched_clock() overflow" a new helper function
+is used to avoid overflows when converting TOD format values to nanosecond
+values.
+The kvm interrupt code formerly however only worked by accident because of
+an overflow. It tried to program a timer that would expire in more than ~29
+years. Because of the old TOD-to-nanoseconds overflow bug the real expiry
+value however was much smaller, but now it isn't anymore.
+This however triggers yet another bug in the function that programs the clock
+comparator s390_next_ktime(): if the absolute "expires" value is after 2042
+this will result in an overflow and the programmed value is lower than the
+current TOD value which immediatly triggers a clock comparator (= timer)
+interrupt.
+Since the timer isn't expired it will be programmed immediately again and so
+on... the result is a dead system.
+To fix this simply program the maximum possible value if an overflow is
+detected.
+
+Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/s390/kernel/time.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/s390/kernel/time.c
++++ b/arch/s390/kernel/time.c
+@@ -120,6 +120,9 @@ static int s390_next_ktime(ktime_t expir
+       nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires));
+       do_div(nsecs, 125);
+       S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9);
++      /* Program the maximum value if we have an overflow (== year 2042) */
++      if (unlikely(S390_lowcore.clock_comparator < sched_clock_base_cc))
++              S390_lowcore.clock_comparator = -1ULL;
+       set_clock_comparator(S390_lowcore.clock_comparator);
+       return 0;
+ }
index 30c95980272ca8d0bbf3186fde8b9dc502b9c6cb..e92cf35bb3e4ac11ad7d7a9dec043b3f645db6bc 100644 (file)
@@ -1 +1,4 @@
 revert-xfs-fix-_xfs_buf_find-oops-on-blocks-beyond-the-filesystem-end.patch
+drivers-rtc-rtc-pl031.c-restore-st-variant-functionality.patch
+mm-don-t-overwrite-mm-def_flags-in-do_mlockall.patch
+s390-timer-avoid-overflow-when-programming-clock-comparator.patch