Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Remove the "Register ghost test". It won't work, ...



details:   https://anonhg.NetBSD.org/src/rev/db515f93de35
branches:  trunk
changeset: 552169:db515f93de35
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Sep 20 21:42:47 2003 +0000

description:
Remove the "Register ghost test". It won't work, because on ATA register
of both devices are written, and device 0 will respond for device 1 if
device 1 isn't present. Pointed out by Quentin Garnier.
So the only way to know if device 1 is there or not is to send a command, which
is done later.
Detecting the second device here isn't important and won't speed up the probe.
We just need to know if there is at last one device on the bus.

Fix PR kern/22869 from Julio M. Merino Vidal.

diffstat:

 sys/dev/ic/wdc.c |  27 ++-------------------------
 1 files changed, 2 insertions(+), 25 deletions(-)

diffs (48 lines):

diff -r 3170d99e4a29 -r db515f93de35 sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c  Sat Sep 20 21:05:53 2003 +0000
+++ b/sys/dev/ic/wdc.c  Sat Sep 20 21:42:47 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc.c,v 1.127 2003/09/20 07:07:39 christos Exp $ */
+/*     $NetBSD: wdc.c,v 1.128 2003/09/20 21:42:47 bouyer Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.127 2003/09/20 07:07:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.128 2003/09/20 21:42:47 bouyer Exp $");
 
 #ifndef WDCDEBUG
 #define WDCDEBUG
@@ -280,29 +280,6 @@
                                ret_value &= ~0x02;
                }
 
-               /* Register ghost test. */
-               if (ret_value == 0x03) {
-                       if (chp->wdc && (chp->wdc->cap & WDC_CAPABILITY_SELECT))
-                               chp->wdc->select(chp,1);
-                       bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
-                           WDSD_IBM | 0x10);
-                       bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sector, 0x01);
-                       if (chp->wdc && (chp->wdc->cap & WDC_CAPABILITY_SELECT))
-                               chp->wdc->select(chp,0);
-                       bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
-                           WDSD_IBM);
-                       bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sector, 0x02);
-                       if (chp->wdc && (chp->wdc->cap & WDC_CAPABILITY_SELECT))
-                               chp->wdc->select(chp,1);
-                       bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
-                           WDSD_IBM | 0x10);
-                       if (bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_sector) == 0x02) {
-                               printf("%s: ghost detected\n",
-                                   chp->wdc->sc_dev.dv_xname);
-                               ret_value = 0x01;
-                       }
-               }
-
                if (ret_value == 0)
                        return 0;
 



Home | Main Index | Thread Index | Old Index