public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Belay <ambx1@neo.rr.com>
To: Fabrice Gautier <Fabrice_Gautier@sdesigns.com>
Cc: linux-pm <linux-pm@lists.osdl.org>
Subject: Re: A reference implementation of PCI suspend/resume?
Date: Mon, 16 May 2005 16:16:06 -0400	[thread overview]
Message-ID: <20050516201606.GA11189@neo.rr.com> (raw)
In-Reply-To: <9F77D654ED40B74CA79E5A60B97A087B0310DCD4@sd-exchange.sdesigns.com>

[-- Attachment #1: Type: text/plain, Size: 2626 bytes --]

On Fri, May 13, 2005 at 10:06:42PM -0700, Fabrice Gautier wrote:
> Hi,
> 
> > From: Shaohua Li [mailto:shaohua.li@intel.com] 
> > Sent: Wednesday, May 11, 2005 6:25 PM
> > To: linux-pm
> > Subject: [linux-pm] A reference implementation of PCI suspend/resume?
> > 
> > Hi,
> > There are still many PCI drivers don't implement their 
> > .suspend/.resume
> > methods correctly. I felt it would be quite helpful there is 
> > a reference
> > implementation. Here is my thought:
> > 
> > [...snip...]
> > 
> > Currently many drivers don't call
> > free_irq/request_irq/pci_disable_device, which makes unexpected
> > interrupt occur and even break suspend/resume in some systems. 
> 
> I don't understand why not calling free_irq would cause unexpected
> interrupts.

I don't think it would.  However, there are three reasons in favor of
unregister PCI interrupts:

a.) the kernel will complain if the irq isn't handled, revealing a possible
problem with the driver's suspend routine.

b.) You're assuming every device has its own interrupt.  This may not be the
case.  Let's say one device was sharing interrupts with a few other devices.
We don't want it's interrupt handler to mess up things when it tries to read
hardware registers from a physically "off" device, as it may possibly generate
errors.  Almost every interrupt handler assumes the device is "on", as it
should.  Each interrupt handler has to ask its hardware if it generated the
interrupt.

c.) Selective device suspending: obviously we don't want to leave stale
interrupt handlers around.


> 
> The way I understand the PCI spec is: if you suspend a PCI device, its IRQ
> should be disabled. If an IRQ come from this device anyway (in violation of
> the spec) then the driver for this device should handle it so you should NOT
> unregister its irq_handler.

This would be a quirk.

> (How does such a device would handle such a irq is another matter - a device
> specific one I guess)

It would need a special case for handling suspend time interrupts.  This
would vary between situation and brokeness.

> 
> I'm not understanding where your unexpected interrupt is coming from.
> 
> Care to elaborate?

Like I said, another device on the same link is one possible problem.

> 
> Btw: I'm suspending PCI devices not in the context of a full suspend
> situation, maybe that's why I'm missing your point. But your sample
> implementation should work in both cases.

Yes, although I think we need to specify the situation to the driver in case
it needs to do something special, in general, the full and partial device
suspends should be very similar.

Thanks,
Adam

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2005-05-16 20:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-14  5:06 A reference implementation of PCI suspend/resume? Fabrice Gautier
2005-05-16  4:53 ` David Brownell
2005-05-16  8:55 ` Shaohua Li
2005-05-16 20:16 ` Adam Belay [this message]
2005-05-16 20:56   ` Rafael J. Wysocki
2005-05-16 21:19   ` Jordan Crouse
2005-05-17  0:26     ` David Brownell
2005-05-17  9:10       ` Rafael J. Wysocki
2005-05-17 18:35         ` David Brownell
2005-05-17 19:28           ` Rafael J. Wysocki
2005-05-18  1:26             ` Adam Belay
2005-05-18 17:40               ` Rafael J. Wysocki
2005-05-18 18:32                 ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2005-05-16 19:02 Fabrice Gautier
2005-05-16 19:39 ` David Brownell
2005-05-12  1:24 Shaohua Li
2005-05-12  6:21 ` Adam Belay
2005-05-12  7:03   ` Shaohua Li
2005-05-27  6:49 ` Shaohua Li
2005-05-27  7:20   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050516201606.GA11189@neo.rr.com \
    --to=ambx1@neo.rr.com \
    --cc=Fabrice_Gautier@sdesigns.com \
    --cc=linux-pm@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox