Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/pci Pull up revision 1.74 (requested by haya):



details:   https://anonhg.NetBSD.org/src/rev/a2a3472177b8
branches:  netbsd-1-5
changeset: 492735:a2a3472177b8
user:      he <he%NetBSD.org@localhost>
date:      Sat Feb 09 18:29:18 2002 +0000

description:
Pull up revision 1.74 (requested by haya):
  Correct chattering suppressor.  This makes card insertion detection
  work properly.

diffstat:

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

diffs (41 lines):

diff -r 68f85ee81ae0 -r a2a3472177b8 sys/dev/pci/pccbb.c
--- a/sys/dev/pci/pccbb.c       Sat Feb 09 18:19:50 2002 +0000
+++ b/sys/dev/pci/pccbb.c       Sat Feb 09 18:29:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccbb.c,v 1.42.2.6 2002/01/22 19:52:06 he Exp $        */
+/*     $NetBSD: pccbb.c,v 1.42.2.7 2002/02/09 18:29:18 he Exp $        */
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -976,6 +976,9 @@
                                        cardslot_event_throw(sc->sc_csc,
                                            CARDSLOT_EVENT_REMOVAL_CB);
                                }
+                       } else if (sc->sc_flags & CBB_INSERTING) {
+                               sc->sc_flags &= ~CBB_INSERTING;
+                               callout_stop(&sc->sc_insert_ch);
                        }
                } else if (0x00 == (sockstate & CB_SOCKET_STAT_CD) &&
                    /*
@@ -987,7 +990,7 @@
                        if (sc->sc_flags & CBB_INSERTING) {
                                callout_stop(&sc->sc_insert_ch);
                        }
-                       callout_reset(&sc->sc_insert_ch, hz / 10,
+                       callout_reset(&sc->sc_insert_ch, hz / 5,
                            pci113x_insert, sc);
                        sc->sc_flags |= CBB_INSERTING;
                }
@@ -1060,6 +1063,12 @@
        struct pccbb_softc *sc = (struct pccbb_softc *)arg;
        u_int32_t sockevent, sockstate;
 
+       if (!(sc->sc_flags & CBB_INSERTING)) {
+               /* We add a card only under inserting state. */
+               return;
+       }
+       sc->sc_flags &= ~CBB_INSERTING;
+
        sockevent = bus_space_read_4(sc->sc_base_memt, sc->sc_base_memh,
            CB_SOCKET_EVENT);
        sockstate = bus_space_read_4(sc->sc_base_memt, sc->sc_base_memh,



Home | Main Index | Thread Index | Old Index