From: Greg Kroah-Hartman Date: Fri, 29 Nov 2013 21:06:42 +0000 (-0800) Subject: 3.12-stable patches X-Git-Tag: v3.4.72~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e3767d0c31ebe2cc39354d1117f71b966132fc1;p=thirdparty%2Fkernel%2Fstable-queue.git 3.12-stable patches added patches: alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch devpts-plug-the-memory-leak-in-kill_sb.patch genirq-set-the-irq-thread-policy-without-checking-cap_sys_nice.patch perf-tools-remove-cast-of-non-variadic-function-to-variadic.patch perf-tools-synthesize-anon-mmap-records-again.patch pinctrl-dove-unset-twsi-option3-for-gconfig-as-well.patch rbtree-fix-rbtree_postorder_for_each_entry_safe-iterator.patch regulator-ti-abb-fix-operator-precedence-typo.patch --- diff --git a/queue-3.12/alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch b/queue-3.12/alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch new file mode 100644 index 00000000000..edc86e0cde3 --- /dev/null +++ b/queue-3.12/alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch @@ -0,0 +1,60 @@ +From 98d6f4dd84a134d942827584a3c5f67ffd8ec35f Mon Sep 17 00:00:00 2001 +From: KOSAKI Motohiro +Date: Mon, 14 Oct 2013 17:33:16 -0400 +Subject: alarmtimer: return EINVAL instead of ENOTSUPP if rtcdev doesn't exist + +From: KOSAKI Motohiro + +commit 98d6f4dd84a134d942827584a3c5f67ffd8ec35f upstream. + +Fedora Ruby maintainer reported latest Ruby doesn't work on Fedora Rawhide +on ARM. (http://bugs.ruby-lang.org/issues/9008) + +Because of, commit 1c6b39ad3f (alarmtimers: Return -ENOTSUPP if no +RTC device is present) intruduced to return ENOTSUPP when +clock_get{time,res} can't find a RTC device. However this is incorrect. + +First, ENOTSUPP isn't exported to userland (ENOTSUP or EOPNOTSUP are the +closest userland equivlents). + +Second, Posix and Linux man pages agree that clock_gettime and +clock_getres should return EINVAL if clk_id argument is invalid. +While the arugment that the clockid is valid, but just not supported +on this hardware could be made, this is just a technicality that +doesn't help userspace applicaitons, and only complicates error +handling. + +Thus, this patch changes the code to use EINVAL. + +Cc: Thomas Gleixner +Cc: Frederic Weisbecker +Reported-by: Vit Ondruch +Signed-off-by: KOSAKI Motohiro +[jstultz: Tweaks to commit message to include full rational] +Signed-off-by: John Stultz +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/alarmtimer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/time/alarmtimer.c ++++ b/kernel/time/alarmtimer.c +@@ -490,7 +490,7 @@ static int alarm_clock_getres(const cloc + clockid_t baseid = alarm_bases[clock2alarm(which_clock)].base_clockid; + + if (!alarmtimer_get_rtcdev()) +- return -ENOTSUPP; ++ return -EINVAL; + + return hrtimer_get_res(baseid, tp); + } +@@ -507,7 +507,7 @@ static int alarm_clock_get(clockid_t whi + struct alarm_base *base = &alarm_bases[clock2alarm(which_clock)]; + + if (!alarmtimer_get_rtcdev()) +- return -ENOTSUPP; ++ return -EINVAL; + + *tp = ktime_to_timespec(base->gettime()); + return 0; diff --git a/queue-3.12/devpts-plug-the-memory-leak-in-kill_sb.patch b/queue-3.12/devpts-plug-the-memory-leak-in-kill_sb.patch new file mode 100644 index 00000000000..b4114f524c6 --- /dev/null +++ b/queue-3.12/devpts-plug-the-memory-leak-in-kill_sb.patch @@ -0,0 +1,38 @@ +From 66da0e1f9034140ae2f571ef96e254a25083906c Mon Sep 17 00:00:00 2001 +From: Ilija Hadzic +Date: Tue, 12 Nov 2013 15:11:45 -0800 +Subject: devpts: plug the memory leak in kill_sb + +From: Ilija Hadzic + +commit 66da0e1f9034140ae2f571ef96e254a25083906c upstream. + +When devpts is unmounted, there may be a no-longer-used IDR tree hanging +off the superblock we are about to kill. This needs to be cleaned up +before destroying the SB. + +The leak is usually not a big deal because unmounting devpts is typically +done when shutting down the whole machine. However, shutting down an LXC +container instead of a physical machine exposes the problem (the garbage +is detectable with kmemleak). + +Signed-off-by: Ilija Hadzic +Cc: Sukadev Bhattiprolu +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/devpts/inode.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/fs/devpts/inode.c ++++ b/fs/devpts/inode.c +@@ -498,6 +498,7 @@ static void devpts_kill_sb(struct super_ + { + struct pts_fs_info *fsi = DEVPTS_SB(sb); + ++ ida_destroy(&fsi->allocated_ptys); + kfree(fsi); + kill_litter_super(sb); + } diff --git a/queue-3.12/genirq-set-the-irq-thread-policy-without-checking-cap_sys_nice.patch b/queue-3.12/genirq-set-the-irq-thread-policy-without-checking-cap_sys_nice.patch new file mode 100644 index 00000000000..f6fa2faf609 --- /dev/null +++ b/queue-3.12/genirq-set-the-irq-thread-policy-without-checking-cap_sys_nice.patch @@ -0,0 +1,44 @@ +From bbfe65c219c638e19f1da5adab1005b2d68ca810 Mon Sep 17 00:00:00 2001 +From: Thomas Pfaff +Date: Fri, 11 Oct 2013 13:00:40 +0200 +Subject: genirq: Set the irq thread policy without checking CAP_SYS_NICE + +From: Thomas Pfaff + +commit bbfe65c219c638e19f1da5adab1005b2d68ca810 upstream. + +In commit ee23871389 ("genirq: Set irq thread to RT priority on +creation") we moved the assigment of the thread's priority from the +thread's function into __setup_irq(). That function may run in user +context for instance if the user opens an UART node and then driver +calls requests in the ->open() callback. That user may not have +CAP_SYS_NICE and so the irq thread won't run with the SCHED_OTHER +policy. + +This patch uses sched_setscheduler_nocheck() so we omit the CAP_SYS_NICE +check which is otherwise required for the SCHED_OTHER policy. + +[bigeasy: Rewrite the changelog] + +Signed-off-by: Thomas Pfaff +Cc: Ivo Sieben +Link: http://lkml.kernel.org/r/1381489240-29626-1-git-send-email-bigeasy@linutronix.de +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/irq/manage.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/irq/manage.c ++++ b/kernel/irq/manage.c +@@ -956,7 +956,7 @@ __setup_irq(unsigned int irq, struct irq + goto out_mput; + } + +- sched_setscheduler(t, SCHED_FIFO, ¶m); ++ sched_setscheduler_nocheck(t, SCHED_FIFO, ¶m); + + /* + * We keep the reference to the task struct even if diff --git a/queue-3.12/perf-tools-remove-cast-of-non-variadic-function-to-variadic.patch b/queue-3.12/perf-tools-remove-cast-of-non-variadic-function-to-variadic.patch new file mode 100644 index 00000000000..3771a563ec6 --- /dev/null +++ b/queue-3.12/perf-tools-remove-cast-of-non-variadic-function-to-variadic.patch @@ -0,0 +1,75 @@ +From 53805eca3d89b095062c11a6798689bb0af09216 Mon Sep 17 00:00:00 2001 +From: Michael Hudson-Doyle +Date: Thu, 31 Oct 2013 16:47:45 -0700 +Subject: perf tools: Remove cast of non-variadic function to variadic + +From: Michael Hudson-Doyle + +commit 53805eca3d89b095062c11a6798689bb0af09216 upstream. + +The 4fb71074a570 (perf ui/hist: Consolidate hpp helpers) cset introduced +a cast of percent_color_snprintf to a function pointer type with +varargs. Change percent_color_snprintf to be variadic and remove the +cast. + +The symptom of this was all percentages being reported as 0.00% in perf +report --stdio output on the armhf arch. + +Signed-off-by: Michael Hudson-Doyle +Acked-by: Namhyung Kim +Acked-by: Will Deacon +Cc: Jean Pihet +Cc: Jiri Olsa +Cc: Will Deacon +Link: http://lkml.kernel.org/r/87zjppvw7y.fsf@canonical.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/ui/hist.c | 2 +- + tools/perf/util/color.c | 11 +++++++++-- + tools/perf/util/color.h | 2 +- + 3 files changed, 11 insertions(+), 4 deletions(-) + +--- a/tools/perf/ui/hist.c ++++ b/tools/perf/ui/hist.c +@@ -117,7 +117,7 @@ static int hpp__color_##_type(struct per + struct perf_hpp *hpp, struct hist_entry *he) \ + { \ + return __hpp__fmt(hpp, he, he_get_##_field, " %6.2f%%", \ +- (hpp_snprint_fn)percent_color_snprintf, true); \ ++ percent_color_snprintf, true); \ + } + + #define __HPP_ENTRY_PERCENT_FN(_type, _field) \ +--- a/tools/perf/util/color.c ++++ b/tools/perf/util/color.c +@@ -318,8 +318,15 @@ int percent_color_fprintf(FILE *fp, cons + return r; + } + +-int percent_color_snprintf(char *bf, size_t size, const char *fmt, double percent) ++int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...) + { +- const char *color = get_percent_color(percent); ++ va_list args; ++ double percent; ++ const char *color; ++ ++ va_start(args, fmt); ++ percent = va_arg(args, double); ++ va_end(args); ++ color = get_percent_color(percent); + return color_snprintf(bf, size, color, fmt, percent); + } +--- a/tools/perf/util/color.h ++++ b/tools/perf/util/color.h +@@ -39,7 +39,7 @@ int color_fprintf(FILE *fp, const char * + int color_snprintf(char *bf, size_t size, const char *color, const char *fmt, ...); + int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...); + int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf); +-int percent_color_snprintf(char *bf, size_t size, const char *fmt, double percent); ++int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...); + int percent_color_fprintf(FILE *fp, const char *fmt, double percent); + const char *get_percent_color(double percent); + diff --git a/queue-3.12/perf-tools-synthesize-anon-mmap-records-again.patch b/queue-3.12/perf-tools-synthesize-anon-mmap-records-again.patch new file mode 100644 index 00000000000..c8221f41492 --- /dev/null +++ b/queue-3.12/perf-tools-synthesize-anon-mmap-records-again.patch @@ -0,0 +1,56 @@ +From 9d4ecc8893832337daf241236841db966fa53489 Mon Sep 17 00:00:00 2001 +From: Don Zickus +Date: Wed, 13 Nov 2013 15:32:06 -0300 +Subject: perf tools: Synthesize anon MMAP records again + +From: Don Zickus + +commit 9d4ecc8893832337daf241236841db966fa53489 upstream. + +When introducing the PERF_RECORD_MMAP2 in: + +5c5e854bc760 perf tools: Add attr->mmap2 support + +A check for the number of entries parsed by sscanf was introduced that +assumed all of the 8 fields needed to be correctly parsed so that +particular /proc/pid/maps line would be considered synthesizable. + +That broke anon records synthesizing, as it doesn't have the 'execname' +field. + +Fix it by keeping the sscanf return check, changing it to not require +that the 'execname' variable be parsed, so that the preexisting logic +can kick in and set it to '//anon'. + +This should get things like JIT profiling working again. + +Signed-off-by: Don Zickus +Cc: Bill Gray +Cc: Jiri Olsa +Cc: Joe Mario +Cc: Richard Fowles +Cc: Stephane Eranian +Link: http://lkml.kernel.org/n/tip-bo4akalno7579shpz29u867j@git.kernel.org +[ commit log message is mine, dzickus reported the problem with a patch ] +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/event.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/tools/perf/util/event.c ++++ b/tools/perf/util/event.c +@@ -212,8 +212,10 @@ static int perf_event__synthesize_mmap_e + &event->mmap.start, &event->mmap.len, prot, + &event->mmap.pgoff, + execname); +- +- if (n != 5) ++ /* ++ * Anon maps don't have the execname. ++ */ ++ if (n < 4) + continue; + + if (prot[2] != 'x') diff --git a/queue-3.12/pinctrl-dove-unset-twsi-option3-for-gconfig-as-well.patch b/queue-3.12/pinctrl-dove-unset-twsi-option3-for-gconfig-as-well.patch new file mode 100644 index 00000000000..dc70dc09672 --- /dev/null +++ b/queue-3.12/pinctrl-dove-unset-twsi-option3-for-gconfig-as-well.patch @@ -0,0 +1,31 @@ +From 6d0a4ed2b90a12e1403d3e7d9d8c2cc7fdc301b5 Mon Sep 17 00:00:00 2001 +From: Roel Kluin +Date: Mon, 14 Oct 2013 01:27:27 +0200 +Subject: pinctrl: dove: unset twsi option3 for gconfig as well + +From: Roel Kluin + +commit 6d0a4ed2b90a12e1403d3e7d9d8c2cc7fdc301b5 upstream. + +This fixes a typo which left twsi config3 option enabled. + +Signed-off-by: Roel Kluin +Acked-by: Sebastian Hesselbarth +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pinctrl/mvebu/pinctrl-dove.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pinctrl/mvebu/pinctrl-dove.c ++++ b/drivers/pinctrl/mvebu/pinctrl-dove.c +@@ -335,7 +335,7 @@ static int dove_twsi_ctrl_set(struct mve + unsigned long gcfg2 = readl(DOVE_GLOBAL_CONFIG_2); + + gcfg1 &= ~DOVE_TWSI_ENABLE_OPTION1; +- gcfg2 &= ~(DOVE_TWSI_ENABLE_OPTION2 | DOVE_TWSI_ENABLE_OPTION2); ++ gcfg2 &= ~(DOVE_TWSI_ENABLE_OPTION2 | DOVE_TWSI_ENABLE_OPTION3); + + switch (config) { + case 1: diff --git a/queue-3.12/rbtree-fix-rbtree_postorder_for_each_entry_safe-iterator.patch b/queue-3.12/rbtree-fix-rbtree_postorder_for_each_entry_safe-iterator.patch new file mode 100644 index 00000000000..716f94b9f46 --- /dev/null +++ b/queue-3.12/rbtree-fix-rbtree_postorder_for_each_entry_safe-iterator.patch @@ -0,0 +1,73 @@ +From 1310a5a99d900ee30b9f171146406bde0c6c2bd4 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Tue, 12 Nov 2013 15:11:19 -0800 +Subject: rbtree: fix rbtree_postorder_for_each_entry_safe() iterator + +From: Jan Kara + +commit 1310a5a99d900ee30b9f171146406bde0c6c2bd4 upstream. + +The iterator rbtree_postorder_for_each_entry_safe() relies on pointer +underflow behavior when testing for loop termination. In particular it +expects that + + &rb_entry(NULL, type, field)->field + +is NULL. But the result of this expression is not defined by a C standard +and some gcc versions (e.g. 4.3.4) assume the above expression can never +be equal to NULL. The net result is an oops because the iteration is not +properly terminated. + +Fix the problem by modifying the iterator to avoid pointer underflows. + +Signed-off-by: Jan Kara +Signed-off-by: Cody P Schafer +Cc: Michel Lespinasse +Cc: "David S. Miller" +Cc: Adrian Hunter +Cc: Artem Bityutskiy +Cc: David Woodhouse +Cc: Jozsef Kadlecsik +Cc: Pablo Neira Ayuso +Cc: Patrick McHardy +Cc: Paul Mundt +Cc: Theodore Ts'o +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/rbtree.h | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +--- a/include/linux/rbtree.h ++++ b/include/linux/rbtree.h +@@ -85,6 +85,11 @@ static inline void rb_link_node(struct r + *rb_link = node; + } + ++#define rb_entry_safe(ptr, type, member) \ ++ ({ typeof(ptr) ____ptr = (ptr); \ ++ ____ptr ? rb_entry(____ptr, type, member) : NULL; \ ++ }) ++ + /** + * rbtree_postorder_for_each_entry_safe - iterate over rb_root in post order of + * given type safe against removal of rb_node entry +@@ -95,12 +100,9 @@ static inline void rb_link_node(struct r + * @field: the name of the rb_node field within 'type'. + */ + #define rbtree_postorder_for_each_entry_safe(pos, n, root, field) \ +- for (pos = rb_entry(rb_first_postorder(root), typeof(*pos), field),\ +- n = rb_entry(rb_next_postorder(&pos->field), \ +- typeof(*pos), field); \ +- &pos->field; \ +- pos = n, \ +- n = rb_entry(rb_next_postorder(&pos->field), \ +- typeof(*pos), field)) ++ for (pos = rb_entry_safe(rb_first_postorder(root), typeof(*pos), field); \ ++ pos && ({ n = rb_entry_safe(rb_next_postorder(&pos->field), \ ++ typeof(*pos), field); 1; }); \ ++ pos = n) + + #endif /* _LINUX_RBTREE_H */ diff --git a/queue-3.12/regulator-ti-abb-fix-operator-precedence-typo.patch b/queue-3.12/regulator-ti-abb-fix-operator-precedence-typo.patch new file mode 100644 index 00000000000..46f2fed3677 --- /dev/null +++ b/queue-3.12/regulator-ti-abb-fix-operator-precedence-typo.patch @@ -0,0 +1,32 @@ +From 9a633a2bced158c57b73cf4d8e87be60473de1d2 Mon Sep 17 00:00:00 2001 +From: Nishanth Menon +Date: Fri, 11 Oct 2013 05:04:12 -0500 +Subject: regulator: ti-abb: Fix operator precedence typo + +From: Nishanth Menon + +commit 9a633a2bced158c57b73cf4d8e87be60473de1d2 upstream. + +commit 40b1936e (regulator: Introduce TI Adaptive Body Bias(ABB) on-chip +LDO driver) missed a pair of brackets which cause the wrong vset data to be +picked up from efuse, resulting in bad VBB voltage values. + +Signed-off-by: Nishanth Menon +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/regulator/ti-abb-regulator.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/regulator/ti-abb-regulator.c ++++ b/drivers/regulator/ti-abb-regulator.c +@@ -615,7 +615,7 @@ static int ti_abb_init_table(struct devi + pname, *volt_table, vset_mask); + continue; + } +- info->vset = efuse_val & vset_mask >> __ffs(vset_mask); ++ info->vset = (efuse_val & vset_mask) >> __ffs(vset_mask); + dev_dbg(dev, "[%d]v=%d vset=%x\n", i, *volt_table, info->vset); + check_abb: + switch (info->opp_sel) { diff --git a/queue-3.12/series b/queue-3.12/series index 1a2d7f1d5f2..3b9bd0dc16d 100644 --- a/queue-3.12/series +++ b/queue-3.12/series @@ -23,3 +23,11 @@ asoc-blackfin-fix-missing-break.patch asoc-fsl-imx-pcm-fiq-omit-fiq-counter-to-avoid-harm-in-unbalanced-situations.patch asoc-arizona-set-fll-to-free-run-before-disabling.patch asoc-wm5110-add-post-sysclk-register-patch-for-rev-d-chip.patch +genirq-set-the-irq-thread-policy-without-checking-cap_sys_nice.patch +perf-tools-remove-cast-of-non-variadic-function-to-variadic.patch +perf-tools-synthesize-anon-mmap-records-again.patch +alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch +pinctrl-dove-unset-twsi-option3-for-gconfig-as-well.patch +regulator-ti-abb-fix-operator-precedence-typo.patch +rbtree-fix-rbtree_postorder_for_each_entry_safe-iterator.patch +devpts-plug-the-memory-leak-in-kill_sb.patch