2002-09-20 04:54:29

by David Mosberger

[permalink] [raw]
Subject: can we drop early_serial_setup()?

The early_serial_setup() routine was broken during the big serial
clean up that happened a while ago. I fixed this problem for ia64 by
introducing a new routine called early_register_port() (see below).
It serves the same purpose as early_serial_setup(), with the only
difference being that the argument passed to it is now a "uart_port"
structure (instead of a "serial_struct"). Russell King suggested to
get rid of early_serial_setup() alltogether, since it is broken anyhow
and serves no purpose anymore. However, as far as I can tell, there
are two places left which use this routine:

arch/ia64/sn/kernel/setup.c
arch/ppc/platforms/ev64260_setup.c

It's should be easy to convert these files to early_register_port(),
but since I can't test the platform's in question (PPC and SGI SN
machine), I'd like to know whether it's OK to drop
early_serial_setup() now. If someone wants some hints on how to do
the conversion, let me know (sample code is in 8250_hcdp.c).

Thanks,

--david

int __init early_register_port (struct uart_port *port)
{
if (port->line >= ARRAY_SIZE(serial8250_ports))
return -ENODEV;

serial8250_isa_init_ports(); /* force ISA defaults */
serial8250_ports[port->line].port = *port;
serial8250_ports[port->line].port.ops = &serial8250_pops;
return 0;
}


2002-09-20 23:12:04

by Matt Porter

[permalink] [raw]
Subject: Re: can we drop early_serial_setup()?

On Thu, Sep 19, 2002 at 09:59:19PM -0700, David Mosberger wrote:
> int __init early_register_port (struct uart_port *port)
> {
> if (port->line >= ARRAY_SIZE(serial8250_ports))
> return -ENODEV;
>
> serial8250_isa_init_ports(); /* force ISA defaults */
> serial8250_ports[port->line].port = *port;
> serial8250_ports[port->line].port.ops = &serial8250_pops;
> return 0;
> }

serial8250_ports and serial8250_pops are not static structs
in your tree?

--
Matt Porter
[email protected]
This is Linux Country. On a quiet night, you can hear Windows reboot.

2002-09-20 23:18:22

by David Mosberger

[permalink] [raw]
Subject: Re: can we drop early_serial_setup()?

>>>>> On Fri, 20 Sep 2002 16:33:57 -0700, Matt Porter <[email protected]> said:

Matt> serial8250_ports and serial8250_pops are not static structs
Matt> in your tree?

It is. The new routine (early_register_port) goes into 8250.c, so that's
fine.

--david

2002-09-21 13:16:47

by Matt Porter

[permalink] [raw]
Subject: Re: can we drop early_serial_setup()?

On Fri, Sep 20, 2002 at 04:23:27PM -0700, David Mosberger wrote:
> >>>>> On Fri, 20 Sep 2002 16:33:57 -0700, Matt Porter <[email protected]> said:
>
> Matt> serial8250_ports and serial8250_pops are not static structs
> Matt> in your tree?
>
> It is. The new routine (early_register_port) goes into 8250.c, so that's
> fine.

That will be fine then. I misconstrued your first statements as
indicating that we should duplicate this code in each arch (which
I didn't like). As far as PPC is concerned, go ahead and wipe
out early_serial_setup when you bring in early_register_port.

FWIW, there's actually been more PPC platforms than ev64260 using
early_serial_setup. They had abandoned it temporarily for a less
flexible approach due to the breakage.

Thanks,
--
Matt Porter
[email protected]
This is Linux Country. On a quiet night, you can hear Windows reboot.

2002-09-23 18:59:23

by David Mosberger

[permalink] [raw]
Subject: Re: can we drop early_serial_setup()?

>>>>> On Sat, 21 Sep 2002 06:45:04 -0700, Matt Porter <[email protected]> said:

Matt> That will be fine then. I misconstrued your first statements
Matt> as indicating that we should duplicate this code in each arch
Matt> (which I didn't like). As far as PPC is concerned, go ahead
Matt> and wipe out early_serial_setup when you bring in
Matt> early_register_port.

Matt> FWIW, there's actually been more PPC platforms than ev64260
Matt> using early_serial_setup. They had abandoned it temporarily
Matt> for a less flexible approach due to the breakage.

OK, thanks for confirming.

--david

2002-09-23 22:39:11

by Mark A. Greer

[permalink] [raw]
Subject: Re: can we drop early_serial_setup()?

David,

Sorry for the delay, we've had email problems most of last week.

Yes, we can get rid of the early_serial_setup() in ev64260_setup.c, no
problem there. I'm very busy on some other things right now but I'll try
to get to that soon. If you can't wait, go ahead and make the change and
I will test it for you.

Mark
--

David Mosberger wrote:

> The early_serial_setup() routine was broken during the big serial
> clean up that happened a while ago. I fixed this problem for ia64 by
> introducing a new routine called early_register_port() (see below).
> It serves the same purpose as early_serial_setup(), with the only
> difference being that the argument passed to it is now a "uart_port"
> structure (instead of a "serial_struct"). Russell King suggested to
> get rid of early_serial_setup() alltogether, since it is broken anyhow
> and serves no purpose anymore. However, as far as I can tell, there
> are two places left which use this routine:
>
> arch/ia64/sn/kernel/setup.c
> arch/ppc/platforms/ev64260_setup.c
>
> It's should be easy to convert these files to early_register_port(),
> but since I can't test the platform's in question (PPC and SGI SN
> machine), I'd like to know whether it's OK to drop
> early_serial_setup() now. If someone wants some hints on how to do
> the conversion, let me know (sample code is in 8250_hcdp.c).
>
> Thanks,
>
> --david
>
> int __init early_register_port (struct uart_port *port)
> {
> if (port->line >= ARRAY_SIZE(serial8250_ports))
> return -ENODEV;
>
> serial8250_isa_init_ports(); /* force ISA defaults */
> serial8250_ports[port->line].port = *port;
> serial8250_ports[port->line].port.ops = &serial8250_pops;
> return 0;
> }