diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2014-07-02 04:02:09 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-07-21 14:48:45 +1000 |
commit | 1b5220b4b7a337463cfe77e36d8988039f6facca (patch) | |
tree | b86507b5abae7b40d4b9e4c7215ce5b160802aa1 /hw/p7ioc-phb.c | |
parent | e3263abb512c80ca89e81d1ad9045dfd413188cb (diff) | |
download | skiboot-1b5220b4b7a337463cfe77e36d8988039f6facca.zip skiboot-1b5220b4b7a337463cfe77e36d8988039f6facca.tar.gz skiboot-1b5220b4b7a337463cfe77e36d8988039f6facca.tar.bz2 |
PCI: Clear PAPR error injection
Though the p7ioc spec states the errors triggered by PAPR error
injection register set (0x2b0, 0x2b8, 0x2c0) should be one-shot
without "sticky" bit, Firebird-L machine doesn't follow the rule.
It will cause endless frozen PE until we have to remove the PE
permanently.
The patch extends opal_pci_reset() allowing kernel to clear PAPR
error injection register set at appropriate point.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/p7ioc-phb.c')
-rw-r--r-- | hw/p7ioc-phb.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c index bea18ea..64dbfed 100644 --- a/hw/p7ioc-phb.c +++ b/hw/p7ioc-phb.c @@ -2494,6 +2494,24 @@ static int64_t p7ioc_ioda_reset(struct phb *phb, bool purge) return OPAL_SUCCESS; } +/* + * Clear anything we have in PAPR Error Injection registers. Though + * the spec says the PAPR error injection should be one-shot without + * the "sticky" bit. However, that's false according to the experiments + * I had. So we have to clear it at appropriate point in kernel to + * avoid endless frozen PE. + */ +static int64_t p7ioc_papr_errinjct_reset(struct phb *phb) +{ + struct p7ioc_phb *p = phb_to_p7ioc_phb(phb); + + out_be64(p->regs + PHB_PAPR_ERR_INJ_CTL, 0x0ul); + out_be64(p->regs + PHB_PAPR_ERR_INJ_ADDR, 0x0ul); + out_be64(p->regs + PHB_PAPR_ERR_INJ_MASK, 0x0ul); + + return OPAL_SUCCESS; +} + static const struct phb_ops p7ioc_phb_ops = { .lock = p7ioc_phb_lock, .unlock = p7ioc_phb_unlock, @@ -2526,6 +2544,7 @@ static const struct phb_ops p7ioc_phb_ops = { .get_msi_32 = p7ioc_get_msi_32, .get_msi_64 = p7ioc_get_msi_64, .ioda_reset = p7ioc_ioda_reset, + .papr_errinjct_reset = p7ioc_papr_errinjct_reset, .presence_detect = p7ioc_presence_detect, .link_state = p7ioc_link_state, .power_state = p7ioc_power_state, |