Skip to content

Commit

Permalink
phb4/capp: Only reset FIR bits that cause capp machine check
Browse files Browse the repository at this point in the history
During CAPP recovery do_capp_recovery_scoms() will reset the CAPP Fir
register just after CAPP recovery is completed. This has an
unintentional side effect of preventing PRD from analyzing and
reporting this error. If PRD tries to read the CAPP FIR after opal has
already reset it, then it logs a critical error complaining "No active
error bits found".

To prevent this from happening we update do_capp_recovery_scoms() to
only reset fir bits that cause CAPP machine check (local xstop). This
is done by reading the CAPP Fir Action0/1 & Mask registers and
generating a mask which is then written on CAPP_FIR_CLEAR register.

Cc: stable
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
vaibhav92 authored and stewartsmith committed Nov 2, 2018
1 parent 9597a12 commit 9992467
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions hw/phb4.c
Original file line number Diff line number Diff line change
Expand Up @@ -3068,7 +3068,24 @@ static int do_capp_recovery_scoms(struct phb4 *p)

/* Check if the recovery failed or passed */
if (reg & PPC_BIT(1)) {
uint64_t act0, act1, mask, fir;

/* Use the Action0/1 and mask to only clear the bits
* that cause local checkstop. Other bits needs attention
* of the PRD daemon.
*/
xscom_read(p->chip_id, CAPP_FIR_ACTION0 + offset, &act0);
xscom_read(p->chip_id, CAPP_FIR_ACTION1 + offset, &act1);
xscom_read(p->chip_id, CAPP_FIR_MASK + offset, &mask);
xscom_read(p->chip_id, CAPP_FIR + offset, &fir);

fir = ~(fir & ~mask & act0 & act1);
PHBDBG(p, "Doing CAPP recovery scoms\n");

/* update capp fir clearing bits causing local checkstop */
PHBDBG(p, "Resetting CAPP Fir with mask 0x%016llX\n", fir);
xscom_write(p->chip_id, CAPP_FIR_CLEAR + offset, fir);

/* disable snoops */
xscom_write(p->chip_id, SNOOP_CAPI_CONFIG + offset, 0);
load_capp_ucode(p);
Expand Down
1 change: 1 addition & 0 deletions include/phb4-capp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define CAPP_APC_MASTER_ARRAY_WRITE_REG 0x2010842 /* Satellite 2 */

#define CAPP_FIR 0x2010800
#define CAPP_FIR_CLEAR 0x2010801
#define CAPP_FIR_MASK 0x2010803
#define CAPP_FIR_ACTION0 0x2010806
#define CAPP_FIR_ACTION1 0x2010807
Expand Down

0 comments on commit 9992467

Please sign in to comment.