Re: [RFC 2/2] serial/8250.c: Use self-adjusting list for port pollorder.

From: Theodore Tso
Date: Sun Nov 16 2008 - 11:23:56 EST


On Sun, Nov 16, 2008 at 10:23:52AM -0500, George Spelvin wrote:
> Re: shared IRQs and PCI bus...
> In desktop hardware, yes. But PC-104 equipment (for the benefit of
> confused bystandaers, that's classic ISA bus in a different form factor)
> is still going strong; I just added an 8-port serial card to a little
> embedded box.
>
> But even PCI reads are slow, and the current code does not optimize the
> case when interrupts are level-sensitive. (The optimization is trivial,
> but detecting whether the interrupt is edge- or level-sensitive looks
> messy.)

> The idea is that, if you have 4 ports sharing an interrupt, and the fourth
> is the one that's busy, you'll check every port twice. If you could check
> the busy port first, you'd only need to to do 5 checks.

Um, but the ISA bus was edge sensitive. So presumably PC-104 would be
as well. So you *have* to scan all of the ports twice, because you
want to keep the race window as narrow as possible. If you don't
service incoming characters for a previously idle port (because of the
thought that you only have to check currently busy ports as an
optimization), you'll never get an interrupt on that IRQ again, and
you'll have to wait for the serial timeout to save you (and in the
meantime, you'll likely be losing characters as the FIFO's overflow).

- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/