Subject: Re: Suspending interrupts
To: None <tech-kern@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-kern
Date: 07/05/2007 13:57:38
On Thu, Jul 05, 2007 at 12:58:49AM +0100, Andrew Doran wrote:
> On Tue, Jul 03, 2007 at 09:32:49PM +0200, Joerg Sonnenberger wrote:
> 
> > during a discuss with Jared about the ACPI suspend/resume code in some
> > drivers and the comment about failing pci_intr_establish triggered some
> > thinking about how to do this better.
> > 
> > The attached patch can be considered a PoC. It introduces two new
> > functions pci_intr_disable and pci_intr_reenable meant to temporary
> > disable an interrupt handler. The backend implement just sets them to a
> > void handler. The idea is that the handler won't be called again, the
> > hardware was shutdown already and that the interrupt can always be
> > enabled again later.
> 
> Why not mask the interrupt instead of dummying it?

I have no problem if the backend implementation actually masks it. For my
use it doesn't matter as I have shared interrupts. So in general the
backend implementation would have to do both.

> > This is helpful in a number of other cases beside suspend/resume, where
> > the driver knows that no interrupt will occur (e.g. NICs that are down).
> 
> Can you really depend on that?

A number of network drivers (e.g. re(4)) already just return in the
interrupt handler if they are down, so I guess it works good enough.

Joerg