Commit f5ce6edd authored by Russell King's avatar Russell King Committed by Greg Kroah-Hartman

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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7ec75871
......@@ -262,7 +262,7 @@ static unsigned int pl011_read(const struct uart_amba_port *uap,
{
void __iomem *addr = uap->port.membase + pl011_reg_to_offset(uap, reg);
return uap->access_32b ? readl(addr) : readw(addr);
return uap->access_32b ? readl_relaxed(addr) : readw_relaxed(addr);
}
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,
void __iomem *addr = uap->port.membase + pl011_reg_to_offset(uap, reg);
if (uap->access_32b)
writel(val, addr);
writel_relaxed(val, addr);
else
writew(val, addr);
writew_relaxed(val, addr);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment