All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] frv: Declare jiffies to be located in the .data section
@ 2017-05-16 22:13 Matthias Kaehlcke
  2017-05-16 22:28 ` Guenter Roeck
  2017-05-24 12:53 ` David Howells
  0 siblings, 2 replies; 3+ messages in thread
From: Matthias Kaehlcke @ 2017-05-16 22:13 UTC (permalink / raw)
  To: David Howells, Guenter Roeck, Andrew Morton, Sudip Mukherjee
  Cc: linux-kernel, Matthias Kaehlcke

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")
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 arch/frv/include/asm/timex.h | 6 ++++++
 include/linux/jiffies.h      | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/frv/include/asm/timex.h b/arch/frv/include/asm/timex.h
index a89bddefdacf..139093fab326 100644
--- 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
 
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 36872fbb815d..734377ad42e9 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -64,13 +64,17 @@ extern int register_refined_jiffies(long clock_tick_rate);
 /* 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);
-- 
2.13.0.303.g4ebf302169-goog

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] frv: Declare jiffies to be located in the .data section
  2017-05-16 22:13 [PATCH] frv: Declare jiffies to be located in the .data section Matthias Kaehlcke
@ 2017-05-16 22:28 ` Guenter Roeck
  2017-05-24 12:53 ` David Howells
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2017-05-16 22:28 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: David Howells, Andrew Morton, Sudip Mukherjee, linux-kernel

On Tue, May 16, 2017 at 03:13:33PM -0700, Matthias Kaehlcke wrote:
> 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")
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>

Tested-by: Guenter Roeck <linux@roeck-us.net>

[frv:defconfig and x86_64:defconfig]

> ---
>  arch/frv/include/asm/timex.h | 6 ++++++
>  include/linux/jiffies.h      | 6 +++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/frv/include/asm/timex.h b/arch/frv/include/asm/timex.h
> index a89bddefdacf..139093fab326 100644
> --- 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
>  
> diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
> index 36872fbb815d..734377ad42e9 100644
> --- a/include/linux/jiffies.h
> +++ b/include/linux/jiffies.h
> @@ -64,13 +64,17 @@ extern int register_refined_jiffies(long clock_tick_rate);
>  /* 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);
> -- 
> 2.13.0.303.g4ebf302169-goog
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] frv: Declare jiffies to be located in the .data section
  2017-05-16 22:13 [PATCH] frv: Declare jiffies to be located in the .data section Matthias Kaehlcke
  2017-05-16 22:28 ` Guenter Roeck
@ 2017-05-24 12:53 ` David Howells
  1 sibling, 0 replies; 3+ messages in thread
From: David Howells @ 2017-05-24 12:53 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: dhowells, Guenter Roeck, Andrew Morton, Sudip Mukherjee, linux-kernel

Matthias Kaehlcke <mka@chromium.org> wrote:

> 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")
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>

Reviewed-by: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-24 12:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 22:13 [PATCH] frv: Declare jiffies to be located in the .data section Matthias Kaehlcke
2017-05-16 22:28 ` Guenter Roeck
2017-05-24 12:53 ` David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.