From: Dick Hollenbeck <dick@softplc.com>
To: Paul Fulghum <paulkf@microgate.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:32:24 -0600 [thread overview]
Message-ID: <43837248.5050601@softplc.com> (raw)
In-Reply-To: <43836D8C.3040307@microgate.com>
Paul Fulghum wrote:
> 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?
>
Thanks Paul. This sounds right. No, I have not dialed in at such a
fine granularity. Obviously at a non realtime priority things work OK,
and obviously I need to run at a realtime priority. There may be some
room to fit in between.
1) Can you point me at the source file(s) where I can explore this
further? (source file the workqueue written to).
2) How do I determine the priority of the events kernel thread (where is
it created, and/or priority set).
Thanks much.
next prev parent reply other threads:[~2005-11-22 19:30 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
2005-11-22 19:32 ` Dick Hollenbeck [this message]
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=43837248.5050601@softplc.com \
--to=dick@softplc.com \
--cc=linux-serial@vger.kernel.org \
--cc=paulkf@microgate.com \
--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).