Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Clear DRIVE_ATA|DRIVE_ATAPI for both drives only ...



details:   https://anonhg.NetBSD.org/src/rev/fd58637d573e
branches:  trunk
changeset: 555438:fd58637d573e
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Nov 17 20:01:35 2003 +0000

description:
Clear DRIVE_ATA|DRIVE_ATAPI for both drives only when we're sure this is
an old drive. Should fix kern/23468.
When we know there's no drive here, abort the probe and try next drive.

diffstat:

 sys/dev/ic/wdc.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 8475b11425d1 -r fd58637d573e sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c  Mon Nov 17 19:21:56 2003 +0000
+++ b/sys/dev/ic/wdc.c  Mon Nov 17 20:01:35 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc.c,v 1.154 2003/11/13 22:18:10 bouyer Exp $ */
+/*     $NetBSD: wdc.c,v 1.155 2003/11/17 20:01:35 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.154 2003/11/13 22:18:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.155 2003/11/17 20:01:35 bouyer Exp $");
 
 #ifndef WDCDEBUG
 #define WDCDEBUG
@@ -410,9 +410,7 @@
                        chp->ch_drive[0].drive_flags &= ~DRIVE_OLD;
                        chp->ch_drive[1].drive_flags &= ~DRIVE_OLD;
                } else {
-                       chp->ch_drive[0].drive_flags &=
-                           ~(DRIVE_ATA | DRIVE_ATAPI);
-                       chp->ch_drive[1].drive_flags &=
+                       chp->ch_drive[i].drive_flags &=
                            ~(DRIVE_ATA | DRIVE_ATAPI);
                        WDCDEBUG_PRINT(("%s:%d:%d: IDENTIFY failed (%d)\n",
                            chp->wdc->sc_dev.dv_xname,
@@ -442,6 +440,7 @@
                                    chp->wdc->sc_dev.dv_xname,
                                    chp->channel, i), DEBUG_PROBE);
                                    chp->ch_drive[i].drive_flags &= ~DRIVE_OLD;
+                                   continue;
                        }
                        if (wait_for_ready(chp, 10000, 0) == WDCWAIT_TOUT) {
                                WDCDEBUG_PRINT(("%s:%d:%d: not ready\n",
@@ -458,6 +457,11 @@
                                    chp->wdc->sc_dev.dv_xname,
                                    chp->channel, i), DEBUG_PROBE);
                                chp->ch_drive[i].drive_flags &= ~DRIVE_OLD;
+                       } else {
+                               chp->ch_drive[0].drive_flags &=
+                                   ~(DRIVE_ATA | DRIVE_ATAPI);
+                               chp->ch_drive[1].drive_flags &=
+                                   ~(DRIVE_ATA | DRIVE_ATAPI);
                        }
                }
        }



Home | Main Index | Thread Index | Old Index