atmel_serial: receive data lost in RS485 mode

From: Ronald Wahl
Date: Thu Jun 23 2011 - 06:15:29 EST


on our AT91 board we use the RS485 mode on the serial port and noticed some data loss in some circumstances. (kernel

What happens is the following: When starting TX the RX part is disabled:

if (atmel_port->rs485.flags & SER_RS485_ENABLED)

When TX is done it is enabled again:

if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
/* DMA done, stop TX, start RX for RS485 */

Since the RS485 mode is only half duplex this looks ok (or at least not wrong) at the first glance but it only works if RX is enabled synchronously when TX is done. Actually it happens under some circumstances that there is a latency between TX done and enabling RX again. All data received during that time is lost.

So the question is: Why disabling RX at all during TX? I can't see any benefit. I removed this two code parts above and all works perfectly well and no data is lost anymore.


PS: I'm not on the list - please keep me in Cc. Thx!

Ronald Wahl - ronald.wahl@xxxxxxxxxxx - Phone +49 375271349-0 Fax -99
Raritan Deutschland GmbH, Kornmarkt 7, 08056 Zwickau, Germany
USt-IdNr. DE813094160, Steuer-Nr. 227/117/01749
Amtsgericht Chemnitz HRB 23605
GeschÃftsfÃhrung: Stuart Hopper, Burkhard Wessler
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at