aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2012-12-12 10:36:39 -0500
committerDavid Howells <dhowells@redhat.com>2012-12-12 10:46:14 -0500
commit0369c360e5825e34ff58c140aa7fbb9855ad1e4a (patch)
tree871be10d0b14cf2a48039647fbf39ca7609e49fd /arch/mn10300/kernel
parent97a70b14395be0ca61b9fa56f8ff5f6313c26423 (diff)
MN10300: fix debug polling in ttySM driver
The debug polling interface for the SoC serial ports did not work in the case where the serial ports were not also used as a console. In that case, the uart driver startup function will not be called so tx and rx would not be enabled in the hardware control register. Also, vdma interrupts would not be enabled which the poll_get_char function relied on. This patch makes sure that the rx and tx enables are set as a consequence of the uart set_termios call which is the only initialization done for the debug polling interface. Also, the poll_get_char now handles the case where vdma interrupts are not enabled. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300/kernel')
-rw-r--r--arch/mn10300/kernel/mn10300-serial.c35
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}