diff options
-rw-r--r-- | arch/mn10300/kernel/mn10300-serial.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c index b7b5a4c270f5..81d5cb9b6569 100644 --- a/arch/mn10300/kernel/mn10300-serial.c +++ b/arch/mn10300/kernel/mn10300-serial.c | |||
@@ -1374,7 +1374,8 @@ timer_okay: | |||
1374 | if ((new->c_cflag & CREAD) == 0) | 1374 | if ((new->c_cflag & CREAD) == 0) |
1375 | port->uart.ignore_status_mask |= (1 << TTY_NORMAL); | 1375 | port->uart.ignore_status_mask |= (1 << TTY_NORMAL); |
1376 | 1376 | ||
1377 | scxctr |= *port->_control & (SC01CTR_TXE | SC01CTR_RXE | SC01CTR_BKE); | 1377 | scxctr |= SC01CTR_TXE | SC01CTR_RXE; |
1378 | scxctr |= *port->_control & SC01CTR_BKE; | ||
1378 | *port->_control = scxctr; | 1379 | *port->_control = scxctr; |
1379 | 1380 | ||
1380 | spin_unlock_irqrestore(&port->uart.lock, flags); | 1381 | spin_unlock_irqrestore(&port->uart.lock, flags); |
@@ -1720,19 +1721,29 @@ static int mn10300_serial_poll_get_char(struct uart_port *_port) | |||
1720 | 1721 | ||
1721 | _enter("%s", port->name); | 1722 | _enter("%s", port->name); |
1722 | 1723 | ||
1723 | do { | 1724 | if (mn10300_serial_int_tbl[port->rx_irq].port != NULL) { |
1724 | /* pull chars out of the hat */ | 1725 | do { |
1725 | ix = ACCESS_ONCE(port->rx_outp); | 1726 | /* pull chars out of the hat */ |
1726 | if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0) | 1727 | ix = ACCESS_ONCE(port->rx_outp); |
1727 | return NO_POLL_CHAR; | 1728 | if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0) |
1729 | return NO_POLL_CHAR; | ||
1728 | 1730 | ||
1729 | smp_read_barrier_depends(); | 1731 | smp_read_barrier_depends(); |
1730 | ch = port->rx_buffer[ix++]; | 1732 | ch = port->rx_buffer[ix++]; |
1731 | st = port->rx_buffer[ix++]; | 1733 | st = port->rx_buffer[ix++]; |
1732 | smp_mb(); | 1734 | smp_mb(); |
1733 | port->rx_outp = ix & (MNSC_BUFFER_SIZE - 1); | 1735 | port->rx_outp = ix & (MNSC_BUFFER_SIZE - 1); |
1734 | 1736 | ||
1735 | } while (st & (SC01STR_FEF | SC01STR_PEF | SC01STR_OEF)); | 1737 | } while (st & (SC01STR_FEF | SC01STR_PEF | SC01STR_OEF)); |
1738 | } else { | ||
1739 | do { | ||
1740 | st = *port->_status; | ||
1741 | if (st & (SC01STR_FEF | SC01STR_PEF | SC01STR_OEF)) | ||
1742 | continue; | ||
1743 | } while (!(st & SC01STR_RBF)); | ||
1744 | |||
1745 | ch = *port->_rxb; | ||
1746 | } | ||
1736 | 1747 | ||
1737 | return ch; | 1748 | return ch; |
1738 | } | 1749 | } |