[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50EC51E3.6070306@redhat.com>
Date: Tue, 08 Jan 2013 12:05:39 -0500
From: Don Dutile <ddutile@...hat.com>
To: tadeusz.struk@...el.com
CC: bhelgaas@...gle.com, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org
Subject: Re: [PATCH] PCI: Make pci_find_upstream_pcie_bridge() handle non
PCIE VFs well
On 01/08/2013 09:32 AM, tadeusz.struk@...el.com wrote:
> pci_find_upstream_pcie_bridge() doesn't handle well non PCIE VFs
> that are part of a PCIE PF device.
>
> Signed-off-by: Tadeusz Struk<tadeusz.struk@...el.com>
> ---
> drivers/pci/search.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/pci/search.c b/drivers/pci/search.c
> index bf969ba..8ecdab2 100644
> --- a/drivers/pci/search.c
> +++ b/drivers/pci/search.c
> @@ -23,6 +23,8 @@ EXPORT_SYMBOL_GPL(pci_bus_sem);
> * if the device isn't connected to a PCIe bridge (that is its parent is a
> * legacy PCI bridge and the bridge is directly connected to bus 0), return its
> * parent
> + * if the device is a VF that doesn't have PCIe cap,
> + * but the PF is a PCIE, return NULL
> */
> struct pci_dev *
> pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
> @@ -31,6 +33,10 @@ pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
>
> if (pci_is_pcie(pdev))
> return NULL;
> +
> + if (pdev->is_virtfn&& pci_is_pcie(pdev->physfn))
> + return NULL;
> +
> while (1) {
> if (pci_is_root_bus(pdev->bus))
> break;
The verbage/description is confusing, and
the comment doesn't match the code:
(a) no such thing as a non-PCIe VF -- all VFs
are PCIe-based.
(b) code says to return null if VF doesn't have PCIe cap,
but the code checks if pdev is VF and if PF is PCIe,
which it must be! ...
nack until a better &/or matching explanation of what
the real problem is, and what the solution is trying to do.
- Don
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists