From dc4cdffafee76a19a577276dadd9bf35fe4cbf66 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Mon, 23 Oct 2017 21:22:21 +1100 Subject: [PATCH] phb4: Move code to find frozen PE earlier We are going to reuse this so move it earlier. No functional change Signed-off-by: Michael Neuling Signed-off-by: Stewart Smith --- hw/phb4.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/phb4.c b/hw/phb4.c index c01e1c8e974c..3b4f014bcb01 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -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) { @@ -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;