aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2013-07-04 05:28:51 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-26 19:33:59 -0400
commitd970d7fe65adff5efe75b4a73c4ffc9be57089f7 (patch)
tree3dc57f349b1c3e248a9054f004344494c2da100d
parent3bf5d350586d98eb28ab7f86ffbd66518ffd95d8 (diff)
serial/mxs-auart: fix race condition in interrupt handler
The handler needs to ack the pending events before actually handling them. Otherwise a new event might come in after it it considered non-pending or handled and is acked then without being handled. So this event is only noticed when the next interrupt happens. Without this patch an i.MX28 based machine running an rt-patched kernel regularly hangs during boot. Cc: stable@vger.kernel.org # v2.6.39+ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/mxs-auart.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 4f5f161896a1..3de0fb2712f5 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -678,11 +678,18 @@ static void mxs_auart_settermios(struct uart_port *u,
678 678
679static irqreturn_t mxs_auart_irq_handle(int irq, void *context) 679static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
680{ 680{
681 u32 istatus, istat; 681 u32 istat;
682 struct mxs_auart_port *s = context; 682 struct mxs_auart_port *s = context;
683 u32 stat = readl(s->port.membase + AUART_STAT); 683 u32 stat = readl(s->port.membase + AUART_STAT);
684 684
685 istatus = istat = readl(s->port.membase + AUART_INTR); 685 istat = readl(s->port.membase + AUART_INTR);
686
687 /* ack irq */
688 writel(istat & (AUART_INTR_RTIS
689 | AUART_INTR_TXIS
690 | AUART_INTR_RXIS
691 | AUART_INTR_CTSMIS),
692 s->port.membase + AUART_INTR_CLR);
686 693
687 if (istat & AUART_INTR_CTSMIS) { 694 if (istat & AUART_INTR_CTSMIS) {
688 uart_handle_cts_change(&s->port, stat & AUART_STAT_CTS); 695 uart_handle_cts_change(&s->port, stat & AUART_STAT_CTS);
@@ -702,12 +709,6 @@ static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
702 istat &= ~AUART_INTR_TXIS; 709 istat &= ~AUART_INTR_TXIS;
703 } 710 }
704 711
705 writel(istatus & (AUART_INTR_RTIS
706 | AUART_INTR_TXIS
707 | AUART_INTR_RXIS
708 | AUART_INTR_CTSMIS),
709 s->port.membase + AUART_INTR_CLR);
710
711 return IRQ_HANDLED; 712 return IRQ_HANDLED;
712} 713}
713 714