[Skiboot] [PATCH 8/9] phb4: Move code to find frozen PE earlier
Michael Neuling
mikey at neuling.org
Fri Oct 20 22:59:41 AEDT 2017
We are going to reuse this so move it earlier. No functional change
Signed-off-by: Michael Neuling <mikey at neuling.org>
---
hw/phb4.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/hw/phb4.c b/hw/phb4.c
index 1097bd1857..acd521a927 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;
--
2.11.0
More information about the Skiboot
mailing list