summaryrefslogtreecommitdiff
path: root/cpu/ppc4xx/traps.c
diff options
context:
space:
mode:
authorGrzegorz Bernacki <gjb@semihalf.com>2007-07-31 18:51:48 +0200
committerStefan Roese <sr@denx.de>2007-08-02 08:25:27 +0200
commitc92409812206ac67a7fa7aae298539a9c3804a46 (patch)
tree5bd063206855c92bade65703c2848e2ccb33633e /cpu/ppc4xx/traps.c
parentdec99558b9ea75a37940d07f41a3565a50b54ad1 (diff)
downloadu-boot-imx-c92409812206ac67a7fa7aae298539a9c3804a46.zip
u-boot-imx-c92409812206ac67a7fa7aae298539a9c3804a46.tar.gz
u-boot-imx-c92409812206ac67a7fa7aae298539a9c3804a46.tar.bz2
[ppc440SPe] Graceful recovery from machine check during PCIe configuration
During config transactions on the PCIe bus an attempt to scan for a non-existent device can lead to a machine check exception with certain peripheral devices. In order to avoid crashing in such scenarios the instrumented versions of the config cycle read routines are introduced, so the exceptions fixups framework can gracefully recover. Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com> Acked-by: Rafal Jaworowski <raj@semihalf.com>
Diffstat (limited to 'cpu/ppc4xx/traps.c')
-rwxr-xr-xcpu/ppc4xx/traps.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpu/ppc4xx/traps.c b/cpu/ppc4xx/traps.c
index 2fcce3d..6b15a9e 100755
--- a/cpu/ppc4xx/traps.c
+++ b/cpu/ppc4xx/traps.c
@@ -151,12 +151,17 @@ MachineCheckException(struct pt_regs *regs)
int uncorr_ecc = 0;
#endif
- /* Probing PCI using config cycles cause this exception
- * when a device is not present. Catch it and return to
- * the PCI exception handler.
+ /* Probing PCI(E) using config cycles may cause this exception
+ * when a device is not present. To gracefully recover in such
+ * scenarios config read/write routines need to be instrumented in
+ * order to return via fixup handler. For examples refer to
+ * pcie_in_8(), pcie_in_le16() and pcie_in_le32()
*/
if ((fixup = search_exception_table(regs->nip)) != 0) {
regs->nip = fixup;
+ val = mfspr(MCSR);
+ /* Clear MCSR */
+ mtspr(SPRN_MCSR, val);
return;
}