Module Name:    src
Committed By:   tsutsui
Date:           Sun Oct 14 17:20:18 UTC 2012

Modified Files:
        src/sys/arch/x68k/dev: fd.c

Log Message:
Before probing floppy drives, call NE7CMD_SENSEI and fdcresult()
to drain possible pending FDC interrupts.  Taken from sys/dev/isa/fd.c.
Hopefully might fix occasional fd drive probe failure (but not confirmed).


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/x68k/dev/fd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/dev/fd.c
diff -u src/sys/arch/x68k/dev/fd.c:1.101 src/sys/arch/x68k/dev/fd.c:1.102
--- src/sys/arch/x68k/dev/fd.c:1.101	Tue May 15 12:17:33 2012
+++ src/sys/arch/x68k/dev/fd.c	Sun Oct 14 17:20:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.101 2012/05/15 12:17:33 tsutsui Exp $	*/
+/*	$NetBSD: fd.c,v 1.102 2012/10/14 17:20:18 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.101 2012/05/15 12:17:33 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.102 2012/10/14 17:20:18 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_m68k_arch.h"
@@ -516,6 +516,11 @@ fdprobe(device_t parent, cfdata_t cf, vo
 
 	type = &fd_types[0];	/* XXX 1.2MB */
 
+	/* toss any interrupt status */
+	for (n = 0; n < 4; n++) {
+		out_fdc(iot, ioh, NE7CMD_SENSEI);
+		(void)fdcresult(fdc);
+	}
 	intio_disable_intr(SICILIAN_INTR_FDC);
 
 	/* select drive and turn on motor */

Reply via email to