diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-11-16 12:41:02 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-13 22:59:48 -0500 |
commit | f5ce6edd22cff94e7b4a17f26cad43e60ae3d080 (patch) | |
tree | c8c986ba2bc78c8b3b5a985c4faf4f73791258b4 /drivers/tty | |
parent | 7ec758718920e5e5876d0d02ece6855128c8eb1e (diff) |
tty: amba-pl011: switch to using relaxed IO accessors
Using relaxed IO accessors allows GCC to better optimise this code
as we eliminate the heavy memory barriers - for example, GCC can now
cache the address of a register across a read-modify-write sequence,
rather than reloading the base address, offset and access size flag.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 295f0be128f9..3b24aea343de 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -262,7 +262,7 @@ static unsigned int pl011_read(const struct uart_amba_port *uap, | |||
262 | { | 262 | { |
263 | void __iomem *addr = uap->port.membase + pl011_reg_to_offset(uap, reg); | 263 | void __iomem *addr = uap->port.membase + pl011_reg_to_offset(uap, reg); |
264 | 264 | ||
265 | return uap->access_32b ? readl(addr) : readw(addr); | 265 | return uap->access_32b ? readl_relaxed(addr) : readw_relaxed(addr); |
266 | } | 266 | } |
267 | 267 | ||
268 | static void pl011_write(unsigned int val, const struct uart_amba_port *uap, | 268 | static void pl011_write(unsigned int val, const struct uart_amba_port *uap, |
@@ -271,9 +271,9 @@ static void pl011_write(unsigned int val, const struct uart_amba_port *uap, | |||
271 | void __iomem *addr = uap->port.membase + pl011_reg_to_offset(uap, reg); | 271 | void __iomem *addr = uap->port.membase + pl011_reg_to_offset(uap, reg); |
272 | 272 | ||
273 | if (uap->access_32b) | 273 | if (uap->access_32b) |
274 | writel(val, addr); | 274 | writel_relaxed(val, addr); |
275 | else | 275 | else |
276 | writew(val, addr); | 276 | writew_relaxed(val, addr); |
277 | } | 277 | } |
278 | 278 | ||
279 | /* | 279 | /* |