Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Add a delay(10) after re-enabling interrupts in the ...



details:   https://anonhg.NetBSD.org/src/rev/ff73f3091d1e
branches:  trunk
changeset: 566411:ff73f3091d1e
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat May 08 15:03:32 2004 +0000

description:
Add a delay(10) after re-enabling interrupts in the control register.
Some controllers/drives (e.g. SataLink 3114 with WD Raptor) require
it. Should fix kern/23808 by Chris Gilbert, patch suplied by Chris Gilbert
on tech-kern, extended to all places enabling interrupts by me.

diffstat:

 sys/dev/ata/ata_wdc.c      |  5 +++--
 sys/dev/ic/wdc.c           |  5 +++--
 sys/dev/scsipi/atapi_wdc.c |  7 +++++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diffs (94 lines):

diff -r a54a9baaf8cb -r ff73f3091d1e sys/dev/ata/ata_wdc.c
--- a/sys/dev/ata/ata_wdc.c     Sat May 08 14:41:47 2004 +0000
+++ b/sys/dev/ata/ata_wdc.c     Sat May 08 15:03:32 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ata_wdc.c,v 1.53 2004/03/02 13:13:57 fvdl Exp $        */
+/*     $NetBSD: ata_wdc.c,v 1.54 2004/05/08 15:03:32 bouyer Exp $      */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.53 2004/03/02 13:13:57 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.54 2004/05/08 15:03:32 bouyer Exp $");
 
 #ifndef WDCDEBUG
 #define WDCDEBUG
@@ -303,6 +303,7 @@
                 */
                bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
                    WDCTL_4BIT);
+               delay(10); /* some drives need a little delay here */
        }
 
        _wdc_ata_bio_start(chp, xfer);
diff -r a54a9baaf8cb -r ff73f3091d1e sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c  Sat May 08 14:41:47 2004 +0000
+++ b/sys/dev/ic/wdc.c  Sat May 08 15:03:32 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc.c,v 1.172 2004/03/25 19:45:09 bouyer Exp $ */
+/*     $NetBSD: wdc.c,v 1.173 2004/05/08 15:03:32 bouyer Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.172 2004/03/25 19:45:09 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.173 2004/05/08 15:03:32 bouyer Exp $");
 
 #ifndef WDCDEBUG
 #define WDCDEBUG
@@ -1699,6 +1699,7 @@
                /* enable interrupts */
                bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
                    WDCTL_4BIT);
+               delay(10); /* some drives need a little delay here */
        }
        wdc_free_xfer(chp, xfer);
        if (wdc_c->flags & AT_WAIT)
diff -r a54a9baaf8cb -r ff73f3091d1e sys/dev/scsipi/atapi_wdc.c
--- a/sys/dev/scsipi/atapi_wdc.c        Sat May 08 14:41:47 2004 +0000
+++ b/sys/dev/scsipi/atapi_wdc.c        Sat May 08 15:03:32 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atapi_wdc.c,v 1.69 2004/02/03 20:55:02 bouyer Exp $    */
+/*     $NetBSD: atapi_wdc.c,v 1.70 2004/05/08 15:03:32 bouyer Exp $    */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.69 2004/02/03 20:55:02 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.70 2004/05/08 15:03:32 bouyer Exp $");
 
 #ifndef WDCDEBUG
 #define WDCDEBUG
@@ -475,6 +475,7 @@
                drvp->state = READY;
                bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
                    WDCTL_4BIT);
+               delay(10); /* some drives need a little delay here */
        }
        /* start timeout machinery */
        if ((sc_xfer->xs_control & XS_CTL_POLL) == 0)
@@ -543,6 +544,7 @@
            errstring);
        sc_xfer->error = XS_TIMEOUT;
        bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr, WDCTL_4BIT);
+       delay(10); /* some drives need a little delay here */
        wdc_atapi_reset(chp, xfer);
        return;
 error:
@@ -553,6 +555,7 @@
        sc_xfer->error = XS_SHORTSENSE;
        sc_xfer->sense.atapi_sense = chp->ch_error;
        bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr, WDCTL_4BIT);
+       delay(10); /* some drives need a little delay here */
        wdc_atapi_reset(chp, xfer);
        return;
 }



Home | Main Index | Thread Index | Old Index