Subject: Re: pciide lost interrupt - losing access to the file system
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Rick Byers <rickb@iaw.on.ca>
List: current-users
Date: 10/22/1999 15:05:13
Hi Manuel,

Thanks for the patch.  After applying it, I have been unable to
reproduce the problem (neither the timeout, or the "missing untimeout"
messages occur any more).  My primary IDE controller is interrupting on
IRQ 14, and nothing else is using this IRQ so I don't think it's a
problem of sharing IRQs.

Feel free to close PR kern/8626 when you commit the patch.  Let me know
if you want me to do any more testing, or if you want access to my
machine (it is connected to the internet whenever its on) so that you
can try to track down the cause of the problem.

Thanks again!
	Rick

P.S. I recently had my first visit to Paris (and Europe), it's a
beautiful city!

Manuel Bouyer wrote:
> 
> On Sun, Oct 17, 1999 at 05:19:36PM +0930, Brett Lymn wrote:
> > This is why I asked - I too had no problems having the disk spin down
> > & spin up again on access mainly to extend the battery life on my
> > laptop.  It worked fine with a -current that was just prior to the 1.4
> > release but now it does not.
> >
> > I hope this gives Manuel a few clues as to what may be going wrong...
> 
> Well, maybe. I've found a situation where the driver could be erroneously
> switched to "not waiting for IRQ" state. The patch below should solve this.
> Could those of you who can reproduce the 'missing untimeout' message test it ?
> 
> However this reveal another problem here, which is that we are getting an
> interrupt before the drive is ready. This can happen when the irq is shared
> with another device but this is not the common case.
> 
> --
> Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
> --
> 
> Index: wdc.c
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/dev/ic/wdc.c,v
> retrieving revision 1.74
> diff -u -r1.74 wdc.c
> --- wdc.c       1999/09/23 11:04:32     1.74
> +++ wdc.c       1999/10/19 18:32:45
> @@ -646,6 +646,7 @@
>  {
>         struct channel_softc *chp = arg;
>         struct wdc_xfer *xfer;
> +       int ret;
> 
>         if ((chp->ch_flags & WDCF_IRQ_WAIT) == 0) {
>                 WDCDEBUG_PRINT(("wdcintr: inactive controller\n"), DEBUG_INTR);
> @@ -655,7 +656,10 @@
>         WDCDEBUG_PRINT(("wdcintr\n"), DEBUG_INTR);
>         chp->ch_flags &= ~WDCF_IRQ_WAIT;
>         xfer = chp->ch_queue->sc_xfer.tqh_first;
> -       return xfer->c_intr(chp, xfer, 1);
> +       ret = xfer->c_intr(chp, xfer, 1);
> +       if (ret == 0) /* irq was not for us, still waiting for irq */
> +               chp->ch_flags |= WDCF_IRQ_WAIT;
> +       return (ret);
>  }
> 
>  /* Put all disk in RESET state */

-- 
=========================================================================
Rick Byers                       University of Waterloo, Computer
Science
rickb@iaw.on.ca                              
http://www.iaw.on.ca/rickb/