Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340370
b: refs/heads/master
c: 0369c36
h: refs/heads/master
v: v3
  • Loading branch information
Mark Salter authored and David Howells committed Dec 12, 2012
1 parent c97f216 commit 90ede22
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 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: 97a70b14395be0ca61b9fa56f8ff5f6313c26423
refs/heads/master: 0369c360e5825e34ff58c140aa7fbb9855ad1e4a
35 changes: 23 additions & 12 deletions trunk/arch/mn10300/kernel/mn10300-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,8 @@ static void mn10300_serial_change_speed(struct mn10300_serial_port *port,
if ((new->c_cflag & CREAD) == 0)
port->uart.ignore_status_mask |= (1 << TTY_NORMAL);

scxctr |= *port->_control & (SC01CTR_TXE | SC01CTR_RXE | SC01CTR_BKE);
scxctr |= SC01CTR_TXE | SC01CTR_RXE;
scxctr |= *port->_control & SC01CTR_BKE;
*port->_control = scxctr;

spin_unlock_irqrestore(&port->uart.lock, flags);
Expand Down Expand Up @@ -1720,19 +1721,29 @@ static int mn10300_serial_poll_get_char(struct uart_port *_port)

_enter("%s", port->name);

do {
/* pull chars out of the hat */
ix = ACCESS_ONCE(port->rx_outp);
if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0)
return NO_POLL_CHAR;
if (mn10300_serial_int_tbl[port->rx_irq].port != NULL) {
do {
/* pull chars out of the hat */
ix = ACCESS_ONCE(port->rx_outp);
if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0)
return NO_POLL_CHAR;

smp_read_barrier_depends();
ch = port->rx_buffer[ix++];
st = port->rx_buffer[ix++];
smp_mb();
port->rx_outp = ix & (MNSC_BUFFER_SIZE - 1);
smp_read_barrier_depends();
ch = port->rx_buffer[ix++];
st = port->rx_buffer[ix++];
smp_mb();
port->rx_outp = ix & (MNSC_BUFFER_SIZE - 1);

} while (st & (SC01STR_FEF | SC01STR_PEF | SC01STR_OEF));
} while (st & (SC01STR_FEF | SC01STR_PEF | SC01STR_OEF));
} else {
do {
st = *port->_status;
if (st & (SC01STR_FEF | SC01STR_PEF | SC01STR_OEF))
continue;
} while (!(st & SC01STR_RBF));

ch = *port->_rxb;
}

return ch;
}
Expand Down

0 comments on commit 90ede22

Please sign in to comment.