From owner-cvs-all Wed Jul 29 06:02:10 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA18619 for cvs-all-outgoing; Wed, 29 Jul 1998 06:02:10 -0700 (PDT) (envelope-from owner-cvs-all) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA18614; Wed, 29 Jul 1998 06:02:08 -0700 (PDT) (envelope-from bde@FreeBSD.org) From: Bruce Evans Received: (from bde@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id GAA10797; Wed, 29 Jul 1998 06:00:44 -0700 (PDT) Date: Wed, 29 Jul 1998 06:00:44 -0700 (PDT) Message-Id: <199807291300.GAA10797@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: cvs commit: src/sys/i386/isa fd.c fdc.h Sender: owner-cvs-all@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk bde 1998/07/29 06:00:44 PDT Modified files: sys/i386/isa fd.c fdc.h Log: 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. Revision Changes Path 1.120 +61 -56 src/sys/i386/isa/fd.c 1.11 +2 -1 src/sys/i386/isa/fdc.h