]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 20:35:13 +0000 (13:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 20:35:13 +0000 (13:35 -0700)
added patches:
arm-8429-1-disable-gcc-sra-optimization.patch
perf-header-fixup-reading-of-header_nrcpus-feature.patch
windfarm-decrement-client-count-when-unregistering.patch

queue-3.10/arm-8429-1-disable-gcc-sra-optimization.patch [new file with mode: 0644]
queue-3.10/perf-header-fixup-reading-of-header_nrcpus-feature.patch [new file with mode: 0644]
queue-3.10/series
queue-3.10/windfarm-decrement-client-count-when-unregistering.patch [new file with mode: 0644]

diff --git a/queue-3.10/arm-8429-1-disable-gcc-sra-optimization.patch b/queue-3.10/arm-8429-1-disable-gcc-sra-optimization.patch
new file mode 100644 (file)
index 0000000..e15d85c
--- /dev/null
@@ -0,0 +1,84 @@
+From a077224fd35b2f7fbc93f14cf67074fc792fbac2 Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Date: Thu, 3 Sep 2015 13:24:40 +0100
+Subject: ARM: 8429/1: disable GCC SRA optimization
+
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+
+commit a077224fd35b2f7fbc93f14cf67074fc792fbac2 upstream.
+
+While working on the 32-bit ARM port of UEFI, I noticed a strange
+corruption in the kernel log. The following snprintf() statement
+(in drivers/firmware/efi/efi.c:efi_md_typeattr_format())
+
+       snprintf(pos, size, "|%3s|%2s|%2s|%2s|%3s|%2s|%2s|%2s|%2s]",
+
+was producing the following output in the log:
+
+       |    |   |   |   |    |WB|WT|WC|UC]
+       |    |   |   |   |    |WB|WT|WC|UC]
+       |    |   |   |   |    |WB|WT|WC|UC]
+       |RUN|   |   |   |    |WB|WT|WC|UC]*
+       |RUN|   |   |   |    |WB|WT|WC|UC]*
+       |    |   |   |   |    |WB|WT|WC|UC]
+       |RUN|   |   |   |    |WB|WT|WC|UC]*
+       |    |   |   |   |    |WB|WT|WC|UC]
+       |RUN|   |   |   |    |   |   |   |UC]
+       |RUN|   |   |   |    |   |   |   |UC]
+
+As it turns out, this is caused by incorrect code being emitted for
+the string() function in lib/vsprintf.c. The following code
+
+       if (!(spec.flags & LEFT)) {
+               while (len < spec.field_width--) {
+                       if (buf < end)
+                               *buf = ' ';
+                       ++buf;
+               }
+       }
+       for (i = 0; i < len; ++i) {
+               if (buf < end)
+                       *buf = *s;
+               ++buf; ++s;
+       }
+       while (len < spec.field_width--) {
+               if (buf < end)
+                       *buf = ' ';
+               ++buf;
+       }
+
+when called with len == 0, triggers an issue in the GCC SRA optimization
+pass (Scalar Replacement of Aggregates), which handles promotion of signed
+struct members incorrectly. This is a known but as yet unresolved issue.
+(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932). In this particular
+case, it is causing the second while loop to be executed erroneously a
+single time, causing the additional space characters to be printed.
+
+So disable the optimization by passing -fno-ipa-sra.
+
+Acked-by: Nicolas Pitre <nico@linaro.org>
+Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/Makefile |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/arch/arm/Makefile
++++ b/arch/arm/Makefile
+@@ -55,6 +55,14 @@ endif
+ comma = ,
++#
++# The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and
++# later may result in code being generated that handles signed short and signed
++# char struct members incorrectly. So disable it.
++# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932)
++#
++KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra)
++
+ # This selects which instruction set is used.
+ # Note that GCC does not numerically define an architecture version
+ # macro, but instead defines a whole series of macros which makes
diff --git a/queue-3.10/perf-header-fixup-reading-of-header_nrcpus-feature.patch b/queue-3.10/perf-header-fixup-reading-of-header_nrcpus-feature.patch
new file mode 100644 (file)
index 0000000..403241c
--- /dev/null
@@ -0,0 +1,83 @@
+From caa470475d9b59eeff093ae650800d34612c4379 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+Date: Fri, 11 Sep 2015 12:36:12 -0300
+Subject: perf header: Fixup reading of HEADER_NRCPUS feature
+
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+
+commit caa470475d9b59eeff093ae650800d34612c4379 upstream.
+
+The original patch introducing this header wrote the number of CPUs available
+and online in one order and then swapped those values when reading, fix it.
+
+Before:
+
+  # perf record usleep 1
+  # perf report --header-only | grep 'nrcpus \(online\|avail\)'
+  # nrcpus online : 4
+  # nrcpus avail : 4
+  # echo 0 > /sys/devices/system/cpu/cpu2/online
+  # perf record usleep 1
+  # perf report --header-only | grep 'nrcpus \(online\|avail\)'
+  # nrcpus online : 4
+  # nrcpus avail : 3
+  # echo 0 > /sys/devices/system/cpu/cpu1/online
+  # perf record usleep 1
+  # perf report --header-only | grep 'nrcpus \(online\|avail\)'
+  # nrcpus online : 4
+  # nrcpus avail : 2
+
+After the fix, bringing back the CPUs online:
+
+  # perf report --header-only | grep 'nrcpus \(online\|avail\)'
+  # nrcpus online : 2
+  # nrcpus avail : 4
+  # echo 1 > /sys/devices/system/cpu/cpu2/online
+  # perf record usleep 1
+  # perf report --header-only | grep 'nrcpus \(online\|avail\)'
+  # nrcpus online : 3
+  # nrcpus avail : 4
+  # echo 1 > /sys/devices/system/cpu/cpu1/online
+  # perf record usleep 1
+  # perf report --header-only | grep 'nrcpus \(online\|avail\)'
+  # nrcpus online : 4
+  # nrcpus avail : 4
+
+Acked-by: Namhyung Kim <namhyung@kernel.org>
+Cc: Adrian Hunter <adrian.hunter@intel.com>
+Cc: Borislav Petkov <bp@suse.de>
+Cc: David Ahern <dsahern@gmail.com>
+Cc: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Kan Liang <kan.liang@intel.com>
+Cc: Stephane Eranian <eranian@google.com>
+Cc: Wang Nan <wangnan0@huawei.com>
+Fixes: fbe96f29ce4b ("perf tools: Make perf.data more self-descriptive (v8)")
+Link: http://lkml.kernel.org/r/20150911153323.GP23511@kernel.org
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ tools/perf/util/header.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/tools/perf/util/header.c
++++ b/tools/perf/util/header.c
+@@ -1729,7 +1729,7 @@ static int process_nrcpus(struct perf_fi
+       if (ph->needs_swap)
+               nr = bswap_32(nr);
+-      ph->env.nr_cpus_online = nr;
++      ph->env.nr_cpus_avail = nr;
+       ret = readn(fd, &nr, sizeof(nr));
+       if (ret != sizeof(nr))
+@@ -1738,7 +1738,7 @@ static int process_nrcpus(struct perf_fi
+       if (ph->needs_swap)
+               nr = bswap_32(nr);
+-      ph->env.nr_cpus_avail = nr;
++      ph->env.nr_cpus_online = nr;
+       return 0;
+ }
index 339dd086877c10d73fb364dd83267c3b473006da..7da4580bacd5a1ccb72fda72415d79fe927dae8a 100644 (file)
@@ -1 +1,4 @@
 scsi-fix-scsi_error_handler-vs.-scsi_host_dev_release-race.patch
+perf-header-fixup-reading-of-header_nrcpus-feature.patch
+arm-8429-1-disable-gcc-sra-optimization.patch
+windfarm-decrement-client-count-when-unregistering.patch
diff --git a/queue-3.10/windfarm-decrement-client-count-when-unregistering.patch b/queue-3.10/windfarm-decrement-client-count-when-unregistering.patch
new file mode 100644 (file)
index 0000000..1991674
--- /dev/null
@@ -0,0 +1,34 @@
+From fe2b592173ff0274e70dc44d1d28c19bb995aa7c Mon Sep 17 00:00:00 2001
+From: Paul Bolle <pebolle@tiscali.nl>
+Date: Fri, 31 Jul 2015 14:08:58 +0200
+Subject: windfarm: decrement client count when unregistering
+
+From: Paul Bolle <pebolle@tiscali.nl>
+
+commit fe2b592173ff0274e70dc44d1d28c19bb995aa7c upstream.
+
+wf_unregister_client() increments the client count when a client
+unregisters. That is obviously incorrect. Decrement that client count
+instead.
+
+Fixes: 75722d3992f5 ("[PATCH] ppc64: Thermal control for SMU based machines")
+
+Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/macintosh/windfarm_core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/macintosh/windfarm_core.c
++++ b/drivers/macintosh/windfarm_core.c
+@@ -435,7 +435,7 @@ int wf_unregister_client(struct notifier
+ {
+       mutex_lock(&wf_lock);
+       blocking_notifier_chain_unregister(&wf_client_list, nb);
+-      wf_client_count++;
++      wf_client_count--;
+       if (wf_client_count == 0)
+               wf_stop_thread();
+       mutex_unlock(&wf_lock);