On Tue, 22 Nov 2005 06:52, John Baldwin wrote: > Don't enable PUC_FASTINTR by default in the source. Instead, enable it > via the DEFAULTS kernel configs. This allows folks to turn it that > option off in the kernel configs if desired without having to hack the > source. This is especially useful since PUC_FASTINTR hangs the kernel boot > on my ultra60 which has two uart(4) devices hung off of a puc(4) device. > > I did not enable PUC_FASTINTR by default on powerpc since powerpc does > not currently allow sharing of INTR_FAST with non-INTR_FAST like the other > archs.
Why not make it a tunable? Untested but compilable patch attached. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Index: sys/dev/puc/puc.c
===================================================================
RCS file: /usr/CVS-Repository/src/sys/dev/puc/puc.c,v
retrieving revision 1.41
diff -u -r1.41 puc.c
--- sys/dev/puc/puc.c 28 Sep 2005 18:06:25 -0000 1.41
+++ sys/dev/puc/puc.c 21 Nov 2005 23:33:09 -0000
@@ -116,6 +116,14 @@
devclass_t puc_devclass;
+#ifdef PUC_FASTINTR
+static int fast_intr = 1;
+#else
+static int fast_intr = 0;
+#endif
+
+TUNABLE_INT("hw.puc.fast_intr", &fast_intr);
+
static int
puc_port_bar_index(struct puc_softc *sc, int bar)
{
@@ -196,18 +204,19 @@
sc->irqres = res;
sc->irqrid = rid;
-#ifdef PUC_FASTINTR
- irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res,
- INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->intr_cookie);
- if (irq_setup == 0)
- sc->fastintr = INTR_FAST;
- else
+ if (fast_intr) {
irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res,
- INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie);
-#else
- irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res,
- INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie);
-#endif
+ INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->intr_cookie);
+ if (irq_setup == 0)
+ sc->fastintr = INTR_FAST;
+ else
+ irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res,
+ INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie);
+ } else {
+ irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res,
+ INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie);
+ }
+
if (irq_setup != 0)
return (ENXIO);
pgpQo2Ya8yM0E.pgp
Description: PGP signature
