[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0902030955370.3247@localhost.localdomain>
Date: Tue, 3 Feb 2009 09:59:34 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "Rafael J. Wysocki" <rjw@...k.pl>
cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jesse Barnes <jesse.barnes@...el.com>,
Andreas Schwab <schwab@...e.de>, Len Brown <lenb@...nel.org>,
Ingo Molnar <mingo@...e.hu>
Subject: Re: Reworking suspend-resume sequence (was: Re: PCI PM: Restore
standard config registers of all devices early)
On Tue, 3 Feb 2009, Rafael J. Wysocki wrote:
>
> Having reconsidered it, I think that the "loop of disable_irq()" may be
> problematic due to MSI/MSI-X and devices that are put into D3 during the
> "normal" suspend. That is, we shouldn't try to mask MSI/MSI-X for devices in
> D3
Rafael, you seem to be confused about what "disable_irq()" does.
It does not touch the driver hardware AT ALL. It literally just touches
the interrupt controller, and even that only indirectly.
What disable_irq() does it literally:
void disable_irq_nosync(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
if (!desc)
return;
spin_lock_irqsave(&desc->lock, flags);
if (!desc->depth++) {
desc->status |= IRQ_DISABLED;
desc->chip->disable(irq);
}
spin_unlock_irqrestore(&desc->lock, flags);
}
and then it does a "synchronize_irq()" to wait to make sure that there are
no pending ones.
And in many cases, even the
desc->chip->disable(irq);
doesn't actually _do_ anything - we'll quite possibly continue to take the
interrupt, and only when the interrupt happens will it see the "oh,
IRQ_DISABLED is set" thing, and do something about it.
So don't worry about putting devices in D3 - disable_irq() will not care
AT ALL whether the device is alive or not, and will never try to touch it
anyway.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists