Re: [patch 2.6.13-git] 8250 tweaks

From: Russell King
Date: Tue Jul 12 2005 - 07:13:48 EST


On Tue, Jul 12, 2005 at 04:32:12AM -0700, david-b@xxxxxxxxxxx wrote:
> > > ttyS0 at MMIO 0xfffb0000 (irq = 46) is a ST16654
> > > serial8250 serial8250.0: unable to register port at index 1 (IO0 MEM0 IRQ47): -28
> > > serial8250 serial8250.0: unable to register port at index 2 (IO0 MEM0 IRQ15): -28
> >
> > Thanks, that's exactly what I wanted to know.
> >
> > -28 is -ENOSPC which means that you've run out of available serial devices
> > to register these others.
>
> The idea is _not_ to register them on boards that only have a
> single RS232 connector. The fix was just having the 8250 code
> understand that it should only register ports that are real.

The tty code doesn't work like that. You must know how many ports
you want right from the start. You can't dynamically add new ports
to an already registered driver without first unregistering all the
existing ports, unregistering the driver, adjusting the number of
ports, reregistering the driver and all the ports.

If you've got one already open, your only option in that case is to
ignore any attempt to add new ports.

Obviously this is not acceptable. So please don't try to dictate
what serial should do. It does things the way it does them to work
around other bits of the kernel which are lacking in various ways.

> > If you wish to have three ports in an plat_serial8250_port array, you'll
> > need to ensure that CONFIG_SERIAL_8250_NR_UARTS is set to at least 3.
>
> That is, there's no third way which (a) doesn't waste that memory,
> and (b) doesn't produce annoying messages about non-error cases?

Correct.

> ISTR that having NR_UARTS bigger just produced different messages...

Which were?

It works for me on my platforms here, and everyone else on x86. I
even had a situation where I had NR_UARTS set to 64 but only one
registered... which also worked fine with no extraneous kernel
messages.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
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/