From 6dad43ff4c68b84d86fed4662f8d3c25b1c8eb0a Mon Sep 17 00:00:00 2001 From: Mahesh Salgaonkar Date: Mon, 16 Apr 2018 23:04:29 +0530 Subject: opal/hmi: Generate hmi event for recovered HDEC parity error. Signed-off-by: Mahesh Salgaonkar Signed-off-by: Stewart Smith --- hw/chiptod.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'hw/chiptod.c') diff --git a/hw/chiptod.c b/hw/chiptod.c index 28ed897..df1274c 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; } /* -- cgit v1.1