Skip to content

Commit

Permalink
opal/hmi: Stop flooding HMI event for TOD errors.
Browse files Browse the repository at this point in the history
Fix the issue where every thread on the chip sends HMI event to host for
TOD errors. TOD errors are reported to all the core/threads on the chip.
Any one thread can fix the error and send event. Rest of the threads don't
need to send HMI event unnecessarily.

This patch fixes this by modifying __chiptod_recover_tod_errors() function
to return -1 if no errors found. Without this change every thread that
see TFMR[51]=1 sends HMI event to the host kernel.

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 8ff9be7 commit 2fd9266
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hw/chiptod.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ static int __chiptod_recover_tod_errors(void)
{
uint64_t terr;
uint64_t treset = 0;
int i;
int i, rc = -1;
int32_t chip_id = this_cpu()->chip_id;

/* Read TOD error register */
Expand All @@ -990,6 +990,7 @@ static int __chiptod_recover_tod_errors(void)
(terr & TOD_ERR_DELAY_COMPL_PARITY) ||
(terr & TOD_ERR_TOD_REGISTER_PARITY)) {
chiptod_reset_tod_errors();
rc = 1;
}

/*
Expand Down Expand Up @@ -1023,7 +1024,9 @@ static int __chiptod_recover_tod_errors(void)
return 0;
}
/* We have handled all the TOD errors routed to hypervisor */
return 1;
if (treset)
rc = 1;
return rc;
}

int chiptod_recover_tod_errors(void)
Expand Down

0 comments on commit 2fd9266

Please sign in to comment.