Linux-PCI Archive on lore.kernel.org
 help / color / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: Move pci_info() after pci_fixup_device() in pci_setup_device()
Date: Wed, 29 Jul 2020 17:53:41 -0500
Message-ID: <20200729225341.GA1973599@bjorn-Precision-5520> (raw)
In-Reply-To: <1595833615-8049-1-git-send-email-yangtiezhu@loongson.cn>

On Mon, Jul 27, 2020 at 03:06:55PM +0800, Tiezhu Yang wrote:
> In the current code, we can not see the PCI info after fixup which is
> correct to reflect the reality, it is better to move pci_info() after
> pci_fixup_device() in pci_setup_device().
> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>

Applied to pci/enumeration for v5.9, thanks!

> ---
>  drivers/pci/probe.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 2f66988..7c046aed 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -1802,9 +1802,6 @@ int pci_setup_device(struct pci_dev *dev)
>  	dev->revision = class & 0xff;
>  	dev->class = class >> 8;		    /* upper 3 bytes */
>  
> -	pci_info(dev, "[%04x:%04x] type %02x class %#08x\n",
> -		   dev->vendor, dev->device, dev->hdr_type, dev->class);
> -
>  	if (pci_early_dump)
>  		early_dump_pci_device(dev);
>  
> @@ -1822,6 +1819,9 @@ int pci_setup_device(struct pci_dev *dev)
>  	/* Early fixups, before probing the BARs */
>  	pci_fixup_device(pci_fixup_early, dev);
>  
> +	pci_info(dev, "[%04x:%04x] type %02x class %#08x\n",
> +		 dev->vendor, dev->device, dev->hdr_type, dev->class);
> +
>  	/* Device class may be changed after fixup */
>  	class = dev->class >> 8;
>  
> -- 
> 2.1.0
> 

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27  7:06 Tiezhu Yang
2020-07-29 22:53 ` Bjorn Helgaas [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=20200729225341.GA1973599@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=yangtiezhu@loongson.cn \
    /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

Linux-PCI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pci/0 linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ https://lore.kernel.org/linux-pci \
		linux-pci@vger.kernel.org
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git