From: Huang Ying <ying.huang@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-pm@vger.kernel.org,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [RFC] PCI/PM: Keep runtime PM enabled for unbound PCI devices
Date: Tue, 20 Nov 2012 08:52:46 +0800 [thread overview]
Message-ID: <1353372766.26072.21.camel@yhuang-dev> (raw)
In-Reply-To: <1521498.PJusLS7B2o@vostro.rjw.lan>
On Mon, 2012-11-19 at 23:00 +0100, Rafael J. Wysocki wrote:
> On Monday, November 19, 2012 11:31:01 AM Alan Stern wrote:
> > On Mon, 19 Nov 2012, Huang Ying wrote:
> >
> > > For unbound PCI devices, what we need is:
> > >
> > > - Always in D0 state, because some devices does not work again after
> > > being put into D3 by the PCI bus.
> > >
> > > - In SUSPENDED state if allowed, so that the parent devices can still
> > > be put into low power state.
> > >
> > > To satisfy these requirement, the runtime PM for the unbound PCI
> > > devices are disabled and set to SUSPENDED state. One issue of this
> > > solution is that the PCI devices will be put into SUSPENDED state even
> > > if the SUSPENDED state is forbidden via the sysfs interface
> > > (.../power/control) of the device. This is not an issue for most
> > > devices, because most PCI devices are not used at all if unbounded.
> > > But there are exceptions. For example, unbound VGA card can be used
> > > for display, but suspend its parents make it stop working.
> > >
> > > To fix the issue, we keep the runtime PM enabled when the PCI devices
> > > are unbound. But the runtime PM callbacks will do nothing if the PCI
> > > devices are unbound. This way, we can put the PCI devices into
> > > SUSPENDED state without put the PCI devices into D3 state.
> > >
> > > Known issue: after some changing, pci_dev->driver is used to indicate
> > > whether the PCI devices are bound and whether the runtime PM callbacks
> > > should do nothing. Maybe it is better to use a dedicated flag such as
> > > .skip_rtpm_callbacks. That may improve code readability.
> >
> > I think it's okay like this, especially if you add a comment in
> > pci_runtime_suspend, pci_runtime_resume, and pci_runtime_idle
> > explaining that when pci_dev->driver isn't set, the device should
> > always remain in D0 regardless of the runtime status.
>
> Yes, I agree with Alan. Please add comments as Alan's suggesting and it
> should be fine.
Sure. Will do that.
Best Regards,
Huang Ying
prev parent reply other threads:[~2012-11-20 0:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-19 3:14 [RFC] PCI/PM: Keep runtime PM enabled for unbound PCI devices Huang Ying
2012-11-19 16:31 ` Alan Stern
2012-11-19 22:00 ` Rafael J. Wysocki
2012-11-20 0:52 ` Huang Ying [this message]
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=1353372766.26072.21.camel@yhuang-dev \
--to=ying.huang@intel.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@sisk.pl \
--cc=stern@rowland.harvard.edu \
/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;
as well as URLs for NNTP newsgroup(s).