summaryrefslogtreecommitdiffstats
path: root/sys/dev/scc
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-07-25 00:23:54 +0000
committermarcel <marcel@FreeBSD.org>2006-07-25 00:23:54 +0000
commit5312caa99a0235b6751a7ee6b3ce2f02390a02b1 (patch)
tree50af0b1f45e8e07a75dceb460a2d2b3f3ed4d263 /sys/dev/scc
parent45d3d5a579e1aa1e01cc3888afd8e495417f6b45 (diff)
downloadFreeBSD-src-5312caa99a0235b6751a7ee6b3ce2f02390a02b1.zip
FreeBSD-src-5312caa99a0235b6751a7ee6b3ce2f02390a02b1.tar.gz
Revert previous commit. Spinlocks hold interrupts disabled, so
preemption is not possible. Pointed out by: jhb@
Diffstat (limited to 'sys/dev/scc')
-rw-r--r--sys/dev/scc/scc_core.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/dev/scc/scc_core.c b/sys/dev/scc/scc_core.c
index 1101f8a..c9cda51 100644
--- a/sys/dev/scc/scc_core.c
+++ b/sys/dev/scc/scc_core.c
@@ -102,7 +102,7 @@ scc_bfe_attach(device_t dev)
const char *sep;
bus_space_handle_t bh;
u_long base, size, start;
- int c, error, mode, nintr, sysdev;
+ int c, error, mode, sysdev;
/*
* The sc_class field defines the type of SCC we're going to work
@@ -140,14 +140,11 @@ scc_bfe_attach(device_t dev)
*/
sc->sc_chan = malloc(sizeof(struct scc_chan) * cl->cl_channels,
M_SCC, M_WAITOK | M_ZERO);
- nintr = 0;
for (c = 0; c < cl->cl_channels; c++) {
ch = &sc->sc_chan[c];
ch->ch_irid = c;
ch->ch_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ,
&ch->ch_irid, RF_ACTIVE | RF_SHAREABLE);
- if (ch->ch_ires != NULL)
- nintr++;
}
/*
@@ -213,18 +210,16 @@ scc_bfe_attach(device_t dev)
* that our children's are fast as well. We make it MPSAFE as soon
* as a child sets up a MPSAFE interrupt handler.
* Of course, if we can't setup a fast handler, we make it MPSAFE
- * right away. If we have multiple interrupt resources, we don't
- * use fast handlers, because we need to serialize the interrupts.
+ * right away.
*/
for (c = 0; c < cl->cl_channels; c++) {
ch = &sc->sc_chan[c];
if (ch->ch_ires == NULL)
continue;
- if (nintr == 1)
- error = bus_setup_intr(dev, ch->ch_ires,
- INTR_TYPE_TTY | INTR_FAST, scc_bfe_intr, sc,
- &ch->ch_icookie);
- if (nintr > 1 || error) {
+ error = bus_setup_intr(dev, ch->ch_ires,
+ INTR_TYPE_TTY | INTR_FAST, scc_bfe_intr, sc,
+ &ch->ch_icookie);
+ if (error) {
error = bus_setup_intr(dev, ch->ch_ires,
INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc,
&ch->ch_icookie);
@@ -236,10 +231,13 @@ scc_bfe_attach(device_t dev)
bus_release_resource(dev, SYS_RES_IRQ, ch->ch_irid,
ch->ch_ires);
ch->ch_ires = NULL;
- nintr--;
}
}
- sc->sc_polled = (nintr == 0) ? 1 : 0;
+ sc->sc_polled = 1;
+ for (c = 0; c < cl->cl_channels; c++) {
+ if (sc->sc_chan[0].ch_ires != NULL)
+ sc->sc_polled = 0;
+ }
/*
* Attach all child devices that were probed successfully.
OpenPOWER on IntegriCloud