提交 f5ce6edd 编写于 作者: R Russell King 提交者: 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: NRussell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: NPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册