linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: Fix the state of root PE
@ 2016-09-13  6:40 Gavin Shan
  2016-09-15 22:07 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Gavin Shan @ 2016-09-13  6:40 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, fbarrat, Gavin Shan

The PE for root bus (root PE) can be removed because of PCI hot
remove in EEH recovery path for fenced PHB error. We need update
@phb->root_pe_populated accordingly so that the root PE can be
populated again in forthcoming PCI hot add path. Also, the PE
shouldn't be destroyed as it's global and reserved resource.

Fixes: c5f7700bbd2e ("powerpc/powernv: Dynamically release PE")
Reported-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index e98f4a8..c38a6a1 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -3426,7 +3426,16 @@ static void pnv_ioda_release_pe(struct pnv_ioda_pe *pe)
 		}
 	}
 
-	pnv_ioda_free_pe(pe);
+	/* The PE for root bus can be removed because of hotplug in EEH
+	 * recovery for fenced PHB error. We need mark the PE dead so
+	 * that it can be populated again in PCI hot add path. The PE
+	 * shouldn't be destroyed as it's the global reserved resource.
+	 */
+	if (phb->ioda.root_pe_populated &&
+	    phb->ioda.root_pe_idx == pe->pe_number)
+		phb->ioda.root_pe_populated = false;
+	else
+		pnv_ioda_free_pe(pe);
 }
 
 static void pnv_pci_release_device(struct pci_dev *pdev)
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: powerpc/powernv: Fix the state of root PE
  2016-09-13  6:40 [PATCH] powerpc/powernv: Fix the state of root PE Gavin Shan
@ 2016-09-15 22:07 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2016-09-15 22:07 UTC (permalink / raw)
  To: Gavin Shan, linuxppc-dev; +Cc: Gavin Shan, fbarrat

On Tue, 2016-13-09 at 06:40:24 UTC, Gavin Shan wrote:
> The PE for root bus (root PE) can be removed because of PCI hot
> remove in EEH recovery path for fenced PHB error. We need update
> @phb->root_pe_populated accordingly so that the root PE can be
> populated again in forthcoming PCI hot add path. Also, the PE
> shouldn't be destroyed as it's global and reserved resource.
> 
> Fixes: c5f7700bbd2e ("powerpc/powernv: Dynamically release PE")
> Reported-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/6eaed1665fc6864fbdbffcc6f4

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-15 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-13  6:40 [PATCH] powerpc/powernv: Fix the state of root PE Gavin Shan
2016-09-15 22:07 ` Michael Ellerman

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).