[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190604112905.1f16232c@x1.home>
Date: Tue, 4 Jun 2019 11:29:05 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: Hao Zheng <mowendugu@...il.com>
Cc: bhelgaas@...gle.com, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, Quan Xu <quan.xu0@...il.com>
Subject: Re: [PATCH 1/1] PCI/IOV: Fix VF0 cached config space size for other
VFs
On Mon, 20 May 2019 21:17:24 +0800
Hao Zheng <mowendugu@...il.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@...il.com>
> Signed-off-by: Quan Xu <quan.xu0@...il.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
Powered by blists - more mailing lists