]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Oct 2012 18:47:55 +0000 (11:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Oct 2012 18:47:55 +0000 (11:47 -0700)
added patches:
module-taint-kernel-when-lve-module-is-loaded.patch
nohz-fix-one-jiffy-count-too-far-in-idle-cputime.patch
timekeeping-cast-raw_interval-to-u64-to-avoid-shift-overflow.patch
timers-fix-endless-looping-between-cascade-and-internal_add_timer.patch
viafb-don-t-touch-clock-state-on-olpc-xo-1.5.patch
video-udlfb-fix-line-counting-in-fb_write.patch

queue-3.6/module-taint-kernel-when-lve-module-is-loaded.patch [new file with mode: 0644]
queue-3.6/nohz-fix-one-jiffy-count-too-far-in-idle-cputime.patch [new file with mode: 0644]
queue-3.6/series
queue-3.6/timekeeping-cast-raw_interval-to-u64-to-avoid-shift-overflow.patch [new file with mode: 0644]
queue-3.6/timers-fix-endless-looping-between-cascade-and-internal_add_timer.patch [new file with mode: 0644]
queue-3.6/viafb-don-t-touch-clock-state-on-olpc-xo-1.5.patch [new file with mode: 0644]
queue-3.6/video-udlfb-fix-line-counting-in-fb_write.patch [new file with mode: 0644]

diff --git a/queue-3.6/module-taint-kernel-when-lve-module-is-loaded.patch b/queue-3.6/module-taint-kernel-when-lve-module-is-loaded.patch
new file mode 100644 (file)
index 0000000..357c9c8
--- /dev/null
@@ -0,0 +1,36 @@
+From c99af3752bb52ba3aece5315279a57a477edfaf1 Mon Sep 17 00:00:00 2001
+From: Matthew Garrett <mjg59@srcf.ucam.org>
+Date: Fri, 22 Jun 2012 13:49:31 -0400
+Subject: module: taint kernel when lve module is loaded
+
+From: Matthew Garrett <mjg59@srcf.ucam.org>
+
+commit c99af3752bb52ba3aece5315279a57a477edfaf1 upstream.
+
+Cloudlinux have a product called lve that includes a kernel module. This
+was previously GPLed but is now under a proprietary license, but the
+module continues to declare MODULE_LICENSE("GPL") and makes use of some
+EXPORT_SYMBOL_GPL symbols. Forcibly taint it in order to avoid this.
+
+Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
+Cc: Alex Lyashkov <umka@cloudlinux.com>
+Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/module.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/kernel/module.c
++++ b/kernel/module.c
+@@ -2730,6 +2730,10 @@ static int check_module_license_and_vers
+       if (strcmp(mod->name, "driverloader") == 0)
+               add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
++      /* lve claims to be GPL but upstream won't provide source */
++      if (strcmp(mod->name, "lve") == 0)
++              add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
++
+ #ifdef CONFIG_MODVERSIONS
+       if ((mod->num_syms && !mod->crcs)
+           || (mod->num_gpl_syms && !mod->gpl_crcs)
diff --git a/queue-3.6/nohz-fix-one-jiffy-count-too-far-in-idle-cputime.patch b/queue-3.6/nohz-fix-one-jiffy-count-too-far-in-idle-cputime.patch
new file mode 100644 (file)
index 0000000..b0ca89c
--- /dev/null
@@ -0,0 +1,68 @@
+From 2b17c545a4cdbbbadcd7f1e9684c2d7db8f085a6 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Thu, 4 Oct 2012 01:46:44 +0200
+Subject: nohz: Fix one jiffy count too far in idle cputime
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 2b17c545a4cdbbbadcd7f1e9684c2d7db8f085a6 upstream.
+
+When we stop the tick in idle, we save the current jiffies value
+in ts->idle_jiffies. This snapshot is substracted from the later
+value of jiffies when the tick is restarted and the resulting
+delta is accounted as idle cputime. This is how we handle the
+idle cputime accounting without the tick.
+
+But sometimes we need to schedule the next tick to some time in
+the future instead of completely stopping it. In this case, a
+tick may happen before we restart the periodic behaviour and
+from that tick we account one jiffy to idle cputime as usual but
+we also increment the ts->idle_jiffies snapshot by one so that
+when we compute the delta to account, we substract the one jiffy
+we just accounted.
+
+To prepare for stopping the tick outside idle, we introduced a
+check that prevents from fixing up that ts->idle_jiffies if we
+are not running the idle task. But we use idle_cpu() for that
+and this is a problem if we run the tick while another CPU
+remotely enqueues a ttwu to our runqueue:
+
+CPU 0:                            CPU 1:
+
+tick_sched_timer() {              ttwu_queue_remote()
+       if (idle_cpu(CPU 0))
+           ts->idle_jiffies++;
+}
+
+Here, idle_cpu() notes that &rq->wake_list is not empty and
+hence won't consider the CPU as idle. As a result,
+ts->idle_jiffies won't be incremented. But this is wrong because
+we actually account the current jiffy to idle cputime. And that
+jiffy won't get substracted from the nohz time delta. So in the
+end, this jiffy is accounted twice.
+
+Fix this by changing idle_cpu(smp_processor_id()) with
+is_idle_task(current). This way the jiffy is substracted
+correctly even if a ttwu operation is enqueued on the CPU.
+
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Link: http://lkml.kernel.org/r/1349308004-3482-1-git-send-email-fweisbec@gmail.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/time/tick-sched.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/time/tick-sched.c
++++ b/kernel/time/tick-sched.c
+@@ -835,7 +835,7 @@ static enum hrtimer_restart tick_sched_t
+                */
+               if (ts->tick_stopped) {
+                       touch_softlockup_watchdog();
+-                      if (idle_cpu(cpu))
++                      if (is_idle_task(current))
+                               ts->idle_jiffies++;
+               }
+               update_process_times(user_mode(regs));
index d8d94e190bea7e1c8213ea41dec8e701c8f34764..dfb838e89bd35a8ea4976f714899c97c689ebe51 100644 (file)
@@ -38,3 +38,9 @@ xen-bootup-allow-read-write-_cr8-pvops-call.patch
 xen-bootup-allow-read_tscp-call-for-xen-pv-guests.patch
 block-fix-request_queue-flags-initialization.patch
 autofs4-fix-reset-pending-flag-on-mount-fail.patch
+module-taint-kernel-when-lve-module-is-loaded.patch
+video-udlfb-fix-line-counting-in-fb_write.patch
+viafb-don-t-touch-clock-state-on-olpc-xo-1.5.patch
+timekeeping-cast-raw_interval-to-u64-to-avoid-shift-overflow.patch
+timers-fix-endless-looping-between-cascade-and-internal_add_timer.patch
+nohz-fix-one-jiffy-count-too-far-in-idle-cputime.patch
diff --git a/queue-3.6/timekeeping-cast-raw_interval-to-u64-to-avoid-shift-overflow.patch b/queue-3.6/timekeeping-cast-raw_interval-to-u64-to-avoid-shift-overflow.patch
new file mode 100644 (file)
index 0000000..c61bf8e
--- /dev/null
@@ -0,0 +1,33 @@
+From 5b3900cd409466c0070b234d941650685ad0c791 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Tue, 9 Oct 2012 10:18:23 +0300
+Subject: timekeeping: Cast raw_interval to u64 to avoid shift overflow
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit 5b3900cd409466c0070b234d941650685ad0c791 upstream.
+
+We fixed a bunch of integer overflows in timekeeping code during the 3.6
+cycle.  I did an audit based on that and found this potential overflow.
+
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Acked-by: John Stultz <johnstul@us.ibm.com>
+Link: http://lkml.kernel.org/r/20121009071823.GA19159@elgon.mountain
+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
+@@ -1111,7 +1111,7 @@ static cycle_t logarithmic_accumulation(
+       accumulate_nsecs_to_secs(tk);
+       /* Accumulate raw time */
+-      raw_nsecs = tk->raw_interval << shift;
++      raw_nsecs = (u64)tk->raw_interval << shift;
+       raw_nsecs += tk->raw_time.tv_nsec;
+       if (raw_nsecs >= NSEC_PER_SEC) {
+               u64 raw_secs = raw_nsecs;
diff --git a/queue-3.6/timers-fix-endless-looping-between-cascade-and-internal_add_timer.patch b/queue-3.6/timers-fix-endless-looping-between-cascade-and-internal_add_timer.patch
new file mode 100644 (file)
index 0000000..e20c95f
--- /dev/null
@@ -0,0 +1,57 @@
+From 26cff4e2aa4d666dc6a120ea34336b5057e3e187 Mon Sep 17 00:00:00 2001
+From: "Hildner, Christian" <christian.hildner@siemens.com>
+Date: Mon, 8 Oct 2012 15:49:03 +0200
+Subject: timers: Fix endless looping between cascade() and internal_add_timer()
+
+From: "Hildner, Christian" <christian.hildner@siemens.com>
+
+commit 26cff4e2aa4d666dc6a120ea34336b5057e3e187 upstream.
+
+Adding two (or more) timers with large values for "expires" (they have
+to reside within tv5 in the same list) leads to endless looping
+between cascade() and internal_add_timer() in case CONFIG_BASE_SMALL
+is one and jiffies are crossing the value 1 << 18. The bug was
+introduced between 2.6.11 and 2.6.12 (and survived for quite some
+time).
+
+This patch ensures that when cascade() is called timers within tv5 are
+not added endlessly to their own list again, instead they are added to
+the next lower tv level tv4 (as expected).
+
+Signed-off-by: Christian Hildner <christian.hildner@siemens.com>
+Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
+Link: http://lkml.kernel.org/r/98673C87CB31274881CFFE0B65ECC87B0F5FC1963E@DEFTHW99EA4MSX.ww902.siemens.net
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/timer.c |   10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/kernel/timer.c
++++ b/kernel/timer.c
+@@ -63,6 +63,7 @@ EXPORT_SYMBOL(jiffies_64);
+ #define TVR_SIZE (1 << TVR_BITS)
+ #define TVN_MASK (TVN_SIZE - 1)
+ #define TVR_MASK (TVR_SIZE - 1)
++#define MAX_TVAL ((unsigned long)((1ULL << (TVR_BITS + 4*TVN_BITS)) - 1))
+ struct tvec {
+       struct list_head vec[TVN_SIZE];
+@@ -358,11 +359,12 @@ __internal_add_timer(struct tvec_base *b
+               vec = base->tv1.vec + (base->timer_jiffies & TVR_MASK);
+       } else {
+               int i;
+-              /* If the timeout is larger than 0xffffffff on 64-bit
+-               * architectures then we use the maximum timeout:
++              /* If the timeout is larger than MAX_TVAL (on 64-bit
++               * architectures or with CONFIG_BASE_SMALL=1) then we
++               * use the maximum timeout.
+                */
+-              if (idx > 0xffffffffUL) {
+-                      idx = 0xffffffffUL;
++              if (idx > MAX_TVAL) {
++                      idx = MAX_TVAL;
+                       expires = idx + base->timer_jiffies;
+               }
+               i = (expires >> (TVR_BITS + 3 * TVN_BITS)) & TVN_MASK;
diff --git a/queue-3.6/viafb-don-t-touch-clock-state-on-olpc-xo-1.5.patch b/queue-3.6/viafb-don-t-touch-clock-state-on-olpc-xo-1.5.patch
new file mode 100644 (file)
index 0000000..cbc1830
--- /dev/null
@@ -0,0 +1,71 @@
+From 012a1211845eab69a5488d59eb87d24cc518c627 Mon Sep 17 00:00:00 2001
+From: Daniel Drake <dsd@laptop.org>
+Date: Tue, 4 Sep 2012 11:45:32 -0400
+Subject: viafb: don't touch clock state on OLPC XO-1.5
+
+From: Daniel Drake <dsd@laptop.org>
+
+commit 012a1211845eab69a5488d59eb87d24cc518c627 upstream.
+
+As detailed in the thread titled "viafb PLL/clock tweaking causes XO-1.5
+instability," enabling or disabling the IGA1/IGA2 clocks causes occasional
+stability problems during suspend/resume cycles on this platform.
+
+This is rather odd, as the documentation suggests that clocks have two
+states (on/off) and the default (stable) configuration is configured to
+enable the clock only when it is needed. However, explicitly enabling *or*
+disabling the clock triggers this system instability, suggesting that there
+is a 3rd state at play here.
+
+Leaving the clock enable/disable registers alone solves this problem.
+This fixes spurious reboots during suspend/resume behaviour introduced by
+commit b692a63a.
+
+Signed-off-by: Daniel Drake <dsd@laptop.org>
+Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/video/via/via_clock.c |   19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+--- a/drivers/video/via/via_clock.c
++++ b/drivers/video/via/via_clock.c
+@@ -25,6 +25,7 @@
+ #include <linux/kernel.h>
+ #include <linux/via-core.h>
++#include <asm/olpc.h>
+ #include "via_clock.h"
+ #include "global.h"
+ #include "debug.h"
+@@ -289,6 +290,10 @@ static void dummy_set_pll(struct via_pll
+       printk(KERN_INFO "Using undocumented set PLL.\n%s", via_slap);
+ }
++static void noop_set_clock_state(u8 state)
++{
++}
++
+ void via_clock_init(struct via_clock *clock, int gfx_chip)
+ {
+       switch (gfx_chip) {
+@@ -346,4 +351,18 @@ void via_clock_init(struct via_clock *cl
+               break;
+       }
++
++      if (machine_is_olpc()) {
++              /* The OLPC XO-1.5 cannot suspend/resume reliably if the
++               * IGA1/IGA2 clocks are set as on or off (memory rot
++               * occasionally happens during suspend under such
++               * configurations).
++               *
++               * The only known stable scenario is to leave this bits as-is,
++               * which in their default states are documented to enable the
++               * clock only when it is needed.
++               */
++              clock->set_primary_clock_state = noop_set_clock_state;
++              clock->set_secondary_clock_state = noop_set_clock_state;
++      }
+ }
diff --git a/queue-3.6/video-udlfb-fix-line-counting-in-fb_write.patch b/queue-3.6/video-udlfb-fix-line-counting-in-fb_write.patch
new file mode 100644 (file)
index 0000000..d75073d
--- /dev/null
@@ -0,0 +1,33 @@
+From b8c4321f3d194469007f5f5f2b34ec278c264a04 Mon Sep 17 00:00:00 2001
+From: Alexander Holler <holler@ahsoftware.de>
+Date: Tue, 14 Aug 2012 09:11:09 +0200
+Subject: video/udlfb: fix line counting in fb_write
+
+From: Alexander Holler <holler@ahsoftware.de>
+
+commit b8c4321f3d194469007f5f5f2b34ec278c264a04 upstream.
+
+Line 0 and 1 were both written to line 0 (on the display) and all subsequent
+lines had an offset of -1. The result was that the last line on the display
+was never overwritten by writes to /dev/fbN.
+
+Signed-off-by: Alexander Holler <holler@ahsoftware.de>
+Acked-by: Bernie Thompson <bernie@plugable.com>
+Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/video/udlfb.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/video/udlfb.c
++++ b/drivers/video/udlfb.c
+@@ -647,7 +647,7 @@ static ssize_t dlfb_ops_write(struct fb_
+       result = fb_sys_write(info, buf, count, ppos);
+       if (result > 0) {
+-              int start = max((int)(offset / info->fix.line_length) - 1, 0);
++              int start = max((int)(offset / info->fix.line_length), 0);
+               int lines = min((u32)((result / info->fix.line_length) + 1),
+                               (u32)info->var.yres);