Fixed formatting. Problem was that we were trying to get the result

of a data transfer operation immediately after the data transfer
was finished, instead of waiting for the chip to interrupt us and
tell us that it was finished and had the result for us.  This worked
okay for read and write since the operation would be finished very
shortly after the data transfer completed.  However, with formatting,
the chip still had most of the rest of the track to do, so we ended
up timing out before the operation was finished.  This fix is from
sparc64/dev/fdc.c and was tested on sparc by tnn@.
This commit is contained in:
jnemeth 2007-05-11 18:12:16 +00:00
parent 9d8e6e5668
commit 50c13cb87a
1 changed files with 8 additions and 9 deletions

View File

@ -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 <sys/cdefs.h>
__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;
}
}