From tomdean@ix.netcom.com Sat Mar 20 10:15:06 1999
Return-Path: <tomdean@ix.netcom.com>
Received: from ix.netcom.com (sil-wa15-07.ix.netcom.com [207.93.148.7])
	by hub.freebsd.org (Postfix) with ESMTP id A9C28150BE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 20 Mar 1999 10:15:04 -0800 (PST)
	(envelope-from tomdean@ix.netcom.com)
Received: (from tomdean@localhost)
	by ix.netcom.com (8.9.3/8.8.8) id KAA04915;
	Sat, 20 Mar 1999 10:14:49 -0800 (PST)
	(envelope-from tomdean)
Message-Id: <199903201814.KAA04915@ix.netcom.com>
Date: Sat, 20 Mar 1999 10:14:49 -0800 (PST)
From: Thomas Dean <tomdean@ix.netcom.com>
Reply-To: tomdean@ix.netcom.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: fd fails for all operations
X-Send-Pr-Version: 3.2

>Number:         10695
>Category:       kern
>Synopsis:       fd fails for all operations
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 20 10:20:00 PST 1999
>Closed-Date:    Sat Apr 3 01:23:49 PST 1999
>Last-Modified:  Sat Apr  3 01:50:44 PST 1999
>Originator:     Thomas Dean
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

4.0-current SMP of Tue Mar  9 08:31:14 PST 1999.

>Description:

All operations to fd fail.  The drive works with DOS.
With known-good floppies:

# mount_msdos /dev/fd0a /floppy
mount_msdos: /dev/fd0a: Input/output error
# dmesg
<snip>
fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
fd0c: hard error reading fsbn 0 (No status)

# fdformat fd0.1440
Format 1440K floppy `/dev/rfd0'? (y/n): y
Processing fdformat: ioctl(FD_FORM): Input/output error
# dmesg
<snip>
fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
fd0c: hard error writing fsbn 0 (No status)


>How-To-Repeat:

mount_msdos /dev/fd0a /floppy
-or-
fdformat fd0.1440
-or-
mount /dev/fd0a /mnt

>Fix:
	
	


>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, tomdean@ix.netcom.com
Cc:  
Subject: Re: kern/10695: fd fails for all operations
Date: Mon, 29 Mar 1999 13:50:33 +1000

 >>Description:
 >
 >All operations to fd fail.  The drive works with DOS.
 >With known-good floppies:
 >
 ># mount_msdos /dev/fd0a /floppy
 >mount_msdos: /dev/fd0a: Input/output error
 ># dmesg
 ><snip>
 >fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
 >fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
 >fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
 >fd0: recal failed ST0 70<abnrml,seek_cmplt,equ_chck> cyl 0
 >fd0c: hard error reading fsbn 0 (No status)
 
 Does the following change help?
 
 Bruce
 
 diff -c2 fd.c~ fd.c
 *** fd.c~	Fri Feb 12 03:59:44 1999
 --- fd.c	Mon Mar 29 13:46:13 1999
 ***************
 *** 1991,1996 ****
   			 * reset, so it has lost track of the current
   			 * cylinder.  Recalibrate to handle this case.
   			 */
 ! 			fdc->state = STARTRECAL;
   		}
   		return(1);	/* will return immediatly */
 --- 1991,1997 ----
   			 * reset, so it has lost track of the current
   			 * cylinder.  Recalibrate to handle this case.
 + 			 * But first, discard the results of the reset.
   			 */
 ! 			fdc->state = RESETCOMPLETE;
   		}
   		return(1);	/* will return immediatly */
 
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Sat Apr 3 01:23:49 PST 1999 
State-Changed-Why:  
Pilot error. 
The standard config line for ft0: 
"tape		ft0	at fdc0 drive 2" 
now screws up the standard config line for fd0: 
"disk		fd0	at fdc0 drive 0" 
by creating 2 fd0's. 
>Unformatted:
