mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tadeusz.struk@intel.com
To: bhelgaas@google.com
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	tadeusz.struk@intel.com
Subject: [PATCH] PCI: Make pci_find_upstream_pcie_bridge() handle non PCIE VFs well
Date: Tue, 08 Jan 2013 14:32:57 +0000	[thread overview]
Message-ID: <50ec2e19.EUrQfXEnsRJiPCTv%tadeusz.struk@intel.com> (raw)

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@intel.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;
-- 
1.7.7


             reply	other threads:[~2013-01-08 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-08 14:32 tadeusz.struk [this message]
2013-01-08 17:05 ` Don Dutile
2013-01-09 10:27   ` Tadeusz Struk
2013-01-09 16:32     ` Don Dutile

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=50ec2e19.EUrQfXEnsRJiPCTv%tadeusz.struk@intel.com \
    --to=tadeusz.struk@intel.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.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

all inboxes | Powered by JetHome®