From: Huang Ying <ying.huang@intel.com>
To: mike <qiudayu@linux.vnet.ibm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Bjorn Helgaas <bhelgaas@google.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
linux-pm@vger.kernel.org, rjw@rjwysocki.net
Subject: Re: A question about the patch: [PATCH] PCI/PM: Keep runtime PM enabled for unbound PCI devices
Date: Thu, 14 Nov 2013 15:53:29 +0800 [thread overview]
Message-ID: <1384415609.30364.18.camel@yhuang-dev> (raw)
In-Reply-To: <5284799C.1010000@linux.vnet.ibm.com>
On Thu, 2013-11-14 at 15:19 +0800, mike wrote:
> On 11/14/2013 01:59 PM, Huang Ying wrote:
> > On Thu, 2013-11-14 at 11:23 +0800, mike wrote:
> >> On 11/14/2013 03:20 AM, Alan Stern wrote:
> >>> On Wed, 13 Nov 2013, Bjorn Helgaas wrote:
> >>>
> >>>> [+cc Rafael, linux-pm]
> >>>>
> >>>> On Wed, Nov 13, 2013 at 6:09 AM, mike<qiudayu@linux.vnet.ibm.com> wrote:
> >>>>> Hi Huang Ying,
> >>>>>
> >>>>> I see you are the author of this patch, commit id is:
> >>>>> 967577b062417b4e4b8e27b711220f4124f5153a
> >>>>>
> >>>>> I have a question while I try to understand this patch,
> >>>>> So I would very grateful if you or others can give me some reply.....
> >>>>>
> >>>>> ............
> >>>>> - rc = ddi->drv->probe(ddi->dev, ddi->id);
> >>>>> + pm_runtime_get_sync(dev);
> >>>>> + pci_dev->driver = pci_drv;
> >>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^
> >>>>> I see here you make the driver to initialize before probe,
> >>>>> But I have no idea of why you do this change.....
> >>>>>
> >>>>> and I look inside the code, it may be pm_runtime relate??
> >>> Yes, it is related to runtime PM. In the PCI subsystem, runtime PM
> >>> doesn't do anything unless pci_dev->driver is set. You can see this at
> >>> the start of pci_pm_runtime_suspend().
> >>>
> >>> Since we want the driver's probe routine to be able to carry out
> >>> runtime PM operations, we have to set pci_dev->driver before the probe
> >>> routine runs.
> >> Is there any situations , like in probe state, pci_dev->driver
> >> has been set. the pci_pm_runtime_xxx() has passed
> >> pci_dev->driver NULL check, but at this point, probe fail
> >> occurs, and pci_dev->driver to be set to NULL.
> >>
> >> What will happen ? Or this situation will never happen?
> >> I'm confuse about this.
> > I think that will never happen. Before ->probe(), pm_runtime_get_sync()
> > is called, so pci_pm_runtime_xxx() will not be called until
> > pm_runtime_put_noidle() is called in ->probe(). And
> > should be done as one of the latest actions in
> > ->probe(), after the normal probe actions succeeded.
> OK, just as your description, it seems OK.
> But this is really a issue as I explained in last email.
>
> So I want to know if there are any side-effect of changing the code
> in pci_pm_runtime_xxx()
>
> if (!pci_dev->driver)
> return 0;
> to
>
> if (!dev->driver)
> return 0;
>
If you make this change, we can not put devices into low power state
(runtime suspend the device) in ->probe(). That is expected in some
circumstance.
Best Regards,
Huang Ying
next prev parent reply other threads:[~2013-11-14 7:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 13:09 A question about the patch: [PATCH] PCI/PM: Keep runtime PM enabled for unbound PCI devices mike
2013-11-13 16:47 ` Bjorn Helgaas
2013-11-13 19:20 ` Alan Stern
2013-11-14 3:23 ` mike
2013-11-14 5:59 ` Huang Ying
2013-11-14 7:19 ` mike
2013-11-14 7:53 ` Huang Ying [this message]
2013-11-14 8:12 ` mike
2013-11-14 8:25 ` Huang Ying
2013-11-14 8:37 ` mike
2013-11-14 8:54 ` Huang Ying
2013-11-26 5:41 ` Mike Qiu
2013-11-26 20:32 ` Rafael J. Wysocki
2013-11-27 5:32 ` Mike Qiu
2013-11-27 6:31 ` Huang Ying
2013-11-27 14:15 ` 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=1384415609.30364.18.camel@yhuang-dev \
--to=ying.huang@intel.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=qiudayu@linux.vnet.ibm.com \
--cc=rjw@rjwysocki.net \
--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).