diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index 6e22104c288f..564605de3523 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.132 2007/05/11 18:10:57 jnemeth Exp $ */ +/* $NetBSD: fd.c,v 1.133 2007/05/11 18:12:16 jnemeth Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -108,7 +108,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.132 2007/05/11 18:10:57 jnemeth Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.133 2007/05/11 18:12:16 jnemeth Exp $"); #include "opt_ddb.h" #include "opt_md.h" @@ -1333,16 +1333,18 @@ fdc_c_hwintr(void *arg) break; if ((msr & NE7_NDM) == 0) { + /* Execution phase finished, get result. */ fdcresult(fdc); fdc->sc_istatus = FDC_ISTATUS_DONE; softintr_schedule(fdc->sc_sicookie); -#ifdef FD_DEBUG - if (fdc_debug > 1) - printf("fdc: overrun: tc = %d\n", fdc->sc_tc); -#endif break; } + if (fdc->sc_tc == 0) + /* For some reason the controller wants to transfer + more data then what we want to transfer. */ + panic("fdc: overrun"); + /* Another byte can be transferred */ if ((msr & NE7_DIO) != 0) *fdc->sc_data = @@ -1353,10 +1355,7 @@ fdc_c_hwintr(void *arg) fdc->sc_data++; if (--fdc->sc_tc == 0) { - fdc->sc_istatus = FDC_ISTATUS_DONE; FTC_FLIP; - fdcresult(fdc); - softintr_schedule(fdc->sc_sicookie); break; } }