Subject: Re: Nell PCMCIA/PRISM-II on Voyager
To: David Passmore <dpassmor@sneakers.org>
From: Martin Husemann <martin@duskware.de>
List: port-sparc
Date: 04/22/2002 08:14:48
--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

> 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.


Martin

--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch

Index: stp4020.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/sbus/stp4020.c,v
retrieving revision 1.22
diff -c -u -r1.22 stp4020.c
--- stp4020.c	2002/03/25 09:02:54	1.22
+++ stp4020.c	2002/04/22 06:14:26
@@ -628,20 +628,25 @@
 		h = &sc->sc_socks[i];
 		v = stp4020_rd_sockctl(h, STP4020_ISR0_IDX);
 
+#if 0
 		if ((v & STP4020_ISR0_IOINT) != 0) {
 			/* we can not deny this is ours, no matter what the
 			   card driver says. */
 			r = 1;
+#endif
 
 			/* ack interrupt */
 			stp4020_wr_sockctl(h, STP4020_ISR0_IDX, v);
 
+#if 0
 			/* It's a card interrupt */
 			if ((h->flags & STP4020_SOCKET_BUSY) == 0) {
 				printf("stp4020[%d]: spurious interrupt?\n",
 					h->sock);
 				continue;
 			}
+#endif
+
 			/* Call card handler, if any */
 			if (h->intrhandler != NULL) {
 				/*
@@ -652,9 +657,11 @@
 				 * running at a higher protection level
 				 * right now.
 				 */
-				(*h->intrhandler)(h->intrarg);
+				r |= (*h->intrhandler)(h->intrarg);
 			}
+#if 0
 		}
+#endif
 
 	}
 

--u3/rZRmxL6MmkK24--