From: kettenis Date: Wed, 23 Jul 2008 12:18:40 +0000 (+0000) Subject: Clear correctable errors after handling them. From Bjorn Andersson. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=45d6f03d141585c79d84d15b06e61f971590e7f5;p=openbsd Clear correctable errors after handling them. From Bjorn Andersson. --- diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c index 40c2c8baf38..8ec9081fb50 100644 --- a/sys/arch/sparc64/dev/psycho.c +++ b/sys/arch/sparc64/dev/psycho.c @@ -1,4 +1,4 @@ -/* $OpenBSD: psycho.c,v 1.61 2008/07/20 10:37:43 kettenis Exp $ */ +/* $OpenBSD: psycho.c,v 1.62 2008/07/23 12:18:40 kettenis Exp $ */ /* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */ /* @@ -765,15 +765,23 @@ int psycho_ce(void *arg) { struct psycho_softc *sc = arg; + u_int64_t afar, afsr; /* * It's correctable. Dump the regs and continue. */ + afar = psycho_psychoreg_read(sc, psy_ce_afar); + afsr = psycho_psychoreg_read(sc, psy_ce_afsr); + printf("%s: correctable DMA error AFAR %llx AFSR %llx\n", - sc->sc_dev.dv_xname, - (long long)psycho_psychoreg_read(sc, psy_ce_afar), - (long long)psycho_psychoreg_read(sc, psy_ce_afsr)); + sc->sc_dev.dv_xname, afar, afsr); + + /* Clear error. */ + psycho_psychoreg_write(sc, psy_ce_afsr, + afsr & (PSY_CEAFSR_PDRD | PSY_CEAFSR_PDWR | + PSY_CEAFSR_SDRD | PSY_CEAFSR_SDWR)); + return (1); }