linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: ruscur@russell.cc, mpe@ellerman.id.au,
	Wei Yang <weiyang@linux.vnet.ibm.com>
Subject: [PATCH v15 04/12] powerpc/eeh: Cache normal BARs, not windows or IOV BARs
Date: Fri,  4 Mar 2016 10:53:06 +1100	[thread overview]
Message-ID: <1457049194-9281-5-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1457049194-9281-1-git-send-email-gwshan@linux.vnet.ibm.com>

From: Wei Yang <weiyang@linux.vnet.ibm.com>

This restricts the EEH address cache to use only the first 7 BARs. This
makes __eeh_addr_cache_insert_dev() ignore PCI bridge window and IOV BARs.
As the result of this change, eeh_addr_cache_get_dev() will return VFs from
VF's resource addresses instead of parent PFs.

This also removes PCI bridge check as we limit __eeh_addr_cache_insert_dev()
to 7 BARs and this effectively excludes PCI bridges from being cached.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/eeh_cache.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/eeh_cache.c b/arch/powerpc/kernel/eeh_cache.c
index a1e86e1..ddbcfab 100644
--- a/arch/powerpc/kernel/eeh_cache.c
+++ b/arch/powerpc/kernel/eeh_cache.c
@@ -195,8 +195,11 @@ static void __eeh_addr_cache_insert_dev(struct pci_dev *dev)
 		return;
 	}
 
-	/* Walk resources on this device, poke them into the tree */
-	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+	/*
+	 * Walk resources on this device, poke the first 7 (6 normal BAR and 1
+	 * ROM BAR) into the tree.
+	 */
+	for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
 		resource_size_t start = pci_resource_start(dev,i);
 		resource_size_t end = pci_resource_end(dev,i);
 		unsigned long flags = pci_resource_flags(dev,i);
@@ -222,10 +225,6 @@ void eeh_addr_cache_insert_dev(struct pci_dev *dev)
 {
 	unsigned long flags;
 
-	/* Ignore PCI bridges */
-	if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE)
-		return;
-
 	spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
 	__eeh_addr_cache_insert_dev(dev);
 	spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
-- 
2.1.0

  parent reply	other threads:[~2016-03-03 23:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 23:53 [PATCH v15 00/12] EEH Support for SRIOV VFs Gavin Shan
2016-03-03 23:53 ` [PATCH v15 01/12] PCI/IOV: Rename and export virtfn_{add, remove} Gavin Shan
2016-03-09 12:51   ` [v15,01/12] " Michael Ellerman
2016-03-03 23:53 ` [PATCH v15 02/12] PCI: Add pcibios_bus_add_device() weak function Gavin Shan
2016-03-03 23:53 ` [PATCH v15 03/12] powerpc/pci: Remove VFs prior to PF Gavin Shan
2016-03-03 23:53 ` Gavin Shan [this message]
2016-03-03 23:53 ` [PATCH v15 05/12] powerpc/eeh: EEH device for VF Gavin Shan
2016-03-03 23:53 ` [PATCH v15 06/12] powerpc/eeh: Create PE for VFs Gavin Shan
2016-03-03 23:53 ` [PATCH v15 07/12] powerpc/powernv: Support EEH reset for VF PE Gavin Shan
2016-03-03 23:53 ` [PATCH v15 08/12] powerpc/powernv: Support PCI config restore for VFs Gavin Shan
2016-03-03 23:53 ` [PATCH v15 09/12] powerpc/eeh: powerpc/eeh: Support error recovery for VF PE Gavin Shan
2016-03-03 23:53 ` [PATCH v15 10/12] powerpc/eeh: Don't propagate error to guest Gavin Shan
2016-03-03 23:53 ` [PATCH v15 11/12] powerpc/eeh: Don't remove passed VFs Gavin Shan
2016-03-03 23:53 ` [PATCH v15 12/12] powerpc/eeh: Synchronize recovery in host/guest Gavin Shan

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=1457049194-9281-5-git-send-email-gwshan@linux.vnet.ibm.com \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=ruscur@russell.cc \
    --cc=weiyang@linux.vnet.ibm.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
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;
as well as URLs for NNTP newsgroup(s).