From 7466f92c1a75cdfc614e9b0f5eccf1f8afb31d06 Mon Sep 17 00:00:00 2001 From: bde Date: Sat, 18 Jul 1998 03:15:33 +0000 Subject: Fixed error handling after a seek error that can't happen. When the controller reports a successful seek, it is very unlikely to report seeking to a cylinder other than the one requested, but we check for this, and botched the error handling for the requested_cylinder != 0 case. This error happened when the bug fixed in rev.1.52 of caused the head of buffer queue to change to one starting on a different cylnder - the requested cylinder was found, but it wasn't what we thought we requested. The fix is simply to arrange to reset the state machine. Corruption of the buffer queue seems to only have been a problem in the floppy driver. Other drivers dequeue the head of the queue before doing physical i/o on it, so the corruption at worse broke the elevator sort order. Dequeueing breaks it anyway. --- sys/dev/fdc/fdc.c | 4 +++- sys/i386/isa/fd.c | 4 +++- sys/isa/fd.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 9cebca5..f432e51 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -44,7 +44,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.117 1998/07/13 08:22:59 julian Exp $ + * $Id: fd.c,v 1.118 1998/07/15 09:59:30 bde Exp $ * */ @@ -1648,6 +1648,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc) printf( "fd%d: Seek to cyl %d failed; am at cyl %d (ST0 = 0x%x)\n", fdu, descyl, cyl, st0); + if (fdc->retry < 3) + fdc->retry = 3; return(retrier(fdcu)); } } diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index 9cebca5..f432e51 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -44,7 +44,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.117 1998/07/13 08:22:59 julian Exp $ + * $Id: fd.c,v 1.118 1998/07/15 09:59:30 bde Exp $ * */ @@ -1648,6 +1648,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc) printf( "fd%d: Seek to cyl %d failed; am at cyl %d (ST0 = 0x%x)\n", fdu, descyl, cyl, st0); + if (fdc->retry < 3) + fdc->retry = 3; return(retrier(fdcu)); } } diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 9cebca5..f432e51 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -44,7 +44,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.117 1998/07/13 08:22:59 julian Exp $ + * $Id: fd.c,v 1.118 1998/07/15 09:59:30 bde Exp $ * */ @@ -1648,6 +1648,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc) printf( "fd%d: Seek to cyl %d failed; am at cyl %d (ST0 = 0x%x)\n", fdu, descyl, cyl, st0); + if (fdc->retry < 3) + fdc->retry = 3; return(retrier(fdcu)); } } -- cgit v1.1