Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/dev/ata Pull up revision 1.11 (requested by bouyer):



details:   https://anonhg.NetBSD.org/src/rev/26813d9dda04
branches:  netbsd-1-4
changeset: 470179:26813d9dda04
user:      he <he%NetBSD.org@localhost>
date:      Sun Jan 23 12:25:32 2000 +0000

description:
Pull up revision 1.11 (requested by bouyer):
  Improve the downgrade logic to work better in some cases (especially
  for Acer Labs M5229 controllers with Ultra-DMA/66 disks).

diffstat:

 sys/dev/ata/ata.c |  26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 0f79d14860fb -r 26813d9dda04 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Sun Jan 23 12:16:27 2000 +0000
+++ b/sys/dev/ata/ata.c Sun Jan 23 12:25:32 2000 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ata.c,v 1.7.2.1 1999/04/20 00:54:40 cjs Exp $      */
+/*      $NetBSD: ata.c,v 1.7.2.2 2000/01/23 12:25:32 he Exp $      */
 /*
  * Copyright (c) 1998 Manuel Bouyer.  All rights reserved.
  *
@@ -156,6 +156,30 @@
 }
 
 void
+ata_dmaerr(drvp)
+       struct ata_drive_datas *drvp;
+{
+       /*
+        * Downgrade decision: if we get NERRS_MAX in NXFER.
+        * We start with n_dmaerrs set to NERRS_MAX-1 so that the
+        * first error within the first NXFER ops will immediatly trigger
+        * a downgrade.
+        * If we got an error and n_xfers is bigger than NXFER reset counters.
+        */
+       drvp->n_dmaerrs++;
+       if (drvp->n_dmaerrs >= NERRS_MAX && drvp->n_xfers <= NXFER) {
+               wdc_downgrade_mode(drvp);
+               drvp->n_dmaerrs = NERRS_MAX-1;
+               drvp->n_xfers = 0;
+               return;
+       }
+       if (drvp->n_xfers > NXFER) {
+               drvp->n_dmaerrs = 1; /* just got an error */
+               drvp->n_xfers = 1; /* restart counting from this error */
+       }
+}
+
+void
 ata_perror(drvp, errno, buf)
        struct ata_drive_datas *drvp;
        int errno;



Home | Main Index | Thread Index | Old Index