Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

EDAC, mpc85xx: Fix PCIe error capture

According to the reference manual of MPC8572 and T4240, bit 31 of
PEX_ERR_CAP_STAT is W1C (write 1 to clear).

Add the corresponding write to PEX_ERR_CAP_STAT in order to fix the PCIe
error capture.

Tested on a T4240 processor.

Signed-off-by: Tillmann Heidsieck <theidsieck@leenox.de>
Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20160815190849.29327-1-theidsieck@leenox.de
Signed-off-by: Borislav Petkov <bp@suse.de>

authored by

Tillmann Heidsieck and committed by
Borislav Petkov
6fa06b0d 7bb8b777

+9 -3
+9 -3
drivers/edac/mpc85xx_edac.c
··· 187 187 static void mpc85xx_pcie_check(struct edac_pci_ctl_info *pci) 188 188 { 189 189 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; 190 - u32 err_detect; 190 + u32 err_detect, err_cap_stat; 191 191 192 192 err_detect = in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR); 193 + err_cap_stat = in_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR); 193 194 194 195 pr_err("PCIe error(s) detected\n"); 195 196 pr_err("PCIe ERR_DR register: 0x%08x\n", err_detect); 196 - pr_err("PCIe ERR_CAP_STAT register: 0x%08x\n", 197 - in_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR)); 197 + pr_err("PCIe ERR_CAP_STAT register: 0x%08x\n", err_cap_stat); 198 198 pr_err("PCIe ERR_CAP_R0 register: 0x%08x\n", 199 199 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R0)); 200 200 pr_err("PCIe ERR_CAP_R1 register: 0x%08x\n", ··· 206 206 207 207 /* clear error bits */ 208 208 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect); 209 + 210 + /* reset error capture */ 211 + out_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR, err_cap_stat | 0x1); 209 212 } 210 213 211 214 static int mpc85xx_pcie_find_capability(struct device_node *np) ··· 346 343 347 344 /* clear error bits */ 348 345 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, ~0); 346 + 347 + /* reset error capture */ 348 + out_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR, 0x1); 349 349 350 350 if (edac_pci_add_device(pci, pdata->edac_idx) > 0) { 351 351 edac_dbg(3, "failed edac_pci_add_device()\n");