[PATCH] serial: ns16550: Fix ordering of getting base address

Bin Meng bmeng.cn at gmail.com
Fri Apr 3 12:16:51 CEST 2020


Hi Andy,

On Fri, Apr 3, 2020 at 6:05 PM Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>
> On Fri, Apr 03, 2020 at 02:58:08AM -0700, Bin Meng wrote:
> > Currently the driver gets ns16550 base address in the driver
> > probe() routine, which may potentially break any ns16550 wrapper
> > driver that does additional initialization before calling
> > ns16550_serial_probe().
> >
> > Things are complicated that we need consider ns16550 devices on
> > both simple-bus and PCI bus. To fix the issue we move the base
> > address assignment for simple-bus ns16550 device back to the
> > ofdata_to_platdata(), and assign base address for PCI ns16550
> > device in ns16550_serial_probe().
> >
> > This is still not perfect. Ideally if any PCI bus based ns16550
> > wrapper driver tries to access plat->base before calling probe(),
> > it is subject to break.
>
> Thank you.
> I have tested it and it fixes my case.
>
> Tested-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>

Thanks for testing!

>
>
> > Fixes: 720f9e1fdb0c9 ("serial: ns16550: Move PCI access from
> > ofdata_to_platdata() to probe()")
>
> I believe this should be one line.

I thought putting it in one line violates the 80 characters per column
rule. And checkpatch.pl does not complain about this, so I think it's
fine :)

>
> > Reported-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> > Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> >
> > ---
> >
> >  drivers/serial/ns16550.c | 51 +++++++++++++++++++++++-------------------------
> >  1 file changed, 24 insertions(+), 27 deletions(-)
> >

Regards,
Bin


More information about the U-Boot mailing list