aboutsummaryrefslogtreecommitdiff
path: root/hw/phb3.c
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2015-08-13 14:40:04 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-08-14 15:58:07 +1000
commitf8680a86f4aa19ced179f2a8da352c5650ba48cf (patch)
tree2f78834e120805c3c860d7b89395a6fb23a9415d /hw/phb3.c
parent200df96fb4ce9e2845cdb5f18f01d4c1ff82baeb (diff)
downloadskiboot-f8680a86f4aa19ced179f2a8da352c5650ba48cf.zip
skiboot-f8680a86f4aa19ced179f2a8da352c5650ba48cf.tar.gz
skiboot-f8680a86f4aa19ced179f2a8da352c5650ba48cf.tar.bz2
phb3: Continue CAPP setup even if PHB is already in CAPP mode
This fixes a critical bug in CAPI support. CAPI requires that all faults are escalated into a fence, not a freeze. This is done by setting bits in a number of MMIO registers. phb3_set_capi_mode() calls phb3_init_capp_errors() to do this. However, if the PHB is already in CAPP mode - for example in the recovery case - phb3_set_capi_mode() will bail out early, and those registers will not be set. This is quite easy to verify. PCI config space access errors, for example, normally cause a freeze. On a CAPI-mode PHB, they should cause a fence. Say we have a CAPI card on PHB 0, and we inject a PCI config space error: echo 0x8000000000000000 > /sys/kernel/debug/powerpc/PCI0000/err_injct_inboundA; lspci; The first time we inject this, the PHB will fence and recover, but won't reset the registers. Therefore, the second time we inject it, we will incorrectly freeze, not fence. Worse, the recovery for the resultant EEH freeze event interacts poorly with the CAPP, triggering an EEH recovery of the PHB. The combination of the two attempted recoveries will get the PHB into an inoperable state. It's quite likely that there other side effects of bailing out early. For example, the timebase sync probably fails to recover. Rather than auditing all the possibilities, I verified that repeating the entire setup procedure still works when the PHB is already in CAPP mode. It does work, so just do the entire setup every time instead of bailing out early. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/phb3.c')
-rw-r--r--hw/phb3.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/hw/phb3.c b/hw/phb3.c
index 3f56fbc..9fa8afb 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -3197,7 +3197,6 @@ static int64_t phb3_set_capi_mode(struct phb *phb, uint64_t mode,
xscom_read(p->chip_id, 0x9013c03, &reg);
if (reg & PPC_BIT(0)) {
PHBDBG(p, "Already in CAPP mode\n");
- return OPAL_SUCCESS;
}
if (!p->capp_ucode_loaded) {