Linux-PCI Archive on lore.kernel.org
 help / color / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Hao Zheng <mowendugu@gmail.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, Quan Xu <quan.xu0@gmail.com>
Subject: Re: [PATCH 1/1] PCI/IOV: Fix VF0 cached config space size for other VFs
Date: Tue, 4 Jun 2019 11:29:05 -0600
Message-ID: <20190604112905.1f16232c@x1.home> (raw)
In-Reply-To: <1558358244-35832-1-git-send-email-mowendugu@gmail.com>

On Mon, 20 May 2019 21:17:24 +0800
Hao Zheng <mowendugu@gmail.com> wrote:

> Set the pcie_cap field before getting the config space size for
> other VFs. Otherwise, the config space size of other VFs are error
> set to 256, while the size of VF0 is 4096.
> 
> Signed-off-by: Hao Zheng <mowendugu@gmail.com>
> Signed-off-by: Quan Xu <quan.xu0@gmail.com>
> ---
>  drivers/pci/iov.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index 3aa115e..239fad1 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -133,6 +133,7 @@ static void pci_read_vf_config_common(struct pci_dev *virtfn)
>  	pci_read_config_word(virtfn, PCI_SUBSYSTEM_ID,
>  			     &physfn->sriov->subsystem_device);
>  
> +	set_pcie_port_type(virtfn);
>  	physfn->sriov->cfg_size = pci_cfg_space_size(virtfn);
>  }
>  

This results in set_pci_port_type() being called multiple times on
VF0.  Why not simply delay calling pci_read_vf_config_common() until
after pci_setup_device()?  Here's the alternate approach:

https://lore.kernel.org/linux-pci/155966918965.10361.16228304474160813310.stgit@gimli.home/

Thanks,
Alex

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 13:17 Hao Zheng
2019-06-04 17:29 ` Alex Williamson [this message]
2019-06-14  3:57   ` 独孤败

Reply instructions:

You may reply publically 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=20190604112905.1f16232c@x1.home \
    --to=alex.williamson@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mowendugu@gmail.com \
    --cc=quan.xu0@gmail.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

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 linux-pci@archiver.kernel.org
	public-inbox-index linux-pci


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