Will Deacon c139aa60c1 arm64: barriers: fix smp_load_acquire to work with const arguments
A newly introduced function in include/net/sock.h passes a const
argument to smp_load_acquire:

  static inline int sk_state_load(const struct sock *sk)
  {
	return smp_load_acquire(&sk->sk_state);
  }

This cause an allmodconfig build failure, since our underlying
load-acquire implementation does not handle const types correctly:

  include/net/sock.h: In function 'sk_state_load':
  ./arch/arm64/include/asm/barrier.h:71:3: error: read-only variable '___p1' used as 'asm' output
     asm volatile ("ldarb %w0, %1"    \

This patch fixes the problem by reusing the trick in READ_ONCE that
loads via a non-const member of an anonymous union. This has the
advantage of allowing us to use smp_load_acquire on packed structures
(e.g. arch_spinlock_t) as well as primitive types.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Daney <david.daney@cavium.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: David Daney <david.daney@cavium.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-11-18 18:06:43 +00:00
..
2015-11-04 14:47:13 -08:00
2014-04-18 11:40:33 +02:00
2015-10-28 19:09:17 +00:00
2015-11-04 14:47:13 -08:00
2015-11-04 14:47:13 -08:00
2015-11-17 12:05:18 +00:00
2014-11-05 09:03:25 +01:00
2015-07-27 11:08:42 +01:00
2015-09-16 16:53:39 +02:00
2014-09-25 15:35:41 +01:00
2015-04-16 13:58:29 -05:00
2015-11-04 14:47:13 -08:00
2015-10-19 17:55:12 +01:00
2015-05-19 15:27:42 +01:00
2015-10-29 16:55:15 +00:00
2014-11-28 10:24:59 +00:00
2015-10-12 17:46:36 +01:00
2014-07-10 11:06:00 +01:00
2015-10-19 17:55:12 +01:00
2015-10-14 13:51:41 +01:00
2015-10-14 13:51:41 +01:00