linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] x86/PCI: Make pci=earlydump output neat
Date: Wed, 11 Apr 2018 12:47:11 +0300	[thread overview]
Message-ID: <20180411094711.GH2173@lahna.fi.intel.com> (raw)
In-Reply-To: <20180405121159.84241-1-andriy.shevchenko@linux.intel.com>

On Thu, Apr 05, 2018 at 03:11:59PM +0300, Andy Shevchenko wrote:
> Currently the early dump of PCI configuration space looks quite unhelpful, e.g.
> 
> [    0.000000]   60:
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]  00
> [    0.000000]
> 
> which makes really hard to get anything out of this. Convert the function to
> use print_hex_dump() to make output neat.
> 
> In the result we will have
> 
> [    0.000000] 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 
> which is much, much better.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  arch/x86/pci/early.c | 19 +++++--------------
>  1 file changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/x86/pci/early.c b/arch/x86/pci/early.c
> index f0114007e915..53a87692d687 100644
> --- a/arch/x86/pci/early.c
> +++ b/arch/x86/pci/early.c
> @@ -59,24 +59,15 @@ int early_pci_allowed(void)
>  
>  void early_dump_pci_device(u8 bus, u8 slot, u8 func)
>  {
> +	u32 value[256 / 4];
>  	int i;
> -	int j;
> -	u32 val;
>  
> -	printk(KERN_INFO "pci 0000:%02x:%02x.%d config space:",
> -	       bus, slot, func);
> +	pr_info("pci 0000:%02x:%02x.%d config space:\n", bus, slot, func);
>  
> -	for (i = 0; i < 256; i += 4) {
> -		if (!(i & 0x0f))
> -			printk("\n  %02x:",i);
> +	for (i = 0; i < 256; i += 4)
> +		value[i/4] = read_pci_config(bus, slot, func, i);

Please be consistent with your use of whitespace: 256 / 4 vs. i/4.

Other than that looks good and certainly is an improvement,

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

      reply	other threads:[~2018-04-11  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 12:11 [PATCH v1] x86/PCI: Make pci=earlydump output neat Andy Shevchenko
2018-04-11  9:47 ` Mika Westerberg [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=20180411094711.GH2173@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).