Port-sparc64 archive

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

powerfail interrupt (Re: Netra X1 with WD0 and AcerIDE)



>>> Jochen Kunz <jkunz%unixag-kl.fh-kl.de@localhost> wrote

> On Mon, 7 Feb 2011 23:24:50 -0500
> Chris Ross <cross%distal.com@localhost> wrote:
> 
> >   I looked to find that I still have a patch in my netbsd-5 tree that
> > removes some code.  I'm sure there was a reason I did this, and I
> > suspect it was discussed on port-sparc64, but darned if I can remember
> > it now:
> [...]
> >                 psycho_set_intr(sc, 15, psycho_powerfail,
> >                         &sc->sc_regs->power_int_map, 
> >                         &sc->sc_regs->power_clr_int);
> I remember this one. Sort of. It has to do somthing with a unused pin /
> interrupt on the X1. This can trigger an interrupt (storm) that
> completely chokes the kernel. Solution is to not install this interrupt
> handler. There was some discussion on this list how to do it proper. But
> I don't know the outcome. 

I also remember this discussion.

One solution is to check the machine model when installing the
interrupt handler. So I would like to commit the following patch if
anyone have no objection.

-- Takeshi Nakayama

Index: dev/psycho.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/dev/psycho.c,v
retrieving revision 1.101
diff -u -d -r1.101 psycho.c
--- dev/psycho.c        10 Jul 2010 10:07:40 -0000      1.101
+++ dev/psycho.c        11 Feb 2011 22:35:54 -0000
@@ -299,6 +299,7 @@
        int psycho_br[2], n, i;
        bus_space_handle_t pci_ctl;
        char *model = prom_getpropstring(ma->ma_node, "model");
+       extern char machine_model[];
 
        aprint_normal("\n");
 
@@ -527,10 +528,15 @@
                psycho_set_intr(sc, 15, psycho_bus_a,
                        &sc->sc_regs->pciaerr_int_map,
                        &sc->sc_regs->pciaerr_clr_int);
-               psycho_set_intr(sc, 15, psycho_powerfail,
-                       &sc->sc_regs->power_int_map,
-                       &sc->sc_regs->power_clr_int);
-               psycho_register_power_button(sc);
+               /*
+                * Netra X1 may hang when the powerfail interrupt is enabled.
+                */
+               if (strcmp(machine_model, "SUNW,UltraAX-i2") != 0) {
+                       psycho_set_intr(sc, 15, psycho_powerfail,
+                               &sc->sc_regs->power_int_map,
+                               &sc->sc_regs->power_clr_int);
+                       psycho_register_power_button(sc);
+               }
                if (sc->sc_mode != PSYCHO_MODE_SABRE) {
                        /* sabre doesn't have these interrupts */
                        psycho_set_intr(sc, 15, psycho_bus_b,



Home | Main Index | Thread Index | Old Index