From 12b2531d0adf256dea0206c472ba8ffef58b65ff Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Wed, 23 May 2012 17:16:59 +0530 Subject: serial: tegra: disable interrupt when changing configuration Disable the interrupts when the baudrate or any uart configuration. This will avoid the interrupt to be call when configuration is getting change. bug 984164 bug 969087 Change-Id: Id008964773237726a0ec4a04c428d3975bf3ebd9 Signed-off-by: Laxman Dewangan Reviewed-on: http://git-master/r/104476 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Pradeep Goudagunta GVS: Gerrit_Virtual_Submit Reviewed-by: David Yu (Engrg-SW) Tested-by: David Yu (Engrg-SW) --- drivers/tty/serial/tegra_hsuart.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers') diff --git a/drivers/tty/serial/tegra_hsuart.c b/drivers/tty/serial/tegra_hsuart.c index 8b65e20c4d3e..484e228dc044 100644 --- a/drivers/tty/serial/tegra_hsuart.c +++ b/drivers/tty/serial/tegra_hsuart.c @@ -1263,6 +1263,12 @@ static void tegra_set_termios(struct uart_port *u, struct ktermios *termios, if (t->rts_active) set_rts(t, false); + /* Clear all interrupts as configuration is going to be change */ + uart_writeb(t, t->ier_shadow | UART_IER_RDI, UART_IER); + uart_readb(t, UART_IER); + uart_writeb(t, 0, UART_IER); + uart_readb(t, UART_IER); + /* Parity */ lcr = t->lcr_shadow; lcr &= ~UART_LCR_PARITY; @@ -1335,6 +1341,13 @@ static void tegra_set_termios(struct uart_port *u, struct ktermios *termios, /* update the port timeout based on new settings */ uart_update_timeout(u, termios->c_cflag, baud); + /* Make sure all write has completed */ + uart_readb(t, UART_IER); + + /* Reenable interrupt */ + uart_writeb(t, t->ier_shadow, UART_IER); + uart_readb(t, UART_IER); + spin_unlock_irqrestore(&u->lock, flags); dev_vdbg(t->uport.dev, "-tegra_set_termios\n"); return; -- cgit v1.2.3