diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-02-23 18:09:56 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-02-23 18:09:56 +0000 |
commit | 9d18d3cab2ded9491923ec1f9ff0538ba0b77399 (patch) | |
tree | 257d5b059f892c67ef9e85ddfaeba69484f0693d /sys/arch/arm/xscale | |
parent | 7af0e6665ca312c38275ea2c818969da7812af30 (diff) |
When jumping out of the interrupt handler early, clear conditions we know
are likely set but don't need specific handling.
This silences the interrupt handler if DIAGNOSTIC in some cases.
ok grange@ deraadt@
Diffstat (limited to 'sys/arch/arm/xscale')
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_mmc.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_mmc.c b/sys/arch/arm/xscale/pxa2x0_mmc.c index a2dca15ded4..42cb8eff3eb 100644 --- a/sys/arch/arm/xscale/pxa2x0_mmc.c +++ b/sys/arch/arm/xscale/pxa2x0_mmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_mmc.c,v 1.4 2009/02/20 19:16:34 miod Exp $ */ +/* $OpenBSD: pxa2x0_mmc.c,v 1.5 2009/02/23 18:09:55 miod Exp $ */ /* * Copyright (c) 2007 Uwe Stuehler <uwe@openbsd.org> @@ -474,11 +474,17 @@ pxammc_intr(void *arg) { struct pxammc_softc *sc = arg; int status; +#ifdef DIAGNOSTIC + int wstatus; +#endif #define MMC_I_REG_STR "\20\001DATADONE\002PRGDONE\003ENDCMDRES" \ "\004STOPCMD\005CLKISOFF\006RXFIFO\007TXFIFO" \ "\011DATERR\012RESERR\014SDIO" +#ifdef DIAGNOSTIC + wstatus = +#endif status = CSR_READ_4(sc, MMC_I_REG) & ~CSR_READ_4(sc, MMC_I_MASK); DPRINTF(1,("%s: intr %b\n", sc->sc_dev.dv_xname, status, MMC_I_REG_STR)); @@ -509,6 +515,11 @@ pxammc_intr(void *arg) pxammc_intr_cmd(sc); CSR_SET_4(sc, MMC_I_MASK, MMC_I_END_CMD_RES); CLR(status, MMC_I_END_CMD_RES); + /* ignore programming done condition */ + if (ISSET(status, MMC_I_PRG_DONE)) { + CSR_SET_4(sc, MMC_I_MASK, MMC_I_PRG_DONE); + CLR(status, MMC_I_PRG_DONE); + } if (sc->sc_cmd == NULL) goto end; } @@ -523,6 +534,11 @@ pxammc_intr(void *arg) pxammc_intr_done(sc); CSR_SET_4(sc, MMC_I_MASK, MMC_I_DAT_ERR); CLR(status, MMC_I_DAT_ERR); + /* ignore transmission done condition */ + if (ISSET(status, MMC_I_DATA_TRAN_DONE)) { + CSR_SET_4(sc, MMC_I_MASK, MMC_I_DATA_TRAN_DONE); + CLR(status, MMC_I_DATA_TRAN_DONE); + } goto end; } @@ -536,8 +552,9 @@ end: /* Avoid further unhandled interrupts. */ if (status != 0) { #ifdef DIAGNOSTIC - printf("%s: unhandled interrupt %b\n", sc->sc_dev.dv_xname, - status, MMC_I_REG_STR); + printf("%s: unhandled interrupt %b out of %b\n", + sc->sc_dev.dv_xname, status, MMC_I_REG_STR, + wstatus, MMC_I_REG_STR); #endif CSR_SET_4(sc, MMC_I_MASK, status); } |