Port-macppc archive

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

Re: Planning for NetBSD 5.0



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On May 6, 2008, at 08:33, Izumi Tsutsui wrote:
-current kernel with DIAGNOSTIC + DEBUG gets the following assert:

---
panic: kernel diagnostic assertion "evt != 0" failed: \
file "../../../../arch/macppc/macppc/pic_ohare.c", line 272
Stopped in pid 13155.1 (cc1) at netbsd:cpu_Debugger+0x10:       \
lwz     r0, r1, 0x14
db> tr
0x008f2ed0: at panic+0x210
0x008f2f20: at __kernassert+0x4c
0x008f2f30: at ohare_get_irq+0x160
0x008f2f50: at pic_handle_intr+0x5c
0x008f2fa0: at trapstart+0x8fc
0xffffcb70: at _prop_dictionary_keysym32_pool+0x4b71f098
---

Any clue?

Yes, it's the ohare PIC handler. Please build a kernel with options OHARE_DEBUG and try again. What happened is that ohare_get_irq() had more than one interrupt pending, tried to return them according to priority but ended up with nothing - it ORs up all the priorities of all the pending interrupts, then looks for pending interrupts at the highest found priority and didn't find anything. Your machine must have triggered some corner case that doesn't happen on my PowerBook. That said, I'm not sure the interrupt ordering stuff is worth the trouble anyway. Hmm, mask shouldn't be an int, it should be uint32_t but that shouldn't matter, we don't do anything with it where the sign bit could do anything funny. And the code screws up if you ever disestablish an interrupt - ohare_establish_irq() should always re-calculate all bitmasks to be safe. Actually that would cause exactly the problem you're seeing.

Please try this pseudo-patch too, it should bypass the priority code and simply return interrupts from left to right:
        /*
         * if we get here we have more than one irq pending so return them
         * according to priority
         */
        evt = ohare->pending_events & ~mask;
+#if 0
        prio = ohare->irqs[bit];
        while (evt != 0) {
                bit = 31 - cntlzw(evt);
                prio |= ohare->irqs[bit];
                evt &= ~(1 << bit);
#ifdef OHARE_DEBUG
                bail++;
                if (bail > 31)
                        panic("hanging in ohare_get_irq");
#endif
        }
        lvl = 31 - cntlzw(prio);
        evt = ohare->pending_events & ohare->irqs[lvl];
#ifdef OHARE_DEBUG
        if (evt == 0) {
                printf("ohare interrupt fuckup\n");
                printf("pending: %08x\n", ohare->pending_events);
                /* should bitch a bit more here */
        }
#else
        KASSERT(evt != 0);
#endif
+#endif /* bypass priority stuff */
        bit = 31 - cntlzw(evt);
        mask = 1 << bit;
        ohare->pending_events &= ~mask;
        return bit;     

have fun
Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBSCBX2MpnzkX8Yg2nAQJfLAf+PdVdng9M0tTGyw/YHy4k8f6ZzxA7CHYc
nvSu9Nxu90OrMZGk2tovcehPigVr0A5AdtIY6NdbarQNndDatG7Ja/VPf4UoIVlo
uJt9qUc94JQhvfgUUt/pmG6csJLAySZgTIEDcEafpEGxWGx8omCrNzPbBXK5olov
cICJRrG/XTXqHosvH58msSqwOT1tdSTU6t1oY/cdbnRpEnJYCJ3JI+x/a2HHTJA9
pQU3OlpTteuvDjA2oKaqRvFVwjJUJcOh/dwEYAo8I42bOtzVqym6Dyd425Xyi7Jy
83S4IHOvTOFEAFTBn/pD397V3jkc7tZUp36OvcJNYhuAmisJR3WEfA==
=o27i
-----END PGP SIGNATURE-----



Home | Main Index | Thread Index | Old Index