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: linux-pci@vger.kernel.org, bhelgaas@google.com,
	mpe@ellerman.id.au, aik@ozlabs.ru, ruscur@russell.cc,
	Wei Yang <weiyang@linux.vnet.ibm.com>
Subject: [PATCH v14 3/9] powerpc/pci: Remove VFs prior to PF
Date: Wed, 10 Feb 2016 17:02:51 +1100	[thread overview]
Message-ID: <1455084177-15525-4-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1455084177-15525-1-git-send-email-gwshan@linux.vnet.ibm.com>

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

As commit ac205b7bb72f ("PCI: make sriov work with hotplug remove")
indicates, VFs which is on the same PCI bus as their PF, should be
removed before the PF. Otherwise, we might run into kernel crash
at PCI unplugging time.

This applies the above pattern to powerpc PCI hotplug path.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/pci-hotplug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index 7f9ed0c..59c4361 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -55,7 +55,7 @@ void pcibios_remove_pci_devices(struct pci_bus *bus)
 
 	pr_debug("PCI: Removing devices on bus %04x:%02x\n",
 		 pci_domain_nr(bus),  bus->number);
-	list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
+	list_for_each_entry_safe_reverse(dev, tmp, &bus->devices, bus_list) {
 		pr_debug("   Removing %s...\n", pci_name(dev));
 		pci_stop_and_remove_bus_device(dev);
 	}
-- 
2.1.0

  parent reply	other threads:[~2016-02-10  6:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10  6:02 [PATCH v14 0/9] EEH Support for SRIOV VFs Gavin Shan
2016-02-10  6:02 ` [PATCH v14 1/9] PCI/IOV: Rename and export virtfn_{add, remove} Gavin Shan
2016-02-10  6:02 ` [PATCH v14 2/9] PCI: Add pcibios_bus_add_device() weak function Gavin Shan
2016-02-10  6:02 ` Gavin Shan [this message]
2016-02-10  6:02 ` [PATCH v14 4/9] powerpc/eeh: Cache normal BARs, not windows or IOV BARs Gavin Shan
2016-02-10  6:02 ` [PATCH v14 5/9] powerpc/eeh: EEH device for VF Gavin Shan
2016-02-10  6:02 ` [PATCH v14 6/9] powerpc/eeh: Create PE for VFs Gavin Shan
2016-02-10  6:02 ` [PATCH v14 7/9] powerpc/powernv: Support EEH reset for VF PE Gavin Shan
2016-02-10  6:02 ` [PATCH v14 8/9] powerpc/powernv: Support PCI config restore for VFs Gavin Shan
2016-02-10  6:02 ` [PATCH v14 9/9] powerpc/eeh: powerpc/eeh: Support error recovery for VF PE Gavin Shan
2016-03-03 23:58 ` [PATCH v14 0/9] EEH Support for SRIOV VFs 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=1455084177-15525-4-git-send-email-gwshan@linux.vnet.ibm.com \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --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).