Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283578
b: refs/heads/master
c: d97fbbe
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Nov 24, 2011
1 parent f7125bc commit d19414d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0979e0e641d21d3bb318da90a64fc0024a95f50e
refs/heads/master: d97fbbed6e5bb37df75be8993bb0c61adb7d3558
16 changes: 16 additions & 0 deletions trunk/drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ static void sci_receive_chars(struct uart_port *port)
} else {
for (i = 0; i < count; i++) {
char c = sci_in(port, SCxRDR);

status = sci_in(port, SCxSR);
#if defined(CONFIG_CPU_SH3)
/* Skip "chars" during break */
Expand Down Expand Up @@ -649,9 +650,11 @@ static void sci_receive_chars(struct uart_port *port)
/* Store data and status */
if (status & SCxSR_FER(port)) {
flag = TTY_FRAME;
port->icount.frame++;
dev_notice(port->dev, "frame error\n");
} else if (status & SCxSR_PER(port)) {
flag = TTY_PARITY;
port->icount.parity++;
dev_notice(port->dev, "parity error\n");
} else
flag = TTY_NORMAL;
Expand Down Expand Up @@ -723,6 +726,8 @@ static int sci_handle_errors(struct uart_port *port)
*/
if (s->cfg->overrun_bit != SCIx_NOT_SUPPORTED) {
if (status & (1 << s->cfg->overrun_bit)) {
port->icount.overrun++;

/* overrun error */
if (tty_insert_flip_char(tty, 0, TTY_OVERRUN))
copied++;
Expand All @@ -737,6 +742,8 @@ static int sci_handle_errors(struct uart_port *port)
struct sci_port *sci_port = to_sci_port(port);

if (!sci_port->break_flag) {
port->icount.brk++;

sci_port->break_flag = 1;
sci_schedule_break_timer(sci_port);

Expand All @@ -752,6 +759,8 @@ static int sci_handle_errors(struct uart_port *port)

} else {
/* frame error */
port->icount.frame++;

if (tty_insert_flip_char(tty, 0, TTY_FRAME))
copied++;

Expand All @@ -761,6 +770,8 @@ static int sci_handle_errors(struct uart_port *port)

if (status & SCxSR_PER(port)) {
/* parity error */
port->icount.parity++;

if (tty_insert_flip_char(tty, 0, TTY_PARITY))
copied++;

Expand All @@ -787,6 +798,8 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
if ((sci_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) {
sci_out(port, SCLSR, 0);

port->icount.overrun++;

tty_insert_flip_char(tty, 0, TTY_OVERRUN);
tty_flip_buffer_push(tty);

Expand All @@ -812,6 +825,9 @@ static int sci_handle_breaks(struct uart_port *port)
/* Debounce break */
s->break_flag = 1;
#endif

port->icount.brk++;

/* Notify of BREAK */
if (tty_insert_flip_char(tty, 0, TTY_BREAK))
copied++;
Expand Down

0 comments on commit d19414d

Please sign in to comment.