From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/7] ARM: PL011: Ensure IRQs are disabled in UART interrupt handler
Date: Mon, 03 Jan 2011 10:09:39 +0000 [thread overview]
Message-ID: <E1PZhMB-0007ph-P2@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20110103100753.GB26785@n2100.arm.linux.org.uk>
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>
---
drivers/serial/amba-pl011.c | 5 +++--
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);
}
--
1.6.2.5
next prev parent reply other threads:[~2011-01-03 10:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-03 10:07 [PATCH 0/7] PL011 DMA support Russell King - ARM Linux
2011-01-03 10:08 ` [PATCH 1/7] ARM: PL011: include revision number in boot-time port printk Russell King - ARM Linux
2011-01-03 10:08 ` [PATCH 2/7] ARM: PL011: Ensure error flags are clear at startup Russell King - ARM Linux
2011-01-03 10:08 ` [PATCH 3/7] ARM: PL011: Allow better handling of vendor data Russell King - ARM Linux
2011-01-03 10:09 ` [PATCH 4/7] ARM: PL011: Separate hardware FIFO size from TTY FIFO size Russell King - ARM Linux
2011-01-03 10:09 ` Russell King - ARM Linux [this message]
2011-01-03 10:10 ` [PATCH 6/7] ARM: PL011: Add support for transmit DMA Russell King - ARM Linux
2011-01-03 11:12 ` Rabin Vincent
2011-01-03 16:30 ` Russell King - ARM Linux
2011-01-03 10:10 ` [PATCH 7/7] ARM: PL011: add DMA burst threshold support for ST variants Russell King - ARM Linux
2011-01-03 11:01 ` [PATCH 0/7] PL011 DMA support Russell King - ARM Linux
2011-01-05 12:32 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1PZhMB-0007ph-P2@rmk-PC.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.