kern/103841: fdc(4) does not work
Eugene Grosbein
eugen at grosbein.pp.ru
Fri Sep 29 22:00:38 PDT 2006
>Number: 103841
>Category: kern
>Synopsis: fdc(4) does not work
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Sep 30 05:00:35 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Eugene Grosbein
>Release: FreeBSD 6.2-PRERELEASE i386
>Organization:
Svyaz-Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #11: Sat Sep 30 11:46:06 KRAST 2006 eu at grosbein.pp.ru:/mnt/home/obj/usr/local/src/sys/DADV i386
Intel D975XBX motherboard, "standard" FDD 1.44
>Description:
I have a dual-boot machine, FreeBSD 6.2-PRERELEASE/Windows XP Sp2.
FDD work fine with Windows XP, it formats, writes and reads
floppy disks normally. It does not work with FreeBSD at all.
To obtain meaningful debug info I made 'debug.fdc.debugflags'
loader tunable with the following patch:
--- fdc.c.orig Sat Sep 30 12:18:40 2006
+++ fdc.c Sat Sep 30 11:45:51 2006
@@ -268,6 +268,7 @@
"FIFO threshold setting");
static int debugflags = 0;
+TUNABLE_INT("debug.fdc.debugflags", &debugflags);
SYSCTL_INT(_debug_fdc, OID_AUTO, debugflags, CTLFLAG_RW, &debugflags, 0,
"Debug flags");
Please commit this :-)
Now details:
1. fdc(4) driver makes 65 second delay during last stage of
kernel initialization just before GEOM adds ATA drives,
if FDD has no floppy disk inserted.
Without fdc enabled there is no delay.
I've used verbose boot and debug.fdc.debugflags=255 to see
what happens:
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f0 irq 6 drq 2 on acpi0
fdc0: ic_type 90 part_id 80
fdc0: [MPSAFE]
fdc0: [FAST]
00 00 00 00 af 10 12 80 57 00
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
New disk in probe
Got disk in probe
op 40 bn 0 siz 0 ptr 0xe391eb2c retry 0
-> 40 1 0 fe
status 40 01 00 fe ff 01
[unknown][UNKNOWN()]
Retry line 1123
Too many retries (EIO)
op 40 bn 0 siz 0 ptr 0xe391eb2c retry 0
-> 40 1 0 fe
status 40 01 00 fe ff 01
[unknown][UNKNOWN()]
Retry line 1123
Too many retries (EIO)
fd0: autoselection failed
op 1 bn 0 siz 512 ptr 0xc5177800 retry 0
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 1
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 2
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 3
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 4
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 5
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 6
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 7
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 8
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 9
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
Too many retries (EIO)
retries: 10
op 1 bn 1 siz 512 ptr 0xc5177600 retry 0
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 1
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 2
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 3
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 4
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 5
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 6
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 7
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 8
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 9
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
Too many retries (EIO)
retries: 10
op 1 bn 0 siz 512 ptr 0xc5177400 retry 0
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 1
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 2
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 3
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 4
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 5
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 6
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 7
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 8
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 9
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
Too many retries (EIO)
retries: 10
GEOM: new disk ad4
GEOM: new disk ad6
GEOM: new disk cd0
Trying to mount root from ufs:/dev/ad4s4a
start_init: trying /sbin/init
gif0: bpf attached
tun0: bpf attached
em0: Link is Down
em0: Link is up 100 Mbps Full Duplex
em0: link state changed to UP
ng_pppoe[3]: session in wrong state
2. fdc(4) driver makes 12 second delay during last stage of
kernel initialization just before GEOM adds ATA drives,
if FDD has good FAT-formatted floppy disk inserted.
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f0 irq 6 drq 2 on acpi0
fdc0: ic_type 90 part_id 80
fdc0: [MPSAFE]
fdc0: [FAST]
00 00 00 00 af 10 12 80 57 00
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
New disk in probe
Got disk in probe
op 40 bn 0 siz 0 ptr 0xe391eb2c retry 0
-> 40 1 0 fe
status 40 01 00 fe ff 01
[unknown][UNKNOWN()]
Retry line 1123
Too many retries (EIO)
op 40 bn 0 siz 0 ptr 0xe391eb2c retry 0
-> 40 1 0 fe
status 40 01 00 fe ff 01
[unknown][UNKNOWN()]
Retry line 1123
Too many retries (EIO)
fd0: autoselection failed
op 1 bn 0 siz 512 ptr 0xc5177800 retry 0
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 1
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 2
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 3
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 4
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 5
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 6
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 7
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 8
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177800 retry 9
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
Too many retries (EIO)
retries: 10
op 1 bn 1 siz 512 ptr 0xc5177600 retry 0
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 1
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 2
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 3
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 4
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 5
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 6
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 7
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 8
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
op 1 bn 1 siz 512 ptr 0xc5177600 retry 9
-> 40 1 0 0
status 40 01 00 00 00 02
fd0[READ(offset=512, length=512)]
Retry line 1123
Too many retries (EIO)
retries: 10
op 1 bn 0 siz 512 ptr 0xc5177400 retry 0
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 1
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 2
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 3
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 4
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 5
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 6
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 7
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 8
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
op 1 bn 0 siz 512 ptr 0xc5177400 retry 9
-> 40 1 0 0
status 40 01 00 00 00 01
fd0[READ(offset=0, length=512)]
Retry line 1123
Too many retries (EIO)
retries: 10
GEOM: new disk ad4
GEOM: new disk ad6
GEOM: new disk cd0
Trying to mount root from ufs:/dev/ad4s4a
start_init: trying /sbin/init
3. In both cases, any userland read operation with /dev/fd0
fails with EIO, as well as attempt to format disk with fdformat.
4. I've tried to manually merge revision 1.311 of fdc.c,
this eliminates delays during boot. But drive still does not work.
>How-To-Repeat:
I'd like to see how to NOT repeat this.
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list