Commit 372fb80d authored by Gavin Shan's avatar Gavin Shan Committed by Michael Ellerman

powerpc/powernv: Fetch frozen PE on top level

It should have been part of commit 1ad7a72c ("powerpc/eeh: Report
frozen parent PE prior to child PE"). There are 2 ways to report
EEH errors: proactively polling because of 0xFF's returned from
PCI config or IO read, or interrupt driven event. We missed to
report and handle parent frozen PE prior to child frozen PE for
the later case on PowerNV platform.
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent f2e0be5e
...@@ -886,14 +886,12 @@ static int ioda_eeh_get_pe(struct pci_controller *hose, ...@@ -886,14 +886,12 @@ static int ioda_eeh_get_pe(struct pci_controller *hose,
* the master PE because slave PE is invisible * the master PE because slave PE is invisible
* to EEH core. * to EEH core.
*/ */
if (phb->get_pe_state) { pnv_pe = &phb->ioda.pe_array[pe_no];
pnv_pe = &phb->ioda.pe_array[pe_no]; if (pnv_pe->flags & PNV_IODA_PE_SLAVE) {
if (pnv_pe->flags & PNV_IODA_PE_SLAVE) { pnv_pe = pnv_pe->master;
pnv_pe = pnv_pe->master; WARN_ON(!pnv_pe ||
WARN_ON(!pnv_pe || !(pnv_pe->flags & PNV_IODA_PE_MASTER));
!(pnv_pe->flags & PNV_IODA_PE_MASTER)); pe_no = pnv_pe->pe_number;
pe_no = pnv_pe->pe_number;
}
} }
/* Find the PE according to PE# */ /* Find the PE according to PE# */
...@@ -904,15 +902,37 @@ static int ioda_eeh_get_pe(struct pci_controller *hose, ...@@ -904,15 +902,37 @@ static int ioda_eeh_get_pe(struct pci_controller *hose,
if (!dev_pe) if (!dev_pe)
return -EEXIST; return -EEXIST;
/* /* Freeze the (compound) PE */
* At this point, we're sure the compound PE should
* be put into frozen state.
*/
*pe = dev_pe; *pe = dev_pe;
if (phb->freeze_pe && if (!(dev_pe->state & EEH_PE_ISOLATED))
!(dev_pe->state & EEH_PE_ISOLATED))
phb->freeze_pe(phb, pe_no); phb->freeze_pe(phb, pe_no);
/*
* At this point, we're sure the (compound) PE should
* have been frozen. However, we still need poke until
* hitting the frozen PE on top level.
*/
dev_pe = dev_pe->parent;
while (dev_pe && !(dev_pe->type & EEH_PE_PHB)) {
int ret;
int active_flags = (EEH_STATE_MMIO_ACTIVE |
EEH_STATE_DMA_ACTIVE);
ret = eeh_ops->get_state(dev_pe, NULL);
if (ret <= 0 || (ret & active_flags) == active_flags) {
dev_pe = dev_pe->parent;
continue;
}
/* Frozen parent PE */
*pe = dev_pe;
if (!(dev_pe->state & EEH_PE_ISOLATED))
phb->freeze_pe(phb, dev_pe->addr);
/* Next one */
dev_pe = dev_pe->parent;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment