All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-serial@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Jiri Slaby <jslaby@suse.com>
Subject: Re: [PATCH] serial: 8250_uniphier: add earlycon support
Date: Thu, 5 Nov 2015 11:48:00 -0500	[thread overview]
Message-ID: <563B8840.9060109@hurleysoftware.com> (raw)
In-Reply-To: <CAK7LNATGWRwitQVNsiFiiojE3JLYdO6DPY74LSbJ3jw4mg6HdQ@mail.gmail.com>

Hi Masahiro,

Apologies for the delay in reply; I didn't see the lower part of your email.


On 10/28/2015 09:49 PM, Masahiro Yamada wrote:
>>> +#if IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE)
>>
>> #ifdef CONFIG_SERIAL_8250_CONSOLE
> 
> I am OK with this change because this CONFIG is boolean.
> 
> 
> I still believe
> 
> #if IS_ENABLED(CONFIG_FOO)
> 
> is a nice shorthand for
> 
> #if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)
> 
> when CONFIG_FOO is tristate.

I agree.


>>> +static int __init uniphier_early_console_setup(struct earlycon_device *device,
>>> +                                            const char *options)
>>> +{
>>> +     if (!device->port.membase)
>>> +             return -ENODEV;
>>> +
>>> +     /* This hardware always expects MMIO32 register interface. */
>>> +     device->port.iotype = UPIO_MEM32;
>>> +     device->port.regshift = 2;
>>> +
>>> +     /*
>>> +      * Do not touch the divisor register in early_serial8250_setup();
>>> +      * we assume it has been initialized by a boot loader.
>>> +      */
>>> +     device->baud = 0;
>>> +
>>> +     return early_serial8250_setup(device, options);
>>> +}
>>> +OF_EARLYCON_DECLARE(uniphier_uart, "socionext,uniphier-uart",
>>> +                 uniphier_early_console_setup);
>>
>> Please change the earlycon name to just "uniphier" or "uniphier8250"; eg.,
>>
>> OF_EARLYCON_DECLARE(uniphier, "socionext,uniphier-uart",
>>                     uniphier_early_console_setup);
>>
>>
>> My earlycon series merges OF_EARLYCON_DECLARE() => EARLYCON_DECLARE()
>> and "uniphier" is simpler on the command line.
>>
> 
> I am also OK with this change, too.
> 
> But I still see  some *_serial and *_uart are used
> in EARLYCON_DECLARE.
> 
> yamada@beagle:~/workspace/linux/drivers/tty$ git grep -e
> 'EARLYCON_DECLARE(.*_uart'
> serial/8250/8250_ingenic.c:EARLYCON_DECLARE(jz4740_uart,
> ingenic_early_console_setup);
> serial/8250/8250_ingenic.c:OF_EARLYCON_DECLARE(jz4740_uart,
> "ingenic,jz4740-uart",
> serial/8250/8250_ingenic.c:EARLYCON_DECLARE(jz4775_uart,
> ingenic_early_console_setup);
> serial/8250/8250_ingenic.c:OF_EARLYCON_DECLARE(jz4775_uart,
> "ingenic,jz4775-uart",
> serial/8250/8250_ingenic.c:EARLYCON_DECLARE(jz4780_uart,
> ingenic_early_console_setup);
> serial/8250/8250_ingenic.c:OF_EARLYCON_DECLARE(jz4780_uart,
> "ingenic,jz4780-uart",
> serial/arc_uart.c:EARLYCON_DECLARE(arc_uart, arc_early_console_setup);
> serial/arc_uart.c:OF_EARLYCON_DECLARE(arc_uart, "snps,arc-uart",
> arc_early_console_setup);
> serial/bcm63xx_uart.c:OF_EARLYCON_DECLARE(bcm63xx_uart,
> "brcm,bcm6345-uart", bcm_early_console_setup);
> yamada@beagle:~/workspace/linux/drivers/tty$ git grep -e
> 'EARLYCON_DECLARE(.*_serial'
> serial/8250/8250_early.c:EARLYCON_DECLARE(uart8250, early_serial8250_setup);
> serial/8250/8250_early.c:EARLYCON_DECLARE(uart, early_serial8250_setup);
> serial/msm_serial.c:EARLYCON_DECLARE(msm_serial,
> msm_serial_early_console_setup);
> serial/msm_serial.c:OF_EARLYCON_DECLARE(msm_serial, "qcom,msm-uart",
> serial/msm_serial.c:EARLYCON_DECLARE(msm_serial_dm,
> msm_serial_early_console_setup_dm);
> serial/msm_serial.c:OF_EARLYCON_DECLARE(msm_serial_dm, "qcom,msm-uartdm",
> serial/sprd_serial.c:EARLYCON_DECLARE(sprd_serial, sprd_early_console_setup);
> serial/sprd_serial.c:OF_EARLYCON_DECLARE(sprd_serial, "sprd,sc9836-uart",

This brings up an important point: the names for EARLYCON_DECLARE() should not
be changed after being in at least one kernel release, since this would cause
existing command line setups to fail.

Regards,
Peter Hurley
 

WARNING: multiple messages have this Message-ID (diff)
From: peter@hurleysoftware.com (Peter Hurley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] serial: 8250_uniphier: add earlycon support
Date: Thu, 5 Nov 2015 11:48:00 -0500	[thread overview]
Message-ID: <563B8840.9060109@hurleysoftware.com> (raw)
In-Reply-To: <CAK7LNATGWRwitQVNsiFiiojE3JLYdO6DPY74LSbJ3jw4mg6HdQ@mail.gmail.com>

Hi Masahiro,

Apologies for the delay in reply; I didn't see the lower part of your email.


On 10/28/2015 09:49 PM, Masahiro Yamada wrote:
>>> +#if IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE)
>>
>> #ifdef CONFIG_SERIAL_8250_CONSOLE
> 
> I am OK with this change because this CONFIG is boolean.
> 
> 
> I still believe
> 
> #if IS_ENABLED(CONFIG_FOO)
> 
> is a nice shorthand for
> 
> #if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)
> 
> when CONFIG_FOO is tristate.

I agree.


>>> +static int __init uniphier_early_console_setup(struct earlycon_device *device,
>>> +                                            const char *options)
>>> +{
>>> +     if (!device->port.membase)
>>> +             return -ENODEV;
>>> +
>>> +     /* This hardware always expects MMIO32 register interface. */
>>> +     device->port.iotype = UPIO_MEM32;
>>> +     device->port.regshift = 2;
>>> +
>>> +     /*
>>> +      * Do not touch the divisor register in early_serial8250_setup();
>>> +      * we assume it has been initialized by a boot loader.
>>> +      */
>>> +     device->baud = 0;
>>> +
>>> +     return early_serial8250_setup(device, options);
>>> +}
>>> +OF_EARLYCON_DECLARE(uniphier_uart, "socionext,uniphier-uart",
>>> +                 uniphier_early_console_setup);
>>
>> Please change the earlycon name to just "uniphier" or "uniphier8250"; eg.,
>>
>> OF_EARLYCON_DECLARE(uniphier, "socionext,uniphier-uart",
>>                     uniphier_early_console_setup);
>>
>>
>> My earlycon series merges OF_EARLYCON_DECLARE() => EARLYCON_DECLARE()
>> and "uniphier" is simpler on the command line.
>>
> 
> I am also OK with this change, too.
> 
> But I still see  some *_serial and *_uart are used
> in EARLYCON_DECLARE.
> 
> yamada at beagle:~/workspace/linux/drivers/tty$ git grep -e
> 'EARLYCON_DECLARE(.*_uart'
> serial/8250/8250_ingenic.c:EARLYCON_DECLARE(jz4740_uart,
> ingenic_early_console_setup);
> serial/8250/8250_ingenic.c:OF_EARLYCON_DECLARE(jz4740_uart,
> "ingenic,jz4740-uart",
> serial/8250/8250_ingenic.c:EARLYCON_DECLARE(jz4775_uart,
> ingenic_early_console_setup);
> serial/8250/8250_ingenic.c:OF_EARLYCON_DECLARE(jz4775_uart,
> "ingenic,jz4775-uart",
> serial/8250/8250_ingenic.c:EARLYCON_DECLARE(jz4780_uart,
> ingenic_early_console_setup);
> serial/8250/8250_ingenic.c:OF_EARLYCON_DECLARE(jz4780_uart,
> "ingenic,jz4780-uart",
> serial/arc_uart.c:EARLYCON_DECLARE(arc_uart, arc_early_console_setup);
> serial/arc_uart.c:OF_EARLYCON_DECLARE(arc_uart, "snps,arc-uart",
> arc_early_console_setup);
> serial/bcm63xx_uart.c:OF_EARLYCON_DECLARE(bcm63xx_uart,
> "brcm,bcm6345-uart", bcm_early_console_setup);
> yamada at beagle:~/workspace/linux/drivers/tty$ git grep -e
> 'EARLYCON_DECLARE(.*_serial'
> serial/8250/8250_early.c:EARLYCON_DECLARE(uart8250, early_serial8250_setup);
> serial/8250/8250_early.c:EARLYCON_DECLARE(uart, early_serial8250_setup);
> serial/msm_serial.c:EARLYCON_DECLARE(msm_serial,
> msm_serial_early_console_setup);
> serial/msm_serial.c:OF_EARLYCON_DECLARE(msm_serial, "qcom,msm-uart",
> serial/msm_serial.c:EARLYCON_DECLARE(msm_serial_dm,
> msm_serial_early_console_setup_dm);
> serial/msm_serial.c:OF_EARLYCON_DECLARE(msm_serial_dm, "qcom,msm-uartdm",
> serial/sprd_serial.c:EARLYCON_DECLARE(sprd_serial, sprd_early_console_setup);
> serial/sprd_serial.c:OF_EARLYCON_DECLARE(sprd_serial, "sprd,sc9836-uart",

This brings up an important point: the names for EARLYCON_DECLARE() should not
be changed after being in at least one kernel release, since this would cause
existing command line setups to fail.

Regards,
Peter Hurley
 

  reply	other threads:[~2015-11-05 16:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22  8:39 [PATCH] serial: 8250_uniphier: add earlycon support Masahiro Yamada
2015-10-22  8:39 ` Masahiro Yamada
2015-10-28 15:21 ` Peter Hurley
2015-10-28 15:21   ` Peter Hurley
2015-10-29  1:49   ` Masahiro Yamada
2015-10-29  1:49     ` Masahiro Yamada
2015-11-05 16:48     ` Peter Hurley [this message]
2015-11-05 16:48       ` Peter Hurley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=563B8840.9060109@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.