From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Huang Ying <ying.huang@intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [BUGFIX 3/4] PCI/PM: Fix config reg access for D3cold and bridge suspending
Date: Sat, 4 Aug 2012 23:37:46 +0200 [thread overview]
Message-ID: <201208042337.46394.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1208031042580.1520-100000@iolanthe.rowland.org>
On Friday, August 03, 2012, Alan Stern wrote:
> On Fri, 3 Aug 2012, Huang Ying wrote:
>
> > This patch fixes the following bug:
> >
> > http://marc.info/?l=linux-pci&m=134338059022620&w=2
> >
> > Where lspci does not work properly if a device and the corresponding
> > parent bridge (such as PCIe port) is suspended. This is because the
> > device configuration space registers will be not accessible if the
> > corresponding parent bridge is suspended or the device is put into
> > D3cold state.
> >
> > To solve the issue, the bridge/PCIe port connected to the device is
> > put into active state before read/write configuration space registers.
> > If the device is in D3cold state, it will be put into active state
> > too.
> >
> > To avoid resume/suspend PCIe port for each configuration register
> > read/write, a small delay is added before the PCIe port to go
> > suspended.
>
>
> > +static void
> > +pci_config_pm_runtime_put(struct pci_dev *pdev)
> > +{
> > + struct device *dev = &pdev->dev;
> > + struct device *parent = dev->parent;
> > +
> > + pm_runtime_put(dev);
> > + if (parent)
> > + pm_runtime_put(parent);
> > +}
>
> This is just the sort of thing Rafael and I have been talking about.
> Why do an asynchronous put, going to all the trouble of using the
> workqueue, if the idle routine is just going to call
> pm_schedule_suspend()?
If that's PCI, it will call pm_runtime_suspend(). That probably _should_ be
pm_schedule_suspend(), but it isn't at the moment.
> Why not call pm_runtime_put_sync() instead?
I guess because the caller doesn't care whether or not the devices will be
suspended immediately and we seem to have agreed already that the added
workqueue overhead is minimal.
If the _idle() routine were to call pm_schedule_suspend(), though, I'd
agree that the overhead would be absolutely unnecessary.
Thanks,
Rafael
next prev parent reply other threads:[~2012-08-04 21:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 6:30 [PATCH 0/4] PCI/PM: PCI D3cold support fixes for 3.6-rc1 Huang Ying
2012-08-03 6:30 ` [BUGFIX 1/4] PCI/PM: enable D3/D3cold by default for most devices Huang Ying
2012-08-04 21:46 ` Rafael J. Wysocki
2012-08-03 6:30 ` [BUGFIX 2/4] PCI/PM: Keep parent bridge active when probing device Huang Ying
2012-08-04 21:48 ` Rafael J. Wysocki
2012-08-03 6:30 ` [BUGFIX 3/4] PCI/PM: Fix config reg access for D3cold and bridge suspending Huang Ying
2012-08-03 14:46 ` Alan Stern
2012-08-04 21:37 ` Rafael J. Wysocki [this message]
2012-08-04 21:44 ` Rafael J. Wysocki
2012-08-03 6:30 ` [PATCH 4/4] PCI/PM: Add ABI document for sysfs file d3cold_allowed Huang Ying
2012-08-19 10:35 ` [PATCH 0/4] PCI/PM: PCI D3cold support fixes for 3.6-rc1 Bjørn Mork
2012-08-20 1:09 ` huang ying
2012-08-21 23:47 ` Bjorn Helgaas
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=201208042337.46394.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=ying.huang@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).