Subject: Re: Problems with rccide0
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Martti Kuparinen <martti.kuparinen@iki.fi>
List: current-users
Date: 12/01/2003 10:47:51
Manuel Bouyer wrote:

> OK, this is likely an interrupt problem then. Can you add printfs to
> serverworks_pci_intr() to see if there's a loop at this level (or add

I added few printfs:

int
serverworks_pci_intr(arg)
         void *arg;
{
         struct pciide_softc *sc = arg;
         struct pciide_channel *cp;
         struct channel_softc *wdc_cp;
         int rv = 0;
         int dmastat, i, crv;

printf("1\n");
         for (i = 0; i < sc->sc_wdcdev.nchannels; i++) {
printf("2 i=%d\n", i);
                 cp = &sc->pciide_channels[i];
                 dmastat = bus_space_read_1(sc->sc_dma_iot,
                     cp->dma_iohs[IDEDMA_CTL], 0);
printf("3 dmastat=0x%x\n", dmastat);
                 if ((dmastat & (IDEDMA_CTL_ACT | IDEDMA_CTL_INTR)) !=
                     IDEDMA_CTL_INTR)
                         continue;
printf("4\n");
                 wdc_cp = &cp->wdc_channel;
                 crv = wdcintr(wdc_cp);
printf("5\n");
                 if (crv == 0) {
                         printf("%s:%d: bogus intr\n",
                             sc->sc_wdcdev.sc_dev.dv_xname, i);
                         bus_space_write_1(sc->sc_dma_iot,
                             cp->dma_iohs[IDEDMA_CTL], 0, dmastat);
                 } else
                         rv = 1;
         }
printf("6\n");
         return rv;
}


This is what comes to the console (in a never ending loop):

1
2 i=0
3 dmastat=0x20
2 i=1
3 dmastat=0xff
6
1
2 i=0
3 dmastat=0x20
2 i=1
3 dmastat=0xff
6