Skip to content

Commit

Permalink
ARM: PL011: Ensure IRQs are disabled in UART interrupt handler
Browse files Browse the repository at this point in the history
As the DMA support introduces a separate interrupt-time callback, our
interrupt handler will not be the only handler which takes the port
lock, so we need to ensure that IRQs are disabled.  We must use the
_irqsave variant so we don't inadvertently enable interrupts.

Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jan 5, 2011
1 parent ffca2b1 commit 963cc98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,11 @@ static void pl011_modem_status(struct uart_amba_port *uap)
static irqreturn_t pl011_int(int irq, void *dev_id)
{
struct uart_amba_port *uap = dev_id;
unsigned long flags;
unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT;
int handled = 0;

spin_lock(&uap->port.lock);
spin_lock_irqsave(&uap->port.lock, flags);

status = readw(uap->port.membase + UART011_MIS);
if (status) {
Expand All @@ -275,7 +276,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id)
handled = 1;
}

spin_unlock(&uap->port.lock);
spin_unlock_irqrestore(&uap->port.lock, flags);

return IRQ_RETVAL(handled);
}
Expand Down

0 comments on commit 963cc98

Please sign in to comment.