Re: [PATCH] atmel_serial: Fix break handling

From: Russell King
Date: Mon Jun 18 2007 - 06:34:49 EST


On Mon, Jun 18, 2007 at 01:21:21PM +0300, Ivan Kuten wrote:
> Hi Haavard,
>
> I tried /dev/ttyAT3, break appeared but not the way I expected, after:
> stty -F /dev/ttyAT3 brkint I get:
>
> cat /proc/tty/driver/atmel_serial
> serinfo:1.0 driver revision:
> 0: uart:ATMEL_SERIAL mmio:0xFEFFF200 irq:1 tx:0 rx:0 CTS|DSR|CD|RI
> 1: uart:ATMEL_SERIAL mmio:0xFFFC0000 irq:6 tx:0 rx:0 CTS|DSR|CD|RI
> 2: uart:ATMEL_SERIAL mmio:0xFFFC4000 irq:7 tx:0 rx:0 RI
> 3: uart:ATMEL_SERIAL mmio:0xFFFC8000 irq:8 tx:1530 rx:115 brk:1 RTS|DTR|DSR|CD|RI
> 4: uart:ATMEL_SERIAL mmio:0xFFFCC000 irq:9 tx:0 rx:0 DSR|CD|RI
>
> brk is 1 not depending on how many breaks was sent. May be I missunderstood
> "break" meaning?
> I use from minicom: Main Functions : send break.........F .

Note that if you want to use magic sysrq on ttyAT3, you need the kernel
console on ttyAT3. Since you successfully received one break event on
ttyAT3, the next character should have caused a sysrq event.

> I inserted printk:
>
> /*
> * Control the transmission of a break signal
^^^^^^^^^^^^
So if you're looking at the reception paths, this clearly isn't it...

> */
> static void atmel_break_ctl(struct uart_port *port, int break_state)
> {
> printk(KERN_EMERG "atmel_break_ctl break_state %d", break_state);
> if (break_state != 0)
> UART_PUT_CR(port, ATMEL_US_STTBRK); /* start break */
> else
> UART_PUT_CR(port, ATMEL_US_STPBRK); /* stop break */
> }
>
> it's also not shown.

... and that explains why.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/