2015-06-02 11:54:46

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c


* Bin Gao <[email protected]> wrote:

> The arch independent uart8250 early console driver has good support for memory
> mapped and io port based 8250 uarts. Since pci is arch independent so it's
> natural to extend uart8250 to support mem, io and pci. Hence pci uart early
> console in arch/x86/kernel_printk.c by the following commit: 'commit
> 5140fda16051 ("Specify PCI based UART for earlyprintk")' is removed. And its
> equivalent function will be available from uart8250 early console driver.

In what way have you tested this change, does serial-earlyprintk still work on x86
after the change?

Thanks,

Ingo


2015-06-02 19:08:55

by Bin Gao

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Tue, Jun 02, 2015 at 01:54:33PM +0200, Ingo Molnar wrote:
>
> * Bin Gao <[email protected]> wrote:
>
> > The arch independent uart8250 early console driver has good support for memory
> > mapped and io port based 8250 uarts. Since pci is arch independent so it's
> > natural to extend uart8250 to support mem, io and pci. Hence pci uart early
> > console in arch/x86/kernel_printk.c by the following commit: 'commit
> > 5140fda16051 ("Specify PCI based UART for earlyprintk")' is removed. And its
> > equivalent function will be available from uart8250 early console driver.
>
> In what way have you tested this change, does serial-earlyprintk still work on x86
> after the change?
>
> Thanks,
>
> Ingo

Yes, this patch was tested with earlyprintk=serial,0x3f8 on my x86 box and
the early console worked fine.

2015-06-02 20:38:00

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Tue, Jun 2, 2015 at 12:20 PM, Bin Gao <[email protected]> wrote:
>>
>> In what way have you tested this change, does serial-earlyprintk still work on x86
>> after the change?
>
> Yes, this patch was tested with earlyprintk=serial,0x3f8 on my x86 box and
> the early console worked fine.

how about
earlyprintk=serial,ttyS0
earlyprintk=ttyS0

Thanks

Yinghai

2015-06-02 21:07:55

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Tue, 2 Jun 2015, Bin Gao wrote:
> On Tue, Jun 02, 2015 at 01:54:33PM +0200, Ingo Molnar wrote:
> >
> > * Bin Gao <[email protected]> wrote:
> >
> > > The arch independent uart8250 early console driver has good support for memory
> > > mapped and io port based 8250 uarts. Since pci is arch independent so it's
> > > natural to extend uart8250 to support mem, io and pci. Hence pci uart early
> > > console in arch/x86/kernel_printk.c by the following commit: 'commit
> > > 5140fda16051 ("Specify PCI based UART for earlyprintk")' is removed. And its
> > > equivalent function will be available from uart8250 early console driver.
> >
> > In what way have you tested this change, does serial-earlyprintk still work on x86
> > after the change?
> >
> > Thanks,
> >
> > Ingo
>
> Yes, this patch was tested with earlyprintk=serial,0x3f8 on my x86 box and
> the early console worked fine.

What about the memory mapped uarts which have been source of trouble
in the past?

Thanks,

tglx

2015-06-02 21:46:15

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c


* Bin Gao <[email protected]> wrote:

> On Tue, Jun 02, 2015 at 01:54:33PM +0200, Ingo Molnar wrote:
> >
> > * Bin Gao <[email protected]> wrote:
> >
> > > The arch independent uart8250 early console driver has good support for memory
> > > mapped and io port based 8250 uarts. Since pci is arch independent so it's
> > > natural to extend uart8250 to support mem, io and pci. Hence pci uart early
> > > console in arch/x86/kernel_printk.c by the following commit: 'commit
> > > 5140fda16051 ("Specify PCI based UART for earlyprintk")' is removed. And its
> > > equivalent function will be available from uart8250 early console driver.
> >
> > In what way have you tested this change, does serial-earlyprintk still work on x86
> > after the change?
> >
> > Thanks,
> >
> > Ingo
>
> Yes, this patch was tested with earlyprintk=serial,0x3f8 on my x86 box and
> the early console worked fine.

So the format on x86 used to be:

earlyprintk=serial,ttyS0,115200

does that work too?

Thanks,

Ingo

2015-06-02 22:22:33

by Bin Gao

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Tue, Jun 02, 2015 at 11:46:02PM +0200, Ingo Molnar wrote:
> So the format on x86 used to be:
>
> earlyprintk=serial,ttyS0,115200
>
> does that work too?
>
> Thanks,
>
> Ingo
Just tested it, and yes it works.

2015-06-02 22:31:42

by Bin Gao

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Tue, Jun 02, 2015 at 11:07:39PM +0200, Thomas Gleixner wrote:
> What about the memory mapped uarts which have been source of trouble
> in the past?
>
> Thanks,
>
> tglx

Not sure which specific early console you are referring to.
Currently we have serial, ttyS, vga, dbgp, xen, efi and pciserial in
arch/x86/kernel/early_printk.c, and only pciserial is memory mapped
(but it's being removed).

And this patch only touches pciserial/serial parts so ideally shouldn't
have impact on other early consoles.

-Bin

2015-06-03 00:16:47

by Anderson, Stuart R

[permalink] [raw]
Subject: RE: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

Bin, et al,

What we are losing here is the ability to specify a UART by its bus address instead of just supplying the memory or io address. There are some cases where this is useful, though I admit it is probably not going to be widely used. I have seen a platform where the location of the UART moves depending on the firmware version, but the bus address (B:D.F) did not change. There are also some platforms where you do not know the address until you boot the OS and can use the UART to login and find the address of the UART (oops. Chicken and egg problem).

Also, I was going to soon send a patch to allow "pciserial32" for the case where the UART registers are 32-bit aligned instead of 8-bit aligned.

Stuart

-----Original Message-----
From: Bin Gao [mailto:[email protected]]
Sent: Tuesday, June 02, 2015 3:43 PM
To: Thomas Gleixner
Cc: Ingo Molnar; Ingo Molnar; H. Peter Anvin; Greg Kroah-Hartman; One Thousand Gnomes; Peter Hurley; Jiri Slaby; Borislav Petkov; Anderson, Stuart R; [email protected]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Tue, Jun 02, 2015 at 11:07:39PM +0200, Thomas Gleixner wrote:
> What about the memory mapped uarts which have been source of trouble
> in the past?
>
> Thanks,
>
> tglx

Not sure which specific early console you are referring to.
Currently we have serial, ttyS, vga, dbgp, xen, efi and pciserial in arch/x86/kernel/early_printk.c, and only pciserial is memory mapped (but it's being removed).

And this patch only touches pciserial/serial parts so ideally shouldn't have impact on other early consoles.

-Bin

2015-06-03 02:48:49

by Bin Gao

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Tue, Jun 02, 2015 at 01:37:52PM -0700, Yinghai Lu wrote:
> how about
> earlyprintk=serial,ttyS0
> earlyprintk=ttyS0
>
> Thanks
>
> Yinghai

Yes, both work.

-Bin

2015-06-03 02:58:14

by Bin Gao

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Wed, Jun 03, 2015 at 12:16:36AM +0000, Anderson, Stuart R wrote:
> Bin, et al,
>
> What we are losing here is the ability to specify a UART by its bus address
> instead of just supplying the memory or io address. There are some cases
> where this is useful, though I admit it is probably not going to be widely
> used. I have seen a platform where the location of the UART moves depending
> on the firmware version, but the bus address (B:D.F) did not change. There
> are also some platforms where you do not know the address until you boot the
> OS and can use the UART to login and find the address of the UART (oops.
> Chicken and egg problem).
>
> Also, I was going to soon send a patch to allow "pciserial32" for the case where the UART registers are 32-bit aligned instead of 8-bit aligned.
>
> Stuart
>

Theare are several reasons that we want to move it to serial_core.
First, pci is arch independent, so putting these codes in serial_core
(which is arch independent) makes more sense.
Second, B:D.F may change across SoCs, then to support new SoC we only
need change command line but don't need to change the code.
Lastly, there could be other non-x86 platforms using it in the future.

-Bin

2015-06-03 12:37:18

by Peter Hurley

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

Hi Stuart,

On 06/02/2015 08:16 PM, Anderson, Stuart R wrote:
> Bin, et al,
>
> What we are losing here is the ability to specify a UART by its bus address instead of just supplying the memory or io address. There are some cases where this is useful, though I admit it is probably not going to be widely used. I have seen a platform where the location of the UART moves depending on the firmware version, but the bus address (B:D.F) did not change. There are also some platforms where you do not know the address until you boot the OS and can use the UART to login and find the address of the UART (oops. Chicken and egg problem).

The patch title and commit log are somewhat misleading.
What this patch actually does is re-implement pciserial earlyprintk
in terms of earlycon instead, so the functionality is retained.

Patch 1/2 adds pciserial support to earlycon with command line parameters
of the forms

earlycon=uart8250,pci[32],<B:D.F>,<options>

This patch 2/2
1. removes the x86-only pciserial bootconsole implementation, and
2. wires that behavior up to command line parameters of the forms

earlyprintk=uart8250,pci,<B:D.F>,<options>

which is not exactly what was suggested; rather that the existing
earlyprintk= command line format for pciserial should be transparently
handled by earlycon.


Regards,
Peter Hurley

> Also, I was going to soon send a patch to allow "pciserial32" for the case where the UART registers are 32-bit aligned instead of 8-bit aligned.
>
> Stuart
>
> -----Original Message-----
> From: Bin Gao [mailto:[email protected]]
> Sent: Tuesday, June 02, 2015 3:43 PM
> To: Thomas Gleixner
> Cc: Ingo Molnar; Ingo Molnar; H. Peter Anvin; Greg Kroah-Hartman; One Thousand Gnomes; Peter Hurley; Jiri Slaby; Borislav Petkov; Anderson, Stuart R; [email protected]
> Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c
>
> On Tue, Jun 02, 2015 at 11:07:39PM +0200, Thomas Gleixner wrote:
>> What about the memory mapped uarts which have been source of trouble
>> in the past?
>>
>> Thanks,
>>
>> tglx
>
> Not sure which specific early console you are referring to.
> Currently we have serial, ttyS, vga, dbgp, xen, efi and pciserial in arch/x86/kernel/early_printk.c, and only pciserial is memory mapped (but it's being removed).
>
> And this patch only touches pciserial/serial parts so ideally shouldn't have impact on other early consoles.
>
> -Bin
>

2015-06-03 16:56:42

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH v5 2/2] arch/x86: remove pci uart early console from early_prink.c

On Tue, 2 Jun 2015, Bin Gao wrote:

> On Tue, Jun 02, 2015 at 11:07:39PM +0200, Thomas Gleixner wrote:
> > What about the memory mapped uarts which have been source of trouble
> > in the past?
> >
> > Thanks,
> >
> > tglx
>
> Not sure which specific early console you are referring to.
> Currently we have serial, ttyS, vga, dbgp, xen, efi and pciserial in
> arch/x86/kernel/early_printk.c, and only pciserial is memory mapped
> (but it's being removed).

Removed? So you kill the only way to get early serial output on
certain machines?

Thanks,

tglx