Re: [PATCH 2/3] at91_serial: Fix break handling

Russell King
2006-08-02T15:17:47Z

On Wed, Aug 02, 2006 at 04:51:47PM +0200, Haavard Skinnemoen wrote:
> @@ -269,9 +271,14 @@ static void at91_rx_chars(struct uart_po
> UART_PUT_CR(port, AT91_US_RSTSTA); /* clear error */
> if (status & AT91_US_RXBRK) {
> status &= ~(AT91_US_PARE | AT91_US_FRAME); /* ignore side-effect */
> - port->icount.brk++;
> - if (uart_handle_break(port))
> + if (at91_port->break_active) {
> + at91_port->break_active = 0;
> + } else {
> + at91_port->break_active = 1;
> + port->icount.brk++;
> + uart_handle_break(port);
> goto ignore_char;
> + }

Two points here.

1. Effectively, this just ignores every second break status. We've no idea
_which_ break interrupt is going to be ignored.
2. it breaks break handling. uart_handle_break returns a value for a
reason. Use it - don't unconditionally ignore the received character.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core