public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: "Tosoni" <jp.tosoni@acksys.fr>
To: 'George Spelvin' <linux@horizon.com>
Cc: linux-serial@vger.kernel.org
Subject: RE: serial8250_interrupt idea
Date: Mon, 17 Nov 2008 16:25:45 +0100	[thread overview]
Message-ID: <D0393E26DEF64A21B3FA255589AC9A54@acksys.local> (raw)
In-Reply-To: <20081117134504.22912.qmail@science.horizon.com>

Hi again,

I read your code more carefully and I believe that it does not
exhibit the problem I talked about. Sorry for argueing.

Please note however that these chips can be - and have been indeed -
used at much higher baudrates than the 115200 you mention. Once, I
have been using 1.8 Mbps on 2 ports, over RS422 links.

> I don't see how this means that "one of them gets served much
> more often than the others"; both get served equally often.
 
My wording was wrong, sorry. I rather meant "one of them gets served
before the others can get a chance to be served" so the first one, if
it is continually receiving, many delay service to the next ones, thus
loosing data.

Regards

> -----Original Message-----
> From: linux-serial-owner@vger.kernel.org
> [mailto:linux-serial-owner@vger.kernel.org]On Behalf Of George Spelvin
> Sent: Monday, November 17, 2008 2:45 PM
> To: jp.tosoni@acksys.fr
> Cc: linux@horizon.com; linux-serial@vger.kernel.org
> Subject: Re: serial8250_interrupt idea
> 
> 
> "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.
> --
> To unsubscribe from this list: send the line "unsubscribe 
> linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      parent reply	other threads:[~2008-11-17 15:27 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
2008-11-17 14:08         ` Chris Doré
2008-11-17 15:25         ` Tosoni [this message]

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=D0393E26DEF64A21B3FA255589AC9A54@acksys.local \
    --to=jp.tosoni@acksys.fr \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@horizon.com \
    /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