summaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-12-22 17:16:09 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-01-05 16:58:47 +0000
commit963cc981af620c7c07b5f6d1ab998b639e90ecb1 (patch)
tree277dc759b7ae9161ca7859437266c521e4cc5d85 /drivers/serial
parentffca2b114c6a804d1307781df687e877a373a1c2 (diff)
downloadop-kernel-dev-963cc981af620c7c07b5f6d1ab998b639e90ecb1.zip
op-kernel-dev-963cc981af620c7c07b5f6d1ab998b639e90ecb1.tar.gz
ARM: PL011: Ensure IRQs are disabled in UART interrupt handler
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>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/amba-pl011.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index f9b6b82..f741a8b 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -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) {
@@ -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);
}
OpenPOWER on IntegriCloud