public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ronald Wahl <ronald.wahl@raritan.com>
To: linux-kernel@vger.kernel.org
Cc: claudio.scordino@gmail.com
Subject: atmel_serial: receive data lost in RS485 mode
Date: Thu, 23 Jun 2011 12:09:39 +0200	[thread overview]
Message-ID: <4E0310E3.9030605@raritan.com> (raw)

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

                 reply	other threads:[~2011-06-23 10:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4E0310E3.9030605@raritan.com \
    --to=ronald.wahl@raritan.com \
    --cc=claudio.scordino@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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