linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Newbie question: setting baudrate / managing FIFO.
@ 2011-02-16 10:51 Andrei Warkentin
  2011-02-16 19:07 ` Andrei Warkentin
  2011-02-18 20:24 ` Grant Edwards
  0 siblings, 2 replies; 4+ messages in thread
From: Andrei Warkentin @ 2011-02-16 10:51 UTC (permalink / raw)
  To: linux-serial

Hi,

I looked about the archives, but maybe I skipped something... When I
am handling set_termios, what assumptions can I make regarding the
TX/RX state? I didn't take a look at all the serial drivers, but the
ones I did look did not bother flushing FIFOs and ensuring nothing can
be present in the TX FIFO while updating LCR and divisors. Should I do
the equivalent of stop_tx inside set_termios? Is that already ensured?
The hardware I am looking at needs to have FIFO cleared after setting
baud rate, and I was getting concerned over potential data loss
scenarios...

Thanks,
A

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie question: setting baudrate / managing FIFO.
  2011-02-16 10:51 Newbie question: setting baudrate / managing FIFO Andrei Warkentin
@ 2011-02-16 19:07 ` Andrei Warkentin
  2011-02-18 20:15   ` Andrei Warkentin
  2011-02-18 20:24 ` Grant Edwards
  1 sibling, 1 reply; 4+ messages in thread
From: Andrei Warkentin @ 2011-02-16 19:07 UTC (permalink / raw)
  To: linux-serial

On Wed, Feb 16, 2011 at 4:51 AM, Andrei Warkentin <andreiw@motorola.com> wrote:
> Hi,
>
> I looked about the archives, but maybe I skipped something... When I
> am handling set_termios, what assumptions can I make regarding the
> TX/RX state? I didn't take a look at all the serial drivers, but the
> ones I did look did not bother flushing FIFOs and ensuring nothing can
> be present in the TX FIFO while updating LCR and divisors. Should I do
> the equivalent of stop_tx inside set_termios? Is that already ensured?
> The hardware I am looking at needs to have FIFO cleared after setting
> baud rate, and I was getting concerned over potential data loss
> scenarios...
>
> Thanks,
> A
>

I realize there are different versions of the TCSET - TCSETS,
TCSETF... i.e. if you wanted to flush the buffer you'd ask for it. So
it should be ok to just clear the FIFO and destroy anything in them,
right? Or should I still flush the FIFOs after disabling flow control
if it was on? After all you could have gotten data after you called
set_termios.

Thanks,
A

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie question: setting baudrate / managing FIFO.
  2011-02-16 19:07 ` Andrei Warkentin
@ 2011-02-18 20:15   ` Andrei Warkentin
  0 siblings, 0 replies; 4+ messages in thread
From: Andrei Warkentin @ 2011-02-18 20:15 UTC (permalink / raw)
  To: linux-serial

On Wed, Feb 16, 2011 at 1:07 PM, Andrei Warkentin <andreiw@motorola.com> wrote:
> On Wed, Feb 16, 2011 at 4:51 AM, Andrei Warkentin <andreiw@motorola.com> wrote:
>> Hi,
>>
>> I looked about the archives, but maybe I skipped something... When I
>> am handling set_termios, what assumptions can I make regarding the
>> TX/RX state? I didn't take a look at all the serial drivers, but the
>> ones I did look did not bother flushing FIFOs and ensuring nothing can
>> be present in the TX FIFO while updating LCR and divisors. Should I do
>> the equivalent of stop_tx inside set_termios? Is that already ensured?
>> The hardware I am looking at needs to have FIFO cleared after setting
>> baud rate, and I was getting concerned over potential data loss
>> scenarios...
>>
>> Thanks,
>> A
>>
>
> I realize there are different versions of the TCSET - TCSETS,
> TCSETF... i.e. if you wanted to flush the buffer you'd ask for it. So
> it should be ok to just clear the FIFO and destroy anything in them,
> right? Or should I still flush the FIFOs after disabling flow control
> if it was on? After all you could have gotten data after you called
> set_termios.
>
> Thanks,
> A
>

Anyone :)?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie question: setting baudrate / managing FIFO.
  2011-02-16 10:51 Newbie question: setting baudrate / managing FIFO Andrei Warkentin
  2011-02-16 19:07 ` Andrei Warkentin
@ 2011-02-18 20:24 ` Grant Edwards
  1 sibling, 0 replies; 4+ messages in thread
From: Grant Edwards @ 2011-02-18 20:24 UTC (permalink / raw)
  To: linux-serial

On 2011-02-16, Andrei Warkentin <andreiw@motorola.com> wrote:

> I looked about the archives, but maybe I skipped something... When I
> am handling set_termios, what assumptions can I make regarding the
> TX/RX state? I didn't take a look at all the serial drivers, but the
> ones I did look did not bother flushing FIFOs and ensuring nothing can
> be present in the TX FIFO while updating LCR and divisors. Should I do
> the equivalent of stop_tx inside set_termios? Is that already ensured?
> The hardware I am looking at needs to have FIFO cleared after setting
> baud rate, and I was getting concerned over potential data loss
> scenarios...

Somebody who changes baud rate while transmitting is going to lose
data no matter what you choose to do.

So, I wouldn't worry about it.  Change the baud rate when the ioctl()
tells you to, and if you have to clear the FIFO as part of that
operation then do so.

-- 
Grant Edwards               grant.b.edwards        Yow! I just went below the
                                  at               poverty line!
                              gmail.com            


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-18 20:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 10:51 Newbie question: setting baudrate / managing FIFO Andrei Warkentin
2011-02-16 19:07 ` Andrei Warkentin
2011-02-18 20:15   ` Andrei Warkentin
2011-02-18 20:24 ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).