From: Fabio Estevam <festevam@xxxxxxxxx> Sent: Sunday, February 08, 2015 1:47 AM > To: gregkh@xxxxxxxxxxxxxxxxxxx > Cc: Duan Fugang-B38611; linux-serial@xxxxxxxxxxxxxxx; Estevam Fabio-R49496 > Subject: [PATCH] serial: imx: Do not store/restore the UBRC register > > From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx> > > UBRC is a read-only register, so we should not store and restore it inside > imx_flush_buffer(). > > Reported-by: Fugang Duan <B38611@xxxxxxxxxxxxx> > Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx> > --- > drivers/tty/serial/imx.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index > 0eb29b1..e8fe2cb 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -1320,7 +1320,7 @@ static void imx_flush_buffer(struct uart_port *port) > struct imx_port *sport = (struct imx_port *)port; > struct scatterlist *sgl = &sport->tx_sgl[0]; > unsigned long temp; > - int i = 100, ubir, ubmr, ubrc, uts; > + int i = 100, ubir, ubmr, uts; > > if (!sport->dma_chan_tx) > return; > @@ -1345,7 +1345,6 @@ static void imx_flush_buffer(struct uart_port *port) > */ > ubir = readl(sport->port.membase + UBIR); > ubmr = readl(sport->port.membase + UBMR); > - ubrc = readl(sport->port.membase + UBRC); > uts = readl(sport->port.membase + IMX21_UTS); > > temp = readl(sport->port.membase + UCR2); @@ -1358,7 +1357,6 @@ static > void imx_flush_buffer(struct uart_port *port) > /* Restore the registers */ > writel(ubir, sport->port.membase + UBIR); > writel(ubmr, sport->port.membase + UBMR); > - writel(ubrc, sport->port.membase + UBRC); > writel(uts, sport->port.membase + IMX21_UTS); } > > -- For i.MX7D, write uart IP read-only register will cause bus error. I has one similar patch in fsl internal tree 3.14. Acked-by: Fugang Duan <B38611@xxxxxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html