Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/dev/pcmcia Pull up revision 1.100 (requested by bouye...



details:   https://anonhg.NetBSD.org/src/rev/f42f06a1ab81
branches:  netbsd-3
changeset: 576432:f42f06a1ab81
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 02 23:19:27 2005 +0000

description:
Pull up revision 1.100 (requested by bouyer in ticket #500):
When the PCMCIA socket is powered up, the driver waits for the PCMCIA
controller to be ready, but the drive attached to it may not be ready yet.
Add a half a second delay before calling wdcattach(), to let the drive
have its electronic ready to properly respond to the register tests done
in wdcprobe1(). Delay based on experiments done by John Refling with
various devices as part of the audit-trail of kern/25659; complete
the fix for kern/25659.

diffstat:

 sys/dev/pcmcia/wdc_pcmcia.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r f454b98502a2 -r f42f06a1ab81 sys/dev/pcmcia/wdc_pcmcia.c
--- a/sys/dev/pcmcia/wdc_pcmcia.c       Sat Jul 02 23:15:30 2005 +0000
+++ b/sys/dev/pcmcia/wdc_pcmcia.c       Sat Jul 02 23:19:27 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_pcmcia.c,v 1.99 2005/03/11 16:17:57 matt Exp $ */
+/*     $NetBSD: wdc_pcmcia.c,v 1.99.2.1 2005/07/02 23:19:27 tron Exp $ */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -37,12 +37,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.99 2005/03/11 16:17:57 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.99.2.1 2005/07/02 23:19:27 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
+#include <sys/kernel.h>
 #include <sys/malloc.h>
 #include <sys/systm.h>
+#include <sys/proc.h>
 
 #include <machine/bus.h>
 #include <machine/intr.h>
@@ -300,6 +302,13 @@
            wdc_pcmcia_enable;
        sc->sc_wdcdev.sc_atac.atac_atapi_adapter._generic.adapt_refcnt = 1;
 
+       /*
+        * Some devices needs some more delay after power up to stabilize
+        * and probe properly, so give them half a second.
+        * See PR 25659 for details.
+        */
+       tsleep(wdc_pcmcia_attach, PWAIT, "wdcattach", hz / 2);
+
        wdcattach(&sc->ata_channel);
        ata_delref(&sc->ata_channel);
        sc->sc_state = WDC_PCMCIA_ATTACHED;



Home | Main Index | Thread Index | Old Index