Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix problem where tsleep() is used not on the ca...



details:   https://anonhg.NetBSD.org/src/rev/ddc0832a9089
branches:  trunk
changeset: 503056:ddc0832a9089
user:      itohy <itohy%NetBSD.org@localhost>
date:      Tue Jan 30 07:23:14 2001 +0000

description:
Fix problem where tsleep() is used not on the cardbus thread.
This change makes PCMCIA cards work again on my machine.

Unfortunately, some of the DELAY_MS() are called when the current
process is not the cardbus thread, that is, on interrupt contexts.
I confirmed these are actually used in interrupt context and replaced
them with delay()s.  However, I haven't confirmed other DELAY_MS()s
are always on the cardbus thread.

This shall be a temporary fix.  The driver needs being rewritten
not to use such delay()s, of course.

diffstat:

 sys/dev/pci/pccbb.c |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (57 lines):

diff -r e485a5284e39 -r ddc0832a9089 sys/dev/pci/pccbb.c
--- a/sys/dev/pci/pccbb.c       Tue Jan 30 06:44:42 2001 +0000
+++ b/sys/dev/pci/pccbb.c       Tue Jan 30 07:23:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccbb.c,v 1.55 2001/01/24 10:10:04 haya Exp $  */
+/*     $NetBSD: pccbb.c,v 1.56 2001/01/30 07:23:14 itohy Exp $ */
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -1303,7 +1303,11 @@
         * XXX delay 300 ms: though the standard defines that the Vcc set-up
         * time is 20 ms, some PC-Card bridge requires longer duration.
         */
+#if 0  /* XXX called on interrupt context */
        DELAY_MS(300, sc);
+#else
+       delay(300 * 1000);
+#endif
 
        return 1;                      /* power changed correctly */
 }
@@ -2289,7 +2293,11 @@
         * hold RESET at least 20 ms: the spec says only 10 us is
         * enough, but TI1130 requires at least 20 ms.
         */
+#if 0  /* XXX called on interrupt context */
        DELAY_MS(20, sc);
+#else
+       delay(20 * 1000);
+#endif
 
        /* clear the reset flag */
 
@@ -2298,7 +2306,11 @@
 
        /* wait 20ms as per pc card standard (r2.01) section 4.3.6 */
 
+#if 0  /* XXX called on interrupt context */
        DELAY_MS(20, sc);
+#else
+       delay(20 * 1000);
+#endif
 
        /* wait for the chip to finish initializing */
 
@@ -2366,7 +2378,11 @@
        /* 
         * wait 300ms until power fails (Tpf).
         */
+#if 0  /* XXX called on interrupt context */
        DELAY_MS(300, sc);
+#else
+       delay(300 * 1000);
+#endif
 }
 
 /*



Home | Main Index | Thread Index | Old Index