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/phb3.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/phb3.c')
-rw-r--r-- | hw/phb3.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -680,6 +680,24 @@ static int64_t phb3_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 phb3_papr_errinjct_reset(struct phb *phb) +{ + struct phb3 *p = phb_to_phb3(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 int64_t phb3_set_phb_mem_window(struct phb *phb, uint16_t window_type, uint16_t window_num, @@ -2968,6 +2986,7 @@ static const struct phb_ops phb3_ops = { .device_init = phb3_device_init, .presence_detect = phb3_presence_detect, .ioda_reset = phb3_ioda_reset, + .papr_errinjct_reset = phb3_papr_errinjct_reset, .pci_reinit = phb3_pci_reinit, .set_phb_mem_window = phb3_set_phb_mem_window, .phb_mmio_enable = phb3_phb_mmio_enable, |