From: Greg Kroah-Hartman Date: Mon, 15 Oct 2012 18:47:55 +0000 (-0700) Subject: 3.6-stable patches X-Git-Tag: v3.0.47~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=736fad6905589f69a38e8e9416b2a280b91588d9;p=thirdparty%2Fkernel%2Fstable-queue.git 3.6-stable patches 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 --- 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 index 00000000000..357c9c800a5 --- /dev/null +++ b/queue-3.6/module-taint-kernel-when-lve-module-is-loaded.patch @@ -0,0 +1,36 @@ +From c99af3752bb52ba3aece5315279a57a477edfaf1 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 22 Jun 2012 13:49:31 -0400 +Subject: module: taint kernel when lve module is loaded + +From: Matthew Garrett + +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 +Cc: Alex Lyashkov +Signed-off-by: Rusty Russell +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..b0ca89caf5d --- /dev/null +++ b/queue-3.6/nohz-fix-one-jiffy-count-too-far-in-idle-cputime.patch @@ -0,0 +1,68 @@ +From 2b17c545a4cdbbbadcd7f1e9684c2d7db8f085a6 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Thu, 4 Oct 2012 01:46:44 +0200 +Subject: nohz: Fix one jiffy count too far in idle cputime + +From: Frederic Weisbecker + +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 +Cc: Peter Zijlstra +Link: http://lkml.kernel.org/r/1349308004-3482-1-git-send-email-fweisbec@gmail.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + 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)); diff --git a/queue-3.6/series b/queue-3.6/series index d8d94e190be..dfb838e89bd 100644 --- a/queue-3.6/series +++ b/queue-3.6/series @@ -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 index 00000000000..c61bf8e095f --- /dev/null +++ b/queue-3.6/timekeeping-cast-raw_interval-to-u64-to-avoid-shift-overflow.patch @@ -0,0 +1,33 @@ +From 5b3900cd409466c0070b234d941650685ad0c791 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Tue, 9 Oct 2012 10:18:23 +0300 +Subject: timekeeping: Cast raw_interval to u64 to avoid shift overflow + +From: Dan Carpenter + +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 +Acked-by: John Stultz +Link: http://lkml.kernel.org/r/20121009071823.GA19159@elgon.mountain +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 +@@ -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 index 00000000000..e20c95f5472 --- /dev/null +++ b/queue-3.6/timers-fix-endless-looping-between-cascade-and-internal_add_timer.patch @@ -0,0 +1,57 @@ +From 26cff4e2aa4d666dc6a120ea34336b5057e3e187 Mon Sep 17 00:00:00 2001 +From: "Hildner, Christian" +Date: Mon, 8 Oct 2012 15:49:03 +0200 +Subject: timers: Fix endless looping between cascade() and internal_add_timer() + +From: "Hildner, Christian" + +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 +Reviewed-by: Jan Kiszka +Link: http://lkml.kernel.org/r/98673C87CB31274881CFFE0B65ECC87B0F5FC1963E@DEFTHW99EA4MSX.ww902.siemens.net +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..cbc18303562 --- /dev/null +++ b/queue-3.6/viafb-don-t-touch-clock-state-on-olpc-xo-1.5.patch @@ -0,0 +1,71 @@ +From 012a1211845eab69a5488d59eb87d24cc518c627 Mon Sep 17 00:00:00 2001 +From: Daniel Drake +Date: Tue, 4 Sep 2012 11:45:32 -0400 +Subject: viafb: don't touch clock state on OLPC XO-1.5 + +From: Daniel Drake + +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 +Signed-off-by: Florian Tobias Schandinat +Signed-off-by: Greg Kroah-Hartman + +--- + 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 + #include ++#include + #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 index 00000000000..d75073d4f52 --- /dev/null +++ b/queue-3.6/video-udlfb-fix-line-counting-in-fb_write.patch @@ -0,0 +1,33 @@ +From b8c4321f3d194469007f5f5f2b34ec278c264a04 Mon Sep 17 00:00:00 2001 +From: Alexander Holler +Date: Tue, 14 Aug 2012 09:11:09 +0200 +Subject: video/udlfb: fix line counting in fb_write + +From: Alexander Holler + +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 +Acked-by: Bernie Thompson +Signed-off-by: Florian Tobias Schandinat +Signed-off-by: Greg Kroah-Hartman + +--- + 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); +