From 5e20a789d021dd14bb30439cd9b3beb3dfeed9b7 Mon Sep 17 00:00:00 2001 From: Mahesh Salgaonkar Date: Mon, 16 Apr 2018 23:03:43 +0530 Subject: opal/hmi: Initialize the hmi event with old value of HMER. Do this before we check for TFAC errors. Otherwise the event at host console shows no error reported in HMER register. Without this patch the console event show HMER with all zeros [ 216.753417] Severe Hypervisor Maintenance interrupt [Recovered] [ 216.753498] Error detail: Timer facility experienced an error [ 216.753509] HMER: 0000000000000000 [ 216.753518] TFMR: 3c12000870e04000 After this patch it shows old HMER values on host console: [ 2237.652533] Severe Hypervisor Maintenance interrupt [Recovered] [ 2237.652651] Error detail: Timer facility experienced an error [ 2237.652766] HMER: 0840000000000000 [ 2237.652837] TFMR: 3c12000870e04000 Signed-off-by: Mahesh Salgaonkar Signed-off-by: Stewart Smith --- core/hmi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/hmi.c b/core/hmi.c index f5151298..95ab96cd 100644 --- a/core/hmi.c +++ b/core/hmi.c @@ -1131,8 +1131,14 @@ static int handle_hmi_exception(uint64_t hmer, struct OpalHMIEvent *hmi_evt, int recover = 1; uint64_t handled = 0; + prlog(PR_DEBUG, "Received HMI interrupt: HMER = 0x%016llx\n", hmer); + /* Initialize the hmi event with old value of HMER */ + if (hmi_evt) + hmi_evt->hmer = hmer; + /* Handle Timer/TOD errors separately */ if (hmer & (SPR_HMER_TFAC_ERROR | SPR_HMER_TFMR_PARITY_ERROR)) { + hmi_print_debug("Timer Facility Error", hmer); handled = hmer & (SPR_HMER_TFAC_ERROR | SPR_HMER_TFMR_PARITY_ERROR); mtspr(SPR_HMER, ~handled); recover = handle_tfac_errors(hmer, hmi_evt, out_flags); @@ -1145,9 +1151,6 @@ static int handle_hmi_exception(uint64_t hmer, struct OpalHMIEvent *hmi_evt, * looking at TFMR register. TFMR will tell us correct state of * TB register. */ - prlog(PR_DEBUG, "Received HMI interrupt: HMER = 0x%016llx\n", hmer); - if (hmi_evt) - hmi_evt->hmer = hmer; if (hmer & SPR_HMER_PROC_RECV_DONE) { uint32_t chip_id = pir_to_chip_id(cpu->pir); uint32_t core_id = pir_to_core_id(cpu->pir); -- cgit v1.2.1