From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Takashi Iwai <tiwai@suse.de>, Greg KH <greg@kroah.com>,
LKML <linux-kernel@vger.kernel.org>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
pm list <linux-pm@lists.linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 1/3] PCI: Rework default handling of suspend and resume
Date: Sat, 6 Dec 2008 22:36:43 +0100 [thread overview]
Message-ID: <200812062236.44111.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0812061324260.13426-100000@netrider.rowland.org>
Hi Alan,
On Saturday, 6 of December 2008, Alan Stern wrote:
> On Sat, 6 Dec 2008, Rafael J. Wysocki wrote:
>
> > On Saturday, 6 of December 2008, Linus Torvalds wrote:
> > >
> > > On Sat, 6 Dec 2008, Rafael J. Wysocki wrote:
> > > >
> > > > USB doesn't use that for PCI suspend-resume, it uses it for suspend-resume of
> > > > USB devices behind the controller.
> > >
> > > Oh, in that case there are no PCI users of this at all, and what the PCI
> > > driver does is immaterial ;)
> > >
> > > > But then we will save the device's registers in the "sleeping" state.
> > >
> > > No no. The rule would be that a PCI driver - if it uses the new
> > > infrastructure, which apparently nobody does _as_ a PCI driver - simply
> > > would never do the whole "pci_set_power_state(PCI_D3hot)" etc crud AT ALL.
> >
> > Now _that_ sounds good. :-)
> >
> > > So a PCI driver would only do higher-level stuff in its suspend/resume
> > > code. For example, a USB host controller would initiate the USB bus level
> > > stuff, and likely just stop the controller (not suspend it - just stop
> > > it).
> >
> > I like this idea very much.
>
> Rafael, I'd be happy to help with fixing up the USB PCI PM code. At
> this point I'm not sure exactly what's needed, though. For instance,
> is there any compelling reason to switch over to the new dev_pm_ops
> approach?
Certainly not at the moment. There will be a reason some time after .29.
That said, it apparently is possible to clean up the resume callbacks of PCI
USB controllers, as mentioned here: http://lkml.org/lkml/2008/12/6/38
> And what should the correct sequence of calls be?
Well, that's something I'm not exactly sure about myself. Surely it seems
reasonable to call pci_restore_state() with interrupts disabled and do the rest
of resume after that. Also, I think that the core could execute things like
pci_enable_device() during resume and pci_set_power_state()/pci_enable_wake()
on suspend so that the drivers didn't have to. This way we could reduce code
duplication quite a bit.
However, I'm not quite sure about the freeing and requesting IRQs during
suspend and resume. Many drivers do that, many others don't. Still,
apparently some drivers don't work correctly after resume if this is not done.
So, if that should generally be done, I also think that moving it to the core
might be a good idea.
Thanks,
Rafael
next parent reply other threads:[~2008-12-06 21:36 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44L0.0812061324260.13426-100000@netrider.rowland.org>
2008-12-06 21:36 ` Rafael J. Wysocki [this message]
2008-12-06 22:24 ` [PATCH 1/3] PCI: Rework default handling of suspend and resume Linus Torvalds
[not found] ` <alpine.LFD.2.00.0812061420190.3425@nehalem.linux-foundation.org>
2008-12-06 23:25 ` Arjan van de Ven
[not found] ` <20081206152545.326c8b67@infradead.org>
2008-12-06 23:35 ` Alan Cox
2008-12-07 6:00 ` Linus Torvalds
[not found] ` <alpine.LFD.2.00.0812062157590.3425@nehalem.linux-foundation.org>
2008-12-07 6:03 ` Linus Torvalds
2008-12-07 9:44 ` Takashi Iwai
[not found] ` <s5hd4g4xqso.wl%tiwai@suse.de>
2008-12-07 12:30 ` Rafael J. Wysocki
[not found] ` <alpine.LFD.2.00.0812062201230.3425@nehalem.linux-foundation.org>
2008-12-07 13:39 ` Rafael J. Wysocki
[not found] ` <200812071439.27712.rjw@sisk.pl>
2008-12-07 16:34 ` Linus Torvalds
2008-12-07 17:18 ` Arjan van de Ven
[not found] ` <alpine.LFD.2.00.0812070824260.3425@nehalem.linux-foundation.org>
2008-12-14 9:28 ` Pavel Machek
2008-12-07 0:02 ` Alan Stern
2008-12-08 22:13 ` USB suspend and resume for PCI host controllers Alan Stern
[not found] <Pine.LNX.4.44L0.0812061858160.16554-100000@netrider.rowland.org>
2008-12-07 13:14 ` [PATCH 1/3] PCI: Rework default handling of suspend and resume Rafael J. Wysocki
[not found] <200812020320.31876.rjw@sisk.pl>
[not found] ` <200812061505.33815.rjw@sisk.pl>
2008-12-06 14:07 ` Rafael J. Wysocki
2008-12-06 17:07 ` Linus Torvalds
[not found] ` <alpine.LFD.2.00.0812060855580.3425@nehalem.linux-foundation.org>
2008-12-06 17:22 ` Rafael J. Wysocki
[not found] ` <200812061822.35763.rjw@sisk.pl>
2008-12-06 17:33 ` Linus Torvalds
[not found] ` <alpine.LFD.2.00.0812060930490.3425@nehalem.linux-foundation.org>
2008-12-06 17:43 ` Rafael J. Wysocki
[not found] ` <200812061843.59495.rjw@sisk.pl>
2008-12-06 18:00 ` Linus Torvalds
2008-12-06 21:24 ` Rafael J. Wysocki
2008-12-07 4:44 ` Jesse Barnes
2008-12-07 5:41 ` Greg KH
[not found] ` <20081207054149.GA20415@kroah.com>
2008-12-07 12:47 ` Rafael J. Wysocki
[not found] ` <200812071347.18608.rjw@sisk.pl>
2008-12-07 16:44 ` Linus Torvalds
2008-12-07 17:26 ` Greg KH
[not found] ` <alpine.LFD.2.00.0812070835040.3425@nehalem.linux-foundation.org>
2008-12-07 21:02 ` Rafael J. Wysocki
2008-12-06 18:30 ` Alan Stern
2008-12-06 21:09 ` Alan Cox
2008-12-06 21:50 ` Rafael J. Wysocki
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=200812062236.44111.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=mingo@elte.hu \
--cc=stern@rowland.harvard.edu \
--cc=tiwai@suse.de \
--cc=torvalds@linux-foundation.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