Subject: Re: PCI plug-in card interrupts in a CS20?
To: None <port-alpha@NetBSD.org>
From: Havard Eidnes <he@uninett.no>
List: port-alpha
Date: 11/09/2004 15:51:34
> Moving the card to the upper PCI slot made it go further, but it
> still does not work reliably.  With the card in that position, I
> can create the raidframe raid, but it will again start spewing
> the spurious interrupt messages at the moment I try to do newfs
> of a partition covering most of the raid.
>
> Why does these messages occur?  Isn't the controller / driver
> supposed to handle these interrupts?

It appears that the interrupt status register on the device
indicates that it did not trigger the interrupt.  With the
attached debugging changes applied to the isp_pci.c file, I got
these console messages when I tried newfs'ing the raidframe
device partition.

Guidance for what the actual problem might be still gratefully
accepted.

- Havard

------------------------------

raid0: RAID Level 0
raid0: Components: /dev/sd2a /dev/sd3a /dev/sd4a /dev/sd5a /dev/sd6a /dev/sd7a /dev/sd8a /dev/sd9a /dev/sd10a /dev/sd11a
raid0: Total Sectors: 177827720 (86829 MB)
raid0: New autoconfig value is: 1
raid0: New rootpartition value is: 0
isp_pci_rd_isr: isr == 0 && sema == 0 (after mask)
isp_pci_rd_isr: isr == 0x0, sema == 0x2
stray 6600 irq 36
isp_pci_rd_isr: isr == 0 && sema == 0 (after mask)
isp_pci_rd_isr: isr == 0x0, sema == 0x2
stray 6600 irq 36
isp_pci_rd_isr: isr == 0 && sema == 0 (after mask)
isp_pci_rd_isr: isr == 0x0, sema == 0x2
stray 6600 irq 36
isp_pci_rd_isr: isr == 0 && sema == 0 (after mask)
isp_pci_rd_isr: isr == 0x0, sema == 0x2
stray 6600 irq 36
isp_pci_rd_isr: isr == 0 && sema == 0 (after mask)
isp_pci_rd_isr: isr == 0x0, sema == 0x2
stray 6600 irq 36; stopped logging


Index: isp_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/isp_pci.c,v
retrieving revision 1.91
diff -u -p -r1.91 isp_pci.c
--- isp_pci.c   10 Mar 2004 22:42:47 -0000      1.91
+++ isp_pci.c   9 Nov 2004 14:49:48 -0000
@@ -716,6 +716,7 @@ isp_pci_rd_debounced(struct ispsoftc *is
                val1 = BXR2(pcs, IspVirt2Off(isp, off));
        } while (val0 != val1 && ++i < 1000);
        if (val0 != val1) {
+               printf("isp_pci de-bounce spin-out\n");
                return (1);
        }
        *rp = val0;
@@ -732,7 +733,7 @@ isp_pci_rd_isr(struct ispsoftc *isp, u_i
     u_int16_t *semap, u_int16_t *mbp)
 {
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
-       u_int16_t isr, sema;
+       u_int16_t isr, sema, oisr, osema;
 
        if (IS_2100(isp)) {
                if (isp_pci_rd_debounced(isp, BIU_ISR, &isr)) {
@@ -746,15 +747,21 @@ isp_pci_rd_isr(struct ispsoftc *isp, u_i
                sema = BXR2(pcs, IspVirt2Off(isp, BIU_SEMA));
        }
        isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema);
+       oisr = isr;
+       osema = sema;
        isr &= INT_PENDING_MASK(isp);
        sema &= BIU_SEMA_LOCK;
        if (isr == 0 && sema == 0) {
+               printf("isp_pci_rd_isr: isr == 0 && sema == 0 (after mask)\n");
+               printf("isp_pci_rd_isr: isr == 0x%x, sema == 0x%x\n",
+                       oisr, osema);
                return (0);
        }
        *isrp = isr;
        if ((*semap = sema) != 0) {
                if (IS_2100(isp)) {
                        if (isp_pci_rd_debounced(isp, OUTMAILBOX0, mbp)) {
+                               printf("isp_pci_rd_isr: failed mailbox read\n");
                                return (0);
                        }
                } else {