Re: Sun4/110 "Panic: Crazy Interrupts"

Samuel Furtaw <[email protected]>
Newsgroups gmane.os.netbsd.ports.sparc
Message-ID <CADun6geQqy+vbth8zBSnrF69fV-H6wLKMhzxzafO0JzWBLHdhg@mail.gmail.com>
Thanks Julian!

I've just checked my hardware from my SunOS 4 installation - I do have
a CG4 framebuffer installed. After uncommenting the lines and
re-compiling, I get a data error when the CG4 device gets loaded. Here
is the line when it panics:

```
[1.0000000] cgfour0 at obio0 addr 0xb300000 level 4: cgfour/p4, 1152 x 900cpu
0: data fault: pc=0xf0012090 addr=0xfe04800 ser=0x8002<WRITE,SZERR>
[1.0000000] panic: kernel fault
[1.0000000] halted
```

Regards,
Samuel

On Mon, Apr 15, 2024 at 8:51 AM Julian Coleman <[email protected]> wrote:
>
> Hi,
>
> > Now that the network issue is resolved, I'm running into a consistent
> > kernel panic that happens when booting on my Sun4/110 workstation. I'm
> > using a kernel built from the config in this Gist:
> > https://gist.github.com/sfurtaw/28a600a282d0af955dc7275e2648c4e6
> >
> > I've taken a video of what happens here:
> > https://www.youtube.com/watch?v=Y6W9c9ul9KY
>
> Good to see that you've made progress!
>
> I'm trying to remember how we handle interrupts on sparc so I'm a bit rusty,
> but the basic idea is that we consult the OBP or OFW for descriptions of
> devices and build the interrupt mapping from there.  For example, on my SS2:
>
>   OBP:
>     ffea8d58: /audio@1,f7201000
>     interrupts  0000000d
>     intr        0000000d 00000000
>
>   dmesg:
>     audioamd0 at mainbus0 ioaddr 0xf7201000 ipl 13 softpri 4
>
> (the ipl 0x0d/13 is from the OBP entry).
>
> > Basically, the panic always shows up at this same point in the boot
> > process, whether I load diskless over NFS or with my SCSI hard drive
> > emulator. After it loads up the sparcvme device, it throws maybe 10
> > stray interrupts before the panic.
>
> If you look at the code:
>
>   https://github.com/NetBSD/src/blob/trunk/sys/arch/sparc/sparc/intr.c#L97
>
> if we get 10 unhandled interrupts we panic.  For the timing, I guess that
> we enable interrupts after printing the last found device (VME) so the
> problem isn't related to VME, but I could be wrong.
>
> So, it looks like we're getting interrupts that we don't handle.  If I
> understand correctly, we didn't install a handler because we didn't find
> anything in OBP with interrupts at 0x04 or we don't have a driver in the
> kernel.  Looking at the kernel config file, the framebuffer interrupts at
> level 4:
>
>   https://github.com/NetBSD/src/blob/trunk/sys/arch/sparc/conf/GENERIC#L623
>
> for the BW2 and also lines 637 (CG4), 643 (CG6) and 648 (CG8).
>
> Do you have a CG2, CG4 or CG8 in your 4/110?  These lines are all commented
> out in GENERIC, but it looks like you're running a custom kernel.  As a
> first step, try uncommenting those.  They are probably commented out due to
> lack of testing, so we might need to fix bugs, but it might help.
>
> Regards,
>
> Julian
>
> PS.  I put github links above, but you could also use NXR, e.g.:
>
>   https://nxr.netbsd.org/xref/src/sys/arch/sparc/sparc/intr.c#97
>
> --
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.