diff options
author | Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> | 2018-04-16 23:04:29 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-04-17 03:52:10 -0500 |
commit | 6dad43ff4c68b84d86fed4662f8d3c25b1c8eb0a (patch) | |
tree | b4897b3f87d3492083dca499fefcf67e848a395b | |
parent | 5362f85e04bd1b03d94711c62c20de3111234f25 (diff) | |
download | talos-skiboot-6dad43ff4c68b84d86fed4662f8d3c25b1c8eb0a.tar.gz talos-skiboot-6dad43ff4c68b84d86fed4662f8d3c25b1c8eb0a.zip |
opal/hmi: Generate hmi event for recovered HDEC parity error.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | core/hmi.c | 5 | ||||
-rw-r--r-- | hw/chiptod.c | 11 | ||||
-rw-r--r-- | include/chiptod.h | 2 |
3 files changed, 10 insertions, 8 deletions
@@ -1019,10 +1019,9 @@ static int handle_all_core_tfac_error(uint64_t tfmr, uint64_t *out_flags) hmi_rendez_vous(2); /* We can now clear the error conditions in the core. */ - if (!tfmr_clear_core_errors(tfmr)) { - recover = 0; + recover = tfmr_clear_core_errors(tfmr); + if (recover == 0) goto error_out; - } /* Third rendez-vous. We could in theory do the timebase resync as * part of the previous one, but I prefer having all the error diff --git a/hw/chiptod.c b/hw/chiptod.c index 28ed8973..df1274ca 100644 --- a/hw/chiptod.c +++ b/hw/chiptod.c @@ -1491,18 +1491,21 @@ void tfmr_cleanup_core_errors(uint64_t tfmr) } } -bool tfmr_clear_core_errors(uint64_t tfmr) +int tfmr_clear_core_errors(uint64_t tfmr) { uint64_t tfmr_reset_errors = 0; - if (tfmr & SPR_TFMR_HDEC_PARITY_ERROR) - tfmr_reset_errors |= SPR_TFMR_HDEC_PARITY_ERROR; + /* return -1 if there is nothing to be fixed. */ + if (!(tfmr & SPR_TFMR_HDEC_PARITY_ERROR)) + return -1; + + tfmr_reset_errors |= SPR_TFMR_HDEC_PARITY_ERROR; /* Write TFMR twice to clear the error */ mtspr(SPR_TFMR, base_tfmr | tfmr_reset_errors); mtspr(SPR_TFMR, base_tfmr | tfmr_reset_errors); - return true; + return 1; } /* diff --git a/include/chiptod.h b/include/chiptod.h index 5860e34d..3717e667 100644 --- a/include/chiptod.h +++ b/include/chiptod.h @@ -33,7 +33,7 @@ extern int chiptod_recover_tb_errors(bool *out_resynced); extern bool tfmr_recover_local_errors(uint64_t tfmr); extern bool recover_corrupt_tfmr(void); extern void tfmr_cleanup_core_errors(uint64_t tfmr); -extern bool tfmr_clear_core_errors(uint64_t tfmr); +extern int tfmr_clear_core_errors(uint64_t tfmr); extern void chiptod_reset_tb(void); extern bool chiptod_adjust_topology(enum chiptod_topology topo, bool enable); extern bool chiptod_capp_timebase_sync(unsigned int chip_id, uint32_t tfmr_addr, |