From: Haavard Skinnemoen <hskinnemoen@atmel.com>
To: Andrew Victor <andrew@sanpeople.com>
Cc: Russell King <rmk+serial@arm.linux.org.uk>,
linux-kernel@vger.kernel.org,
Haavard Skinnemoen <hskinnemoen@atmel.com>
Subject: [PATCH 2/3] at91_serial: Fix break handling
Date: Wed, 02 Aug 2006 16:51:47 +0200 [thread overview]
Message-ID: <11545303083943-git-send-email-hskinnemoen@atmel.com> (raw)
In-Reply-To: <11545303082669-git-send-email-hskinnemoen@atmel.com>
The RXBRK field in the AT91/AT32 USART status register has the
following definition according to the AT32AP7000 data sheet:
RXBRK: Break Received/End of Break
0: No Break received or End of Break detected since the last RSTSTA.
1: Break Received or End of Break detected since the last RSTSTA.
Thus, for each break, the USART sets the RXBRK bit twice. This patch
modifies the driver to report the break event to the serial core only
once by keeping track of whether a break condition is currently active.
With this patch, SysRq works as expected on the AT32STK1000 board
with an AT32AP7000 CPU.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---
drivers/serial/at91_serial.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/at91_serial.c b/drivers/serial/at91_serial.c
index f2fecc6..c759e7c 100644
--- a/drivers/serial/at91_serial.c
+++ b/drivers/serial/at91_serial.c
@@ -112,6 +112,7 @@ struct at91_uart_port {
struct uart_port uart; /* uart */
struct clk *clk; /* uart clock */
unsigned short suspended; /* is port suspended? */
+ unsigned short break_active;
};
static struct at91_uart_port at91_ports[AT91_NR_UART];
@@ -250,6 +251,7 @@ static void at91_break_ctl(struct uart_p
*/
static void at91_rx_chars(struct uart_port *port, struct pt_regs *regs)
{
+ struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
struct tty_struct *tty = port->info->tty;
unsigned int status, ch, flg;
@@ -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;
+ }
}
if (status & AT91_US_PARE)
port->icount.parity++;
--
1.4.0
next prev parent reply other threads:[~2006-08-02 14:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-02 14:51 [PATCH 0/3] at91_serial: Introduction Haavard Skinnemoen
2006-08-02 14:51 ` [PATCH 1/3] at91_serial: support AVR32 Haavard Skinnemoen
2006-08-02 14:51 ` Haavard Skinnemoen [this message]
2006-08-02 14:51 ` [PATCH 3/3] at91_serial: Fix roundoff error in at91_console_get_options Haavard Skinnemoen
2006-08-02 15:17 ` [PATCH 2/3] at91_serial: Fix break handling Russell King
2006-08-02 16:14 ` Haavard Skinnemoen
2006-08-02 16:21 ` Russell King
2006-08-02 17:39 ` Haavard Skinnemoen
2006-08-02 15:15 ` [PATCH 1/3] at91_serial: support AVR32 Russell King
2006-08-02 16:00 ` Haavard Skinnemoen
2006-08-02 16:03 ` Russell King
2006-08-02 17:27 ` Haavard Skinnemoen
2006-09-23 21:14 ` [PATCH 0/3] at91_serial: Introduction Russell King
2006-09-25 12:01 ` Haavard Skinnemoen
2006-09-25 12:16 ` Russell King
2006-09-26 9:06 ` Andrew Victor
2006-09-26 9:27 ` Haavard Skinnemoen
2006-09-26 9:28 ` Andrew Victor
2006-09-26 9:48 ` Haavard Skinnemoen
2006-09-26 16:03 ` Andrew Victor
2006-09-27 13:31 ` Haavard Skinnemoen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11545303083943-git-send-email-hskinnemoen@atmel.com \
--to=hskinnemoen@atmel.com \
--cc=andrew@sanpeople.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+serial@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome