Re: [PATCH] serial: 8250: Make ISA ports optional

From: Arnd Bergmann
Date: Wed Jan 07 2015 - 05:06:11 EST


On Tuesday 06 January 2015 16:47:55 Peter Hurley wrote:
> On 01/06/2015 02:43 PM, Arnd Bergmann wrote:
> > On Tuesday 06 January 2015 09:32:02 Peter Hurley wrote:
> >> On 01/06/2015 08:13 AM, Arnd Bergmann wrote:
> >>> On Monday 05 January 2015 22:09:45 Peter Hurley wrote:
> >>>> Some arches have no need to create unprobed 8250 ports; these phantom
> >>>> ports are primarily required for ISA ports which have no probe
> >>>> mechanism or to provide non-operational ports for userspace to
> >>>> configure (via TIOCSSERIAL and TIOCSERCONFIG ioctls).
> >>>>
> >>>> Provide CONFIG_SERIAL_8250_PHANTOM_UARTS knob to disable phantom port
> >>>> registration; ie., CONFIG_SERIAL_8250_PHANTOM_UARTS=N only registers
> >>>> probed ports (ACPI/PNP, "serial8250" platform devices, PCI, etc).
> >>>>
> >>>> Cc: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> >>>> Cc: Tony Lindgren <tony@xxxxxxxxxxx>
> >>>> Cc: Grant Likely <grant.likely@xxxxxxxxxx>
> >>>> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> >>>> Signed-off-by: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx>
> >>>
> >>> The intent is definitely right, but I think a better approach is
> >>> possible.
> >>>
> >>> I haven't tried it here, but how about moving the serial8250_init
> >>> function into a separate module, along with all the other parts
> >>> that are only used for ISA devices, but leaving the actual core
> >>> (all exported symbols) in this file?
> >>
> >> Unfortunately, I don't see a way to remove the stacked initialization
> >> without risking tons of breakage.
> >>
> >> Since later probes can "find" an already-existing port and
> >> re-initialize it, the probe order is crucial. For example, a PCI
> >> probe can "find" an existing "serial8250" platform device port,
> >> resulting in only one device node.
> >
> > I'm probably missing something important, by why would that
> > be any different if the PCI driver gets loaded first and the
> > ISA driver second?
>
> Well, the PCI driver would have the proper irq, for one. So, if the
> the platform driver re-initialized the port to the wrong irq...

I see. So we must still ensure that the ISA driver either gets loaded
before the PCI driver, or never. It is already closely coupled with
the PNP driver, but I think we can still get to the point where you
don't load the ISA driver at all if you only have platform 8250
ports that are not supposed to be reconfigurable.

On most non-x86 machines, I would think we also want a way to build
the PCI driver without that dependency.

Arnd
--
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/