aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-03-26 10:57:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-28 19:03:54 -0400
commitb6ad29355560beef6d127c6d33fb10ec0113bd85 (patch)
treed4a6a09cc1f92d49801a1786e2e40246db50b2e6 /drivers/tty
parentcfcec52e9781f08948c6eb98198d65c45be75a70 (diff)
tty: serial: samsung: Disable interrupts in a suspend-friendly way
Since the interrupt mask register is not preserved across system suspend and it defaults to all interrupts enabled, it is not enough to disable UART interrupt. This patch adds free_irq to port shutdown and mask setting to port startup to handle IRQ disabling in a suspend-friendly way. In addition, a bug caused by multiple request_irq calls in port startup callback is fixed. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/samsung.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 2769a38d15b6..b386fc8a5eec 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -446,6 +446,8 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
446 446
447 /* Clear pending interrupts and mask all interrupts */ 447 /* Clear pending interrupts and mask all interrupts */
448 if (s3c24xx_serial_has_interrupt_mask(port)) { 448 if (s3c24xx_serial_has_interrupt_mask(port)) {
449 free_irq(port->irq, ourport);
450
449 wr_regl(port, S3C64XX_UINTP, 0xf); 451 wr_regl(port, S3C64XX_UINTP, 0xf);
450 wr_regl(port, S3C64XX_UINTM, 0xf); 452 wr_regl(port, S3C64XX_UINTM, 0xf);
451 } 453 }
@@ -505,6 +507,8 @@ static int s3c64xx_serial_startup(struct uart_port *port)
505 dbg("s3c64xx_serial_startup: port=%p (%08lx,%p)\n", 507 dbg("s3c64xx_serial_startup: port=%p (%08lx,%p)\n",
506 port->mapbase, port->membase); 508 port->mapbase, port->membase);
507 509
510 wr_regl(port, S3C64XX_UINTM, 0xf);
511
508 ret = request_irq(port->irq, s3c64xx_serial_handle_irq, IRQF_SHARED, 512 ret = request_irq(port->irq, s3c64xx_serial_handle_irq, IRQF_SHARED,
509 s3c24xx_serial_portname(port), ourport); 513 s3c24xx_serial_portname(port), ourport);
510 if (ret) { 514 if (ret) {