lkml.org 
[lkml]   [2011]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectatmel_serial: receive data lost in RS485 mode
Hi,

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

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

atmel_start_tx():
...
if (atmel_port->rs485.flags & SER_RS485_ENABLED)
atmel_stop_rx(port);
...

When TX is done it is enabled again:

atmel_tx_dma():
...
if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
/* DMA done, stop TX, start RX for RS485 */
atmel_start_rx(port);
}
...

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.

greets,
ron

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

--
Ronald Wahl - ronald.wahl@raritan.com - 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-06-23 12:17    [W:0.463 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site