mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: Bin Gao <bin.gao@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Peter Hurley <peter@hurleysoftware.com>,
	Jiri Slaby <jslaby@suse.cz>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] serial_core: add pci uart early console support
Date: Fri, 15 May 2015 11:27:40 +0100	[thread overview]
Message-ID: <20150515112740.3f9d8c28@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20150515043435.GB100883@worksta>

> +/* x86 uses "earlyprintk=xxx", so we keep the compatibility here */
> +#ifdef CONFIG_X86
> +early_param("earlyprintk", param_setup_earlycon);
> +#else
>  early_param("earlycon", param_setup_earlycon);
> +#endif

Is there any reason for not just allowing both ? That way you don't need
an ifdef and the same command line (either) works everywhere ?

>  
>  int __init of_setup_earlycon(unsigned long addr,
>  			     int (*setup)(struct earlycon_device *, const char *))
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 0b7bb12..221143c 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -34,10 +34,16 @@
>  #include <linux/serial_core.h>
>  #include <linux/delay.h>
>  #include <linux/mutex.h>
> +#include <linux/pci_regs.h>
>  
>  #include <asm/irq.h>
>  #include <asm/uaccess.h>
>  
> +/* Only x86 has early pci access APIs */
> +#if defined(CONFIG_PCI) && defined(CONFIG_X86)
> +#include <asm/pci-direct.h>
> +#endif

We should probably make that a define or Kconfig value so that any other
port wanting early PCI console can add the needed direct functions
without the defines here getting longer and longer

It would then be a single

#if defined(CONFIG_EARLY_PCI)

that could be put anywhere


> +static int parse_pci_options(char *options, unsigned long *phys)
> +{
> +	u8 bus, dev, func;

...

> +failed:
> +	pr_err("Invalid earlycon pci parameters\n");
> +	return -EINVAL;
> +}

#else
static int parse_pci_options(char *options, unsigned long *phys)
{
	pr_err("earlycon pci not available\n");
	return -EINVAL;
}
> +#endif
> +


The all the ifdef mess below goes away

Alan

      reply	other threads:[~2015-05-15 10:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15  4:34 Bin Gao
2015-05-15 10:27 ` One Thousand Gnomes [this message]

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=20150515112740.3f9d8c28@lxorguk.ukuu.org.uk \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=bin.gao@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=peter@hurleysoftware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®