From f2f5e04c75c11d7e97d2fd24c162de3994451289 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 29 Jul 2019 12:52:17 -0700 Subject: [PATCH] tty: serial: fsl_lpuart: Use cpu_relax() instead of barrier() Use cpu_relax() instead of barrier() in a tight polling loops to make them a bit more idiomatic. Should also improve things on ARM64 a bit since cpu_relax() will expand into "yield" instruction there. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-imx@nxp.com Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20190729195226.8862-16-andrew.smirnov@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index eb748ef..58043e0 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -553,14 +553,14 @@ static void lpuart_wait_bit_set(struct uart_port *port, unsigned int offset, u8 bit) { while (!(readb(port->membase + offset) & bit)) - barrier(); + cpu_relax(); } static void lpuart32_wait_bit_set(struct uart_port *port, unsigned int offset, u32 bit) { while (!(lpuart32_read(port, offset) & bit)) - barrier(); + cpu_relax(); } #if defined(CONFIG_CONSOLE_POLL) -- 2.7.4