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/isa Pull up 1.33->1.34, approved by thorpej:
details: https://anonhg.NetBSD.org/src/rev/28894308ab8f
branches: netbsd-1-5
changeset: 488784:28894308ab8f
user: bouyer <bouyer%NetBSD.org@localhost>
date: Thu Jul 27 21:41:00 2000 +0000
description:
Pull up 1.33->1.34, approved by thorpej:
boca "hang because of lost interupts" workaround.
diffstat:
sys/dev/isa/boca.c | 37 +++++++++++++++++++++++++++++++++----
1 files changed, 33 insertions(+), 4 deletions(-)
diffs (84 lines):
diff -r 066f08f47517 -r 28894308ab8f sys/dev/isa/boca.c
--- a/sys/dev/isa/boca.c Thu Jul 27 21:23:36 2000 +0000
+++ b/sys/dev/isa/boca.c Thu Jul 27 21:41:00 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boca.c,v 1.33 2000/05/20 18:25:41 thorpej Exp $ */
+/* $NetBSD: boca.c,v 1.33.4.1 2000/07/27 21:41:00 bouyer Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -37,6 +37,8 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/termios.h>
+#include <sys/kernel.h>
+#include <sys/callout.h>
#include <machine/bus.h>
#include <machine/intr.h>
@@ -59,11 +61,13 @@
int sc_alive; /* mask of slave units attached */
void *sc_slaves[NSLAVES]; /* com device unit numbers */
bus_space_handle_t sc_slaveioh[NSLAVES];
+ struct callout fixup;
};
int bocaprobe __P((struct device *, struct cfdata *, void *));
void bocaattach __P((struct device *, struct device *, void *));
int bocaintr __P((void *));
+void boca_fixup __P((void *));
int bocaprint __P((void *, const char *));
struct cfattach boca_ca = {
@@ -181,6 +185,8 @@
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_SERIAL, bocaintr, sc);
+ callout_init(&sc->fixup);
+ callout_reset(&sc->fixup, hz/10, boca_fixup, sc);
}
int
@@ -198,8 +204,12 @@
for (;;) {
#define TRY(n) \
- if (bits & (1 << (n))) \
- comintr(sc->sc_slaves[n]);
+ if (bits & (1 << (n))) { \
+ if (comintr(sc->sc_slaves[n]) == 0) { \
+ printf("%s: bogus intr for port %d\n", \
+ sc->sc_dev.dv_xname, n); \
+ } \
+ }
TRY(0);
TRY(1);
TRY(2);
@@ -211,7 +221,26 @@
#undef TRY
bits = bus_space_read_1(iot, sc->sc_slaveioh[0],
com_scratch) & alive;
- if (bits == 0)
+ if (bits == 0) {
return (1);
+ }
}
}
+
+void
+boca_fixup(v)
+ void *v;
+{
+ struct boca_softc *sc = v;
+ int alive = sc->sc_alive;
+ int i, s;
+
+ s = splserial();
+
+ for (i = 0; i < 8; i++) {
+ if (alive & (1 << (i)))
+ comintr(sc->sc_slaves[i]);
+ }
+ callout_reset(&sc->fixup, hz/10, boca_fixup, sc);
+ splx(s);
+}
Home |
Main Index |
Thread Index |
Old Index