Skip to content

Commit

Permalink
phb4: Move code to find frozen PE earlier
Browse files Browse the repository at this point in the history
We are going to reuse this so move it earlier. No functional change

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
mikey authored and stewartsmith committed Oct 23, 2017
1 parent 5ee73db commit dc4cdff
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions hw/phb4.c
Expand Up @@ -3189,6 +3189,19 @@ static int64_t phb4_eeh_next_error(struct phb *phb,
* for the case.
*/
if (p->err.err_class == PHB4_ERR_CLASS_ER) {
for (i = peev_size - 1; i >= 0; i--) {
phb4_ioda_sel(p, IODA3_TBL_PEEV, i, false);
peev = in_be64(p->regs + PHB_IODA_DATA0);
for (j = 0; j < 64; j++) {
if (peev & PPC_BIT(j)) {
*first_frozen_pe = i * 64 + j;
break;
}
}
if (*first_frozen_pe != (uint64_t)(-1))
break;
}

}

switch (p->err.err_class) {
Expand All @@ -3204,20 +3217,6 @@ static int64_t phb4_eeh_next_error(struct phb *phb,
*pci_error_type = OPAL_EEH_PE_ERROR;
*severity = OPAL_EEH_SEV_PE_ER;

for (i = peev_size - 1; i >= 0; i--) {
phb4_ioda_sel(p, IODA3_TBL_PEEV, i, false);
peev = in_be64(p->regs + PHB_IODA_DATA0);
for (j = 0; j < 64; j++) {
if (peev & PPC_BIT(j)) {
*first_frozen_pe = i * 64 + j;
break;
}
}

if (*first_frozen_pe != (uint64_t)(-1))
break;
}

/* No frozen PE ? */
if (*first_frozen_pe == (uint64_t)-1) {
*pci_error_type = OPAL_EEH_NO_ERROR;
Expand Down

0 comments on commit dc4cdff

Please sign in to comment.