From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: huang ying <huang.ying.caritas@gmail.com>
Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
"Jesse Barnes" <jesse.barnes@intel.com>,
"Huang Ying" <ying.huang@intel.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
ming.m.lin@intel.com, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-pm@vger.kernel.org,
"Zheng Yan" <zheng.z.yan@intel.com>
Subject: Re: [PATCH -v5 3/3] PCIe, PM, Add PCIe runtime D3cold support
Date: Sat, 16 Jun 2012 23:09:01 +0200 [thread overview]
Message-ID: <201206162309.02170.rjw@sisk.pl> (raw)
In-Reply-To: <CAC=cRTOCaMGxyS8pvDzYR55w_QOEbcNjgococfE0NtobAg24Hg@mail.gmail.com>
On Saturday, June 16, 2012, huang ying wrote:
> On Sat, Jun 16, 2012 at 5:21 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> [snip]
> >
> > > @@ -731,9 +791,13 @@ int pci_set_power_state(struct pci_dev *
> > > {
> > > int error;
> > >
> > > - /* bound the state we're entering */
> > > - if (state > PCI_D3hot)
> > > + /* D3cold during system suspend/hibernate is not supported */
> > > + if (!dev->runtime_d3cold && state > PCI_D3hot)
> >
> > I don't think this is the right place for the dev->runtime_d3cold check,
> > I've already told you that and haven't heard anything from you causing me
> > to change my mind.
> >
> > If you don't want D3cold to be used during system sleep transitions,
> > please make sure that D3cold is not passed to pci_set_power_state() in
> > those cases.
> >
>
> OK. Checked pci_set_power_state usage with following command line:
>
> $ grep 'pci_set_power_state' -r . | grep -v PCI_D3hot | grep -v PCI_D0 |
> grep -v pci_choose_state
> $ grep 'pci_set_power_state' -r . | grep -v PCI_D3hot | grep -v PCI_D0 |
> grep -v pci_choose_state | grep -i d3cold
>
> Found that, almost all pci_set_power_state usage is:
>
> 1) set to PCI_Dx (not PCI_D3cold)
> 2) set to the state that choosed by pci_choose_state()
> 3) driver use pci_prepare_to_sleep(), which will call pci_set_power_state()
>
> The only two exceptions are as follow:
>
> ./drivers/misc/cb710/core.c: pci_set_power_state(pdev,
> PCI_D3cold);
> ./arch/x86/pci/mrst.c: pci_set_power_state(dev, PCI_D3cold);
Well, no one is supposed to pass PCI_D3cold to pci_set_power_state() before
the $subject patch, so they should be fixed anyway.
> And pci_choose_state() will not return PCI_D3cold for system suspend.
>
> So what do you think about the following solution?
>
> a) Change pci_prepare_to_sleep(), so that it will not put device into
> PCI_D3cold.
> b) Change PCI_D3cold to PCI_D3hot in the following two places,
>
> ./drivers/misc/cb710/core.c: pci_set_power_state(pdev,
> PCI_D3cold);
> ./arch/x86/pci/mrst.c: pci_set_power_state(dev, PCI_D3cold);
Yes, that will do.
Thanks,
Rafael
prev parent reply other threads:[~2012-06-16 21:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 2:47 [PATCH -v5 0/3] PCIe, PM, Add PCIe runtime D3cold support Huang Ying
2012-06-11 2:47 ` [PATCH -v5 1/3] ACPI, PM, Specify lowest allowed state for device sleep state Huang Ying
2012-06-15 20:17 ` Rafael J. Wysocki
2012-06-11 2:47 ` [PATCH -v5 2/3] PCIe, PM, Add runtime PM support to PCIe port Huang Ying
2012-06-11 2:47 ` [PATCH -v5 3/3] PCIe, PM, Add PCIe runtime D3cold support Huang Ying
2012-06-15 21:21 ` Rafael J. Wysocki
2012-06-16 3:30 ` huang ying
[not found] ` <CAC=cRTOCaMGxyS8pvDzYR55w_QOEbcNjgococfE0NtobAg24Hg@mail.gmail.com>
2012-06-16 21:09 ` Rafael J. Wysocki [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=201206162309.02170.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=bhelgaas@google.com \
--cc=huang.ying.caritas@gmail.com \
--cc=jesse.barnes@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=ming.m.lin@intel.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=ying.huang@intel.com \
--cc=zheng.z.yan@intel.com \
/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).