linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Fulghum <paulkf@microgate.com>
To: Dick Hollenbeck <dick@softplc.com>
Cc: rmk+serial@arm.linux.org.uk, linux-serial@vger.kernel.org
Subject: Re: PROBLEM: serial port FIONREAD from realtime thread
Date: Tue, 22 Nov 2005 13:12:12 -0600	[thread overview]
Message-ID: <43836D8C.3040307@microgate.com> (raw)
In-Reply-To: <43834F70.4010404@softplc.com>

Dick Hollenbeck wrote:
> Problem Conditions:
> 
> 1) linux 2.6.11.7, but possibly other kernels too
> 1) realtime thread
> 2) serial port open()ed *either* with NON_BLOCKING or not
> 3) ioctl( FIONREAD ) always returns zero
> ...
> What causes this?   What is the usleep() enabling?

The tty flip buffering uses a workqueue
to push received data to the line discipline.

Your polling loop at raised priority
is probably preventing the workqueue
from being processed by the events
kernel thread.

When you call usleep() your process yields
so receive data can be processed.

Have you tried (just for testing)
lowering your process priority below that
of the events kernel thread?

-- 
Paul Fulghum
Microgate Systems, Ltd.

  reply	other threads:[~2005-11-22 19:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22 17:03 PROBLEM: serial port FIONREAD from realtime thread Dick Hollenbeck
2005-11-22 19:12 ` Paul Fulghum [this message]
2005-11-22 19:32   ` Dick Hollenbeck
2005-11-22 19:53     ` Paul Fulghum

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=43836D8C.3040307@microgate.com \
    --to=paulkf@microgate.com \
    --cc=dick@softplc.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=rmk+serial@arm.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).