summaryrefslogtreecommitdiffstats
path: root/sys/isa/fdc.h
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-29 13:00:42 +0000
committerbde <bde@FreeBSD.org>1998-07-29 13:00:42 +0000
commit12ec611ec6ad9af841215b368ec1c5212a2bef71 (patch)
tree0e9aafc415fe03d6250f2053ee6e59f835182079 /sys/isa/fdc.h
parent57a5f9023d7ba6eb9c0fe02789312a0d6ae4e363 (diff)
downloadFreeBSD-src-12ec611ec6ad9af841215b368ec1c5212a2bef71.zip
FreeBSD-src-12ec611ec6ad9af841215b368ec1c5212a2bef71.tar.gz
Fixed error handling:
- Call isa_dmadone() whenever necessary to stop DMA and/or free bounce buffers. Undead DMA corrupted the malloc freelist fairly consistently in the following configuration: SLICE kernel, 2 floppy drives, no disk in fd0, disk in fd1. - Don't call fdc_reset() from fd_timeout(). Doing so gave an "extra" interrupt which was usually misinterpreted as being for completion of the next FDC command; the interrupt for completion of the next FDC command was then usually misinterpreted... There were further complications for interrupts latched by the soft-spl mechanism so that they were delivered after all the h/w interrupts went away. This caused at least wrong head settle delays and may be why the FreeBSD floppy driver seems to munch floppies more than most floppy drivers. The reset was unnecessary anyway in cases that didn't have the bug described next, since is was repeated a little later for the IOTIMEDOUT state. The state machine has complications to handle resets correctly, so just use it. - Don't call retrier() from fd_timeout(). The IOTIMEDOUT state needs to be processed next, and it isn't valid to set to that state if retrier() has aborted the current transfer. Doing so caused null pointer panics after the previous bug was fixed. Improved error handling: - If an i/o is aborted, arrange to reset in the state machine before doing the next i/o. New fdc flag for this. This fixes spurious warnings and lengthy busy-waiting for the next i/o. - Split STARTRECAL into RESETCOMPLETE and STARTRECAL and only check for the results from reset if we actually reset. This fixes spurious warnings for other paths to STARTRECAL. [Oops, it may break reset handling for motor-off resets.] Cleanups in fd_timeout(): - Renamed to fd_iotimeout() to make it clearer that it is only used for i/o. - Don't handle the bp == 0 case. This case can't happen for i/o. - Don't check for controller-busy. We know it must be. - Don't print anything. retrier() already prints too much for normal errors. - Fudge the state differently so that the state machine advances fdc->retry and the status is invalid (perhaps this should fudge a valid state like the one for WP). - Style fixes.
Diffstat (limited to 'sys/isa/fdc.h')
-rw-r--r--sys/isa/fdc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/isa/fdc.h b/sys/isa/fdc.h
index 8524123..fdaf694 100644
--- a/sys/isa/fdc.h
+++ b/sys/isa/fdc.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fdc.h,v 1.9 1997/09/17 20:16:16 tegge Exp $
+ * $Id: fdc.h,v 1.10 1998/07/11 06:35:39 bde Exp $
*
*/
@@ -55,6 +55,7 @@ struct fdc_data
#define FDC_TAPE_BUSY 0x04
#define FDC_STAT_VALID 0x08
#define FDC_HAS_FIFO 0x10
+#define FDC_NEEDS_RESET 0x20
struct fd_data *fd;
int fdu; /* the active drive */
int state;
OpenPOWER on IntegriCloud