Subject: Re: Nell PCMCIA/PRISM-II on Voyager
To: Martin Husemann <martin@duskware.de>
From: Jonathan O'Brien <obrien@gossamer.com>
List: port-sparc
Date: 04/22/2002 00:25:27
On Mon, 22 Apr 2002, Martin Husemann wrote:

> > nell0 at sbus0 slot 0 offset 0x0 level 4 (ipl 7) level 7 (ipl 13): rev 1
> ..
> > stray interrupt ipl 0xd pc=0xf00075a0 npc=0xf00075a4 psr=49010c1<EF,S,PS>
>
> This means the following check (sys/dev/sbus/stp4020.c:631) failed:
>
>                 if ((v & STP4020_ISR0_IOINT) != 0) {
>
> so the nell interrupt handler did not call the pcmcia cards interrupt handler
> and returned 0 (not claiming this interrupt).
>
> This probably has to do with the "Battery changed" message produced by the
> other nell interupt handler. I wonder if there is a race condition between
> both interrupt handlers and the clearing of (the common) status register.
>
> I don't see any obvious bugs though.
>
> As a hack you could try the below patch and see if that helps.

I applied the patch, didn't seem to help. So I went and enabled
stp4020_debug and changed the ISR0 printf at the start of stp4020_statintr
to stp4020_dump_regs.

Here's the output (card is in socket 0):

[...transcribed by hand...]
socket[0] registers:
	ICR0=17705<IFTYPE,SPKREN,CTOIE,WPIE,RDYIE,BVD1IE,BVD2IE,CDIE,SCILV>
	ICR1=0<VPP1EN=0,VPP2EN=0>
	ISR0=40302<WAITST,CD1ST,CD2ST,SCINT>
	ISR1=1<REV=1,PCTYPE=0>
socket[1] registers:
	ICR0=17700<CTOIE,WPIE,RDYIE,BVD1IE,BVD2IE,CDIE,SCILV>
	ICR1=0<VPP1EN=0,VPP2EN=0>
	ISR0=74<IOIS16,IOREQ,STSCHG,SPKR>
	ISR1=1<REV=1,PCTYPE=0>
stray interrupt ipl 0xd pc=0xf00075e4 npc=0xf00075e8 psr=49010c1<EF,S,PS>
panic: crazy interrrupts