mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Jeff Garzik <jeff@garzik.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [patch 0/2] serial: explicitly request ttyS0-3 for COM1-4
Date: Thu, 17 Jan 2008 09:07:29 -0700	[thread overview]
Message-ID: <200801170907.31162.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <20080116201438.GD23371@flint.arm.linux.org.uk>

On Wednesday 16 January 2008 01:14:38 pm Russell King wrote:
> On Wed, Jan 16, 2008 at 12:59:27PM -0700, Bjorn Helgaas wrote:
> > On Wednesday 16 January 2008 11:39:34 am Russell King wrote:
> > > On Wed, Jan 16, 2008 at 10:05:41AM -0700, Bjorn Helgaas wrote:
> > > > When 8250_pnp discovers COM ports, we only get the correct ttyS names
> > > > by accident -- we rely on serial8250_isa_init_ports(), which discovers
> > > > the COM ports earlier using the addresses in SERIAL_PORT_DFNS.
> > > 
> > > It's not by accident but by design.  It's quite intentional that it
> > > remembers the addresses of serial ports, and if another port is
> > > registered later with the same base address, it gets the same name.
> > 
> > It's certainly by design that if we register a port twice, it gets
> > the same name both times.
> 
> Incorrect - if it's not detected first time around (eg, the port isn't
> accessible at that time), its slot will still be reserved due to the
> way slots are given out.
> 
> Slots are given to users in order of:
> 
> 1. does the IO type and base address of a previously known port match
>    the new port?  If so, use that.
> 2. do we have a slot which has never been used - use that.
> 3. find the first slot which is not currently in use.
> 
> So, the only way we'd get the first set of ttyS slots used is if all of
> the following are true:
> 
> a) the ISA probe doesn't detect them
> b) some other driver registers many ports which don't correspond with any
>    of the ISA listed addresses and we run out of empty slots
> c) 8250_pnp initialises after this driver
> 
> (c) is unlikely, except in the modular case - we explicitly list 8250_pnp
> immediately after the 8250 driver so that it gets first call on the
> slots during initialisation time, before we probe for PCI devices.

Let me back up a minute.  I was merely trying to make the point that
if we skip the ISA probe (which uses SERIAL_PORT_DFNS), the 8250_pnp
probe will discover the COM ports but won't necessarily name them the
way we expect (e.g., http://lkml.org/lkml/2007/8/10/409).

Bjorn

  reply	other threads:[~2008-01-17 16:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 17:05 Bjorn Helgaas
2008-01-16 17:05 ` [patch 1/2] 8250: add serial8250_register_port_at() for requesting specific ttyS lines Bjorn Helgaas
2008-01-16 17:05 ` [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names Bjorn Helgaas
2008-01-16 18:42   ` Russell King
2008-01-16 18:44   ` H. Peter Anvin
2008-01-16 19:47     ` Bjorn Helgaas
2008-01-16 19:49       ` H. Peter Anvin
2008-01-16 18:39 ` [patch 0/2] serial: explicitly request ttyS0-3 for COM1-4 Russell King
2008-01-16 19:59   ` Bjorn Helgaas
2008-01-16 20:14     ` Russell King
2008-01-17 16:07       ` Bjorn Helgaas [this message]
2008-01-17 16:16         ` Russell King
2008-01-17 17:56           ` Bjorn Helgaas

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=200801170907.31162.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rmk+lkml@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

all inboxes | Powered by JetHome®