]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Apr 2018 13:33:58 +0000 (15:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Apr 2018 13:33:58 +0000 (15:33 +0200)
added patches:
frv-declare-jiffies-to-be-located-in-the-.data-section.patch
jiffies.h-declare-jiffies-and-jiffies_64-with-____cacheline_aligned_in_smp.patch

queue-4.4/frv-declare-jiffies-to-be-located-in-the-.data-section.patch [new file with mode: 0644]
queue-4.4/jiffies.h-declare-jiffies-and-jiffies_64-with-____cacheline_aligned_in_smp.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/frv-declare-jiffies-to-be-located-in-the-.data-section.patch b/queue-4.4/frv-declare-jiffies-to-be-located-in-the-.data-section.patch
new file mode 100644 (file)
index 0000000..aec618f
--- /dev/null
@@ -0,0 +1,78 @@
+From 60b0a8c3d2480f3b57282b47b7cae7ee71c48635 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Fri, 2 Jun 2017 14:46:16 -0700
+Subject: frv: declare jiffies to be located in the .data section
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 60b0a8c3d2480f3b57282b47b7cae7ee71c48635 upstream.
+
+Commit 7c30f352c852 ("jiffies.h: declare jiffies and jiffies_64 with
+____cacheline_aligned_in_smp") removed a section specification from the
+jiffies declaration that caused conflicts on some platforms.
+
+Unfortunately this change broke the build for frv:
+
+  kernel/built-in.o: In function `__do_softirq': (.text+0x6460): relocation truncated to fit: R_FRV_GPREL12 against symbol
+      `jiffies' defined in *ABS* section in .tmp_vmlinux1
+  kernel/built-in.o: In function `__do_softirq': (.text+0x6574): relocation truncated to fit: R_FRV_GPREL12 against symbol
+      `jiffies' defined in *ABS* section in .tmp_vmlinux1
+  kernel/built-in.o: In function `pwq_activate_delayed_work': workqueue.c:(.text+0x15b9c): relocation truncated to fit: R_FRV_GPREL12 against
+      symbol `jiffies' defined in *ABS* section in .tmp_vmlinux1
+  ...
+
+Add __jiffy_arch_data to the declaration of jiffies and use it on frv to
+include the section specification.  For all other platforms
+__jiffy_arch_data (currently) has no effect.
+
+Fixes: 7c30f352c852 ("jiffies.h: declare jiffies and jiffies_64 with ____cacheline_aligned_in_smp")
+Link: http://lkml.kernel.org/r/20170516221333.177280-1-mka@chromium.org
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Tested-by: Guenter Roeck <linux@roeck-us.net>
+Reviewed-by: David Howells <dhowells@redhat.com>
+Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.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>
+
+---
+ arch/frv/include/asm/timex.h |    6 ++++++
+ include/linux/jiffies.h      |    6 +++++-
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+--- a/arch/frv/include/asm/timex.h
++++ b/arch/frv/include/asm/timex.h
+@@ -16,5 +16,11 @@ static inline cycles_t get_cycles(void)
+ #define vxtime_lock()         do {} while (0)
+ #define vxtime_unlock()               do {} while (0)
++/* This attribute is used in include/linux/jiffies.h alongside with
++ * __cacheline_aligned_in_smp. It is assumed that __cacheline_aligned_in_smp
++ * for frv does not contain another section specification.
++ */
++#define __jiffy_arch_data     __attribute__((__section__(".data")))
++
+ #endif
+--- a/include/linux/jiffies.h
++++ b/include/linux/jiffies.h
+@@ -64,13 +64,17 @@ extern int register_refined_jiffies(long
+ /* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */
+ #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
++#ifndef __jiffy_arch_data
++#define __jiffy_arch_data
++#endif
++
+ /*
+  * The 64-bit value is not atomic - you MUST NOT read it
+  * without sampling the sequence number in jiffies_lock.
+  * get_jiffies_64() will do this for you as appropriate.
+  */
+ extern u64 __cacheline_aligned_in_smp jiffies_64;
+-extern unsigned long volatile __cacheline_aligned_in_smp jiffies;
++extern unsigned long volatile __cacheline_aligned_in_smp __jiffy_arch_data jiffies;
+ #if (BITS_PER_LONG < 64)
+ u64 get_jiffies_64(void);
diff --git a/queue-4.4/jiffies.h-declare-jiffies-and-jiffies_64-with-____cacheline_aligned_in_smp.patch b/queue-4.4/jiffies.h-declare-jiffies-and-jiffies_64-with-____cacheline_aligned_in_smp.patch
new file mode 100644 (file)
index 0000000..04d95d0
--- /dev/null
@@ -0,0 +1,76 @@
+From 7c30f352c852bae2715ad65ac4a38ca9af7d7696 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Mon, 8 May 2017 15:55:05 -0700
+Subject: jiffies.h: declare jiffies and jiffies_64 with ____cacheline_aligned_in_smp
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 7c30f352c852bae2715ad65ac4a38ca9af7d7696 upstream.
+
+jiffies_64 is defined in kernel/time/timer.c with
+____cacheline_aligned_in_smp, however this macro is not part of the
+declaration of jiffies and jiffies_64 in jiffies.h.
+
+As a result clang generates the following warning:
+
+  kernel/time/timer.c:57:26: error: section does not match previous declaration [-Werror,-Wsection]
+  __visible u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES;
+                           ^
+  include/linux/cache.h:39:36: note: expanded from macro '__cacheline_aligned_in_smp'
+                                     ^
+  include/linux/cache.h:34:4: note: expanded from macro '__cacheline_aligned'
+                   __section__(".data..cacheline_aligned")))
+                   ^
+  include/linux/jiffies.h:77:12: note: previous attribute is here
+  extern u64 __jiffy_data jiffies_64;
+             ^
+  include/linux/jiffies.h:70:38: note: expanded from macro '__jiffy_data'
+
+Link: http://lkml.kernel.org/r/20170403190200.70273-1-mka@chromium.org
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>
+Cc: Grant Grundler <grundler@chromium.org>
+Cc: Michael Davidson <md@google.com>
+Cc: Greg Hackmann <ghackmann@google.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/jiffies.h |   11 +++--------
+ 1 file changed, 3 insertions(+), 8 deletions(-)
+
+--- a/include/linux/jiffies.h
++++ b/include/linux/jiffies.h
+@@ -1,6 +1,7 @@
+ #ifndef _LINUX_JIFFIES_H
+ #define _LINUX_JIFFIES_H
++#include <linux/cache.h>
+ #include <linux/math64.h>
+ #include <linux/kernel.h>
+ #include <linux/types.h>
+@@ -63,19 +64,13 @@ extern int register_refined_jiffies(long
+ /* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */
+ #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
+-/* some arch's have a small-data section that can be accessed register-relative
+- * but that can only take up to, say, 4-byte variables. jiffies being part of
+- * an 8-byte variable may not be correctly accessed unless we force the issue
+- */
+-#define __jiffy_data  __attribute__((section(".data")))
+-
+ /*
+  * The 64-bit value is not atomic - you MUST NOT read it
+  * without sampling the sequence number in jiffies_lock.
+  * get_jiffies_64() will do this for you as appropriate.
+  */
+-extern u64 __jiffy_data jiffies_64;
+-extern unsigned long volatile __jiffy_data jiffies;
++extern u64 __cacheline_aligned_in_smp jiffies_64;
++extern unsigned long volatile __cacheline_aligned_in_smp jiffies;
+ #if (BITS_PER_LONG < 64)
+ u64 get_jiffies_64(void);
index ce8a9ac1fd7e4730a64ab3c22c5529afdc7ae099..c938f2dc42320dfacba61407830d042c66f08d27 100644 (file)
@@ -19,3 +19,5 @@ genirq-use-cpumask_available-for-check-of-cpumask-variable.patch
 cpumask-add-helper-cpumask_available.patch
 selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch
 fs-compat-remove-warning-from-compatible_ioctl.patch
+jiffies.h-declare-jiffies-and-jiffies_64-with-____cacheline_aligned_in_smp.patch
+frv-declare-jiffies-to-be-located-in-the-.data-section.patch