Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] 4995/1: <IMX UART>: Do not use URXD_CHARRDY for polling

Do not use the URXD_CHARRDY bit for polling for new characters. This works
on i.MX1, but on MX31 the datasheet states that this bit should not be
used for polling. On MX27 it is even worse, here we get a bus error when
we access the read FIFO when no character is present.
Instead, use USR2_RDR (receive data ready) bit.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Sascha Hauer and committed by
Russell King
0d3c3938 864eeed0

+3 -1
+3 -1
drivers/serial/imx.c
··· 356 356 357 357 spin_lock_irqsave(&sport->port.lock,flags); 358 358 359 - while ((rx = readl(sport->port.membase + URXD0)) & URXD_CHARRDY) { 359 + while (readl(sport->port.membase + USR2) & USR2_RDR) { 360 360 flg = TTY_NORMAL; 361 361 sport->port.icount.rx++; 362 + 363 + rx = readl(sport->port.membase + URXD0); 362 364 363 365 temp = readl(sport->port.membase + USR2); 364 366 if (temp & USR2_BRCD) {