From 50fc7f8001eaf06f459f7ea07bfcdb3f875ab372 Mon Sep 17 00:00:00 2001 From: Michael O'Reilly Date: Wed, 17 Apr 2013 10:10:44 +0530 Subject: serial: Samsung: Release interrupts on shutdown The serial driver never releases the interrupt on shutdown, but it does repeatedly acquire it on startup. $ cat /proc/interrupts 85: 69 0 GIC exynos4210-uart.2, exynos4210-uart.2, exynos4210-uart.2 Signed-off-by: Michael O'Reilly Signed-off-by: Tushar Behera --- drivers/tty/serial/samsung.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 339951a6e7e..fb4ebae095d 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -524,6 +524,28 @@ static int s3c64xx_serial_startup(struct uart_port *port) return ret; } +static void s3c64xx_serial_shutdown(struct uart_port *port) +{ + struct s3c24xx_uart_port *ourport = to_ourport(port); + + if (ourport->tx_claimed) { + free_irq(port->irq, ourport); + tx_enabled(port) = 0; + ourport->tx_claimed = 0; + } + + if (ourport->rx_claimed) { + ourport->rx_claimed = 0; + rx_enabled(port) = 0; + } + + /* Clear pending interrupts and mask all interrupts */ + if (s3c24xx_serial_has_interrupt_mask(port)) { + wr_regl(port, S3C64XX_UINTP, 0xf); + wr_regl(port, S3C64XX_UINTM, 0xf); + } +} + /* power power management control */ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, @@ -1124,8 +1146,10 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, port->dev = &platdev->dev; /* Startup sequence is different for s3c64xx and higher SoC's */ - if (s3c24xx_serial_has_interrupt_mask(port)) + if (s3c24xx_serial_has_interrupt_mask(port)) { s3c24xx_serial_ops.startup = s3c64xx_serial_startup; + s3c24xx_serial_ops.shutdown = s3c64xx_serial_shutdown; + } port->uartclk = 1; -- cgit v1.2.3