From b31da03fd83d59b6a6a901674fb2428e38d33e00 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Wed, 12 Jul 2006 00:49:46 +0000 Subject: [PATCH] Assume floppy disk is not inserted when we have exhausted retries. This significantly reduces booting time when there is broken floppy disk drive, controller, cable, BIOS, etc. When the floppy controller interface is correctly implemented, disk change signal (DSKCHG) is reflected in the Digital Input Register (DIR) at 0x3f7. However, there are many cases that the signal is unusable. Moreover, some BIOS does not reserve the port at all. In those cases, the register may not function. --- sys/dev/fdc/fdc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 2bfd4c371d65..19edf51a2ec2 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -758,6 +758,9 @@ fdc_worker(struct fdc_data *fdc) (fdc->retry >= retries || (fd->options & FDOPT_NORETRY))) { if ((debugflags & 4)) printf("Too many retries (EIO)\n"); + mtx_lock(&fdc->fdc_mtx); + fd->flags |= FD_EMPTY; + mtx_unlock(&fdc->fdc_mtx); return (fdc_biodone(fdc, EIO)); }