From: "George Spelvin" <linux@horizon.com>
To: jp.tosoni@acksys.fr
Cc: linux@horizon.com, linux-serial@vger.kernel.org
Subject: Re: serial8250_interrupt idea
Date: Mon, 17 Nov 2008 08:45:04 -0500 [thread overview]
Message-ID: <20081117134504.22912.qmail@science.horizon.com> (raw)
In-Reply-To: <16F7A0434C94480694C28863602B42A0@acksys.local>
"Tosoni" <jp.tosoni@acksys.fr> wrote:
> I am talking about serial ports sharing the same interrupt.
> Here are more details.
>
> Let's say that you have N ports sharing the same interrupt. When the data
> rate is very high, or the processor is slow, the following may happen
> depending on how you prioritize the ports:
>
> say that high-speed frames of 150 chars arrive on ports X and Y.
>
> 1/ enter ISR
> 2/ test port X => process reception of a char, put it ahead of list
> 3/ during processing of 2/ another char arrived on X ; goto 2
> 4/ during processing of loop 2/ and 3/ many chars arrived on port Y, some
> were lost
> 4/ process Y and other ports
> 5/ All N ports are now quiet; exit ISR
>
> Now you have lost data on port Y because you prioritized X over Y.
>
> Got it ?
I see how some port has to be checked first, so if others share the
same interrupt, they have to be checked second. I don't see how this
means that "one of them gets served much more often than the others";
both get served equally often.
I also don't understand how the above can be a serious problem.
Although slow relative to CPU speeds, the I/O port accesses are extremely
fast relative to serial data transmission rates. Even at 115,200 baud,
characters arrive every 86.8 us. Once the interrupt handler is executing,
bytes are removed from the serial FIFO at around 1 per us. So not even
a full character can arrive at port Y in the time it takes to completely
empty 64 bytes out of port X's FIFO.
In other words, your step 4/ cannot actually happen. If one more
character is enough to cause port Y to overflow, it's perilously close
to overflowing without port X.
next prev parent reply other threads:[~2008-11-17 13:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-13 15:03 serial8250_interrupt idea George Spelvin
2008-11-14 5:30 ` [PATCH 1/2] serial/8250.c: Change to singly linked handler chain George Spelvin
2008-11-14 5:33 ` [PATCH 2/2] serial/8250.c: Use self-adjusting list for port poll order George Spelvin
2008-11-17 9:51 ` serial8250_interrupt idea Tosoni
2008-11-17 10:56 ` George Spelvin
2008-11-17 12:45 ` Tosoni
2008-11-17 13:45 ` George Spelvin [this message]
2008-11-17 14:08 ` Chris Doré
2008-11-17 15:25 ` Tosoni
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=20081117134504.22912.qmail@science.horizon.com \
--to=linux@horizon.com \
--cc=jp.tosoni@acksys.fr \
--cc=linux-serial@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