Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47536
b: refs/heads/master
c: f574874
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Feb 11, 2007
1 parent c5b8431 commit 6d225b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 765d94c1b37d08be02eea6abbff70c0fda0ba984
refs/heads/master: f574874bc861414bbae220b1fe623cbdd098243b
22 changes: 9 additions & 13 deletions trunk/drivers/char/mxser_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -2073,9 +2073,6 @@ static void mxser_receive_chars(struct mxser_port *port, int *status)
int cnt = 0;
int recv_room;
int max = 256;
unsigned long flags;

spin_lock_irqsave(&port->slock, flags);

recv_room = tty->receive_room;
if ((recv_room == 0) && (!port->ldisc_stop_rx))
Expand Down Expand Up @@ -2159,17 +2156,13 @@ static void mxser_receive_chars(struct mxser_port *port, int *status)
mxvar_log.rxcnt[port->tty->index] += cnt;
port->mon_data.rxcnt += cnt;
port->mon_data.up_rxcnt += cnt;
spin_unlock_irqrestore(&port->slock, flags);

tty_flip_buffer_push(tty);
}

static void mxser_transmit_chars(struct mxser_port *port)
{
int count, cnt;
unsigned long flags;

spin_lock_irqsave(&port->slock, flags);

if (port->x_char) {
outb(port->x_char, port->ioaddr + UART_TX);
Expand All @@ -2178,19 +2171,19 @@ static void mxser_transmit_chars(struct mxser_port *port)
port->mon_data.txcnt++;
port->mon_data.up_txcnt++;
port->icount.tx++;
goto unlock;
return;
}

if (port->xmit_buf == 0)
goto unlock;
return;

if ((port->xmit_cnt <= 0) || port->tty->stopped ||
(port->tty->hw_stopped &&
(port->type != PORT_16550A) &&
(!port->board->chip_flag))) {
port->IER &= ~UART_IER_THRI;
outb(port->IER, port->ioaddr + UART_IER);
goto unlock;
return;
}

cnt = port->xmit_cnt;
Expand All @@ -2215,8 +2208,6 @@ static void mxser_transmit_chars(struct mxser_port *port)
port->IER &= ~UART_IER_THRI;
outb(port->IER, port->ioaddr + UART_IER);
}
unlock:
spin_unlock_irqrestore(&port->slock, flags);
}

/*
Expand Down Expand Up @@ -2257,12 +2248,16 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id)
port = &brd->ports[i];

int_cnt = 0;
spin_lock(&port->slock);
do {
iir = inb(port->ioaddr + UART_IIR);
if (iir & UART_IIR_NO_INT)
break;
iir &= MOXA_MUST_IIR_MASK;
if (!port->tty) {
if (!port->tty ||
(port->flags & ASYNC_CLOSING) ||
!(port->flags &
ASYNC_INITIALIZED)) {
status = inb(port->ioaddr + UART_LSR);
outb(0x27, port->ioaddr + UART_FCR);
inb(port->ioaddr + UART_MSR);
Expand Down Expand Up @@ -2308,6 +2303,7 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id)
mxser_transmit_chars(port);
}
} while (int_cnt++ < MXSER_ISR_PASS_LIMIT);
spin_unlock(&port->slock);
}
if (pass_counter++ > MXSER_ISR_PASS_LIMIT)
break; /* Prevent infinite loops */
Expand Down

0 comments on commit 6d225b8

Please sign in to comment.