summaryrefslogtreecommitdiffstats
path: root/drivers/serial/uartlite.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2009-09-09 16:54:04 +0200
committerLive-CD User <linux@linux.site>2009-09-19 22:13:38 +0200
commitd2cfe9628c6187cafd1aac32a44dcd9ed7adb5fe (patch)
tree8d341d3df935aa1710df451975f80eebdf3e61c2 /drivers/serial/uartlite.c
parenttty: USB: serial/mct_u232, fix tty refcnt (diff)
downloadlinux-d2cfe9628c6187cafd1aac32a44dcd9ed7adb5fe.tar.xz
linux-d2cfe9628c6187cafd1aac32a44dcd9ed7adb5fe.zip
uartlite: support shared interrupt lines
Adapt isr to work with shared interrupt lines. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/uartlite.c')
-rw-r--r--drivers/serial/uartlite.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 5d3a573d6994..377f2712289e 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -154,17 +154,22 @@ static int ulite_transmit(struct uart_port *port, int stat)
static irqreturn_t ulite_isr(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
- int busy;
+ int busy, n = 0;
do {
int stat = readb(port->membase + ULITE_STATUS);
busy = ulite_receive(port, stat);
busy |= ulite_transmit(port, stat);
+ n++;
} while (busy);
- tty_flip_buffer_push(port->state->port.tty);
-
- return IRQ_HANDLED;
+ /* work done? */
+ if (n > 1) {
+ tty_flip_buffer_push(port->state->port.tty);
+ return IRQ_HANDLED;
+ } else {
+ return IRQ_NONE;
+ }
}
static unsigned int ulite_tx_empty(struct uart_port *port)
@@ -221,7 +226,7 @@ static int ulite_startup(struct uart_port *port)
int ret;
ret = request_irq(port->irq, ulite_isr,
- IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "uartlite", port);
+ IRQF_SHARED | IRQF_SAMPLE_RANDOM, "uartlite", port);
if (ret)
return ret;