summaryrefslogtreecommitdiff
path: root/arch/mn10300
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-10-09 09:17:49 -0700
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-12-04 10:52:52 -0800
commita4bd78ed215873a68869e41fd59543be8ca38e7f (patch)
tree9689b1715c8d03a51a718081235ad60385a5fdcd /arch/mn10300
parent40555946447a394889243e4393e312f65d847e1e (diff)
mn10300: READ_ONCE() now implies smp_read_barrier_depends()
Given that READ_ONCE() now implies smp_read_barrier_depends(), there is no need for the open-coded smp_read_barrier_depends() in mn10300_serial_receive_interrupt() and mn10300_serial_poll_get_char(). This commit therefore removes them, but replaces them with comments calling out that carrying dependencies through non-pointers is quite dangerous. Compilers simply know too much about integers. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: David Howells <dhowells@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: <linux-am33-list@redhat.com>
Diffstat (limited to 'arch/mn10300')
-rw-r--r--arch/mn10300/kernel/mn10300-serial.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c
index d7ef1232a82a..4994b570dfd9 100644
--- a/arch/mn10300/kernel/mn10300-serial.c
+++ b/arch/mn10300/kernel/mn10300-serial.c
@@ -550,7 +550,7 @@ try_again:
return;
}
- smp_read_barrier_depends();
+ /* READ_ONCE() enforces dependency, but dangerous through integer!!! */
ch = port->rx_buffer[ix++];
st = port->rx_buffer[ix++];
smp_mb();
@@ -1728,7 +1728,10 @@ static int mn10300_serial_poll_get_char(struct uart_port *_port)
if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0)
return NO_POLL_CHAR;
- smp_read_barrier_depends();
+ /*
+ * READ_ONCE() enforces dependency, but dangerous
+ * through integer!!!
+ */
ch = port->rx_buffer[ix++];
st = port->rx_buffer[ix++];
smp_mb();