Skip to content

Commit

Permalink
opal/hmi: Fix handling of TFMR parity/corrupt error.
Browse files Browse the repository at this point in the history
While testing TFMR parity/corrupt error it has been observed that HMIs are
delivered twice for this error
- First time HMI is delivered with HMER[4,5]=1 and TFMR[60]=1.
- Second time HMI is delivered with HMER[4,5]=1 and TFMR[60]=0 with valid TB.

On second HMI we end up throwing below error message even though TB is in
valid state.

	"HMI: TB invalid without core error reported"

This patch fixes this issue by ignoring HMER[5] and checking only for
TFMR[60] before setting this_cpu()->tb_invalid to true.

Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
maheshsal authored and stewartsmith committed Apr 17, 2018
1 parent 2fd9266 commit fab27f3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/hmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,14 +1045,13 @@ static int handle_all_core_tfac_error(uint64_t tfmr, uint64_t *out_flags)
return recover;
}

static int handle_tfac_errors(uint64_t hmer, struct OpalHMIEvent *hmi_evt,
uint64_t *out_flags)
static int handle_tfac_errors(struct OpalHMIEvent *hmi_evt, uint64_t *out_flags)
{
int recover = -1;
uint64_t tfmr = mfspr(SPR_TFMR);

/* A TFMR parity error makes us ignore all the local stuff */
if ((hmer & SPR_HMER_TFMR_PARITY_ERROR) || (tfmr & SPR_TFMR_TFMR_CORRUPT)) {
/* A TFMR parity/corrupt error makes us ignore all the local stuff.*/
if (tfmr & SPR_TFMR_TFMR_CORRUPT) {
/* Mark TB as invalid for now as we don't trust TFMR, we'll fix
* it up later
*/
Expand Down Expand Up @@ -1160,7 +1159,7 @@ static int handle_hmi_exception(uint64_t hmer, struct OpalHMIEvent *hmi_evt,
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);
recover = handle_tfac_errors(hmi_evt, out_flags);
handled = 0;
}

Expand Down

0 comments on commit fab27f3

Please sign in to comment.