From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Frans Pop <elendil@planet.nl>
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
linux-pm@lists.linux-foundation.org
Subject: Re: [RFC][PATCH][0/8] PM: Rework suspend-resume ordering to avoid problems with shared interrupts
Date: Sat, 14 Mar 2009 12:59:01 +0100 [thread overview]
Message-ID: <200903141259.02164.rjw@sisk.pl> (raw)
In-Reply-To: <200903140944.37081.elendil@planet.nl>
On Saturday 14 March 2009, Frans Pop wrote:
> On Sunday 08 March 2009, Rafael J. Wysocki wrote:
> > > # These don't need restoring anymore?
> >
> > I think they generally do, but the restored values may (and often are)
> > identical to the current ones.
> >
> > > -pci 0000:00:02.1: restoring config space at offset 0x4 (was 0x4, writing 0xe0500004)
> > > -pci 0000:00:02.1: restoring config space at offset 0x1 (was 0x900000, writing 0x900007)
> > > -pci 0000:00:03.0: restoring config space at offset 0xf (was 0x100, writing 0x1ff)
> > > -pci 0000:00:03.0: restoring config space at offset 0x4 (was 0xfed12004, writing 0xe0600004)
> > > -pci 0000:00:03.2: restoring config space at offset 0xf (was 0x300, writing 0x30b)
> > > -pci 0000:00:03.2: restoring config space at offset 0x8 (was 0x1, writing 0x2031)
> > > -pci 0000:00:03.2: restoring config space at offset 0x7 (was 0x1, writing 0x2021)
> > > -pci 0000:00:03.2: restoring config space at offset 0x6 (was 0x1, writing 0x2019)
> > > -pci 0000:00:03.2: restoring config space at offset 0x5 (was 0x1, writing 0x2011)
> > > -pci 0000:00:03.2: restoring config space at offset 0x4 (was 0x1, writing 0x2009)
> > > -pci 0000:00:03.2: restoring config space at offset 0x1 (was 0xb00000, writing 0xb00001)
> [...]
> > > # These have moved down to late resume.
> >
> > That's a bit strange. It looks like the registers changed after we had
> > restored them during "early" resume. So either we hadn't actually
> > restored them (it would be interesting to find out why), or they really
> > changed (again, it would be interesting to see why).
> >
> > > -uhci_hcd 0000:00:1a.0: restoring config space at offset 0xf (was 0x100, writing 0x10a)
> > > -uhci_hcd 0000:00:1a.0: restoring config space at offset 0x8 (was 0x1, writing 0x2081)
> > > -uhci_hcd 0000:00:1a.0: restoring config space at offset 0x1 (was 0x2800000, writing 0x2800001)
> > > -uhci_hcd 0000:00:1a.1: restoring config space at offset 0xf (was 0x200, writing 0x20a)
> > > -uhci_hcd 0000:00:1a.1: restoring config space at offset 0x8 (was 0x1, writing 0x20a1)
> > > -uhci_hcd 0000:00:1a.1: restoring config space at offset 0x1 (was 0x2800000, writing 0x2800001)
>
> These changes look to have been reverted somehow with rc8 + your latest
> patch set. Not sure if it's due to changes in the patches, or just an
> effect of local circumstances (such as (un)suspending while the system
> is docked). Or sun spots of course.
>
> The "restoring config space" messages now look virtually the same
> as for rc5, only some messages for the ricoh-mmc module are still
> "missing", but I'm not worried about that.
Thanks for testing!
Could you please also test the last iteration of the $subject patch series
(just sent) with the appended patch applied on top and post dmesg output?
Rafael
---
drivers/pci/pci-driver.c | 23 +++++++++++++++++++++--
drivers/pci/pci.c | 5 +++++
2 files changed, 26 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/pci/pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci.c
+++ linux-2.6/drivers/pci/pci.c
@@ -732,6 +732,9 @@ int
pci_save_state(struct pci_dev *dev)
{
int i;
+
+ dev_info(&dev->dev, "saving PCI config space\n");
+
/* XXX: 100% dword access ok here? */
for (i = 0; i < 16; i++)
pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]);
@@ -753,6 +756,8 @@ pci_restore_state(struct pci_dev *dev)
int i;
u32 val;
+ dev_info(&dev->dev, "restoring PCI config space\n");
+
/* PCI Express register must be restored first */
pci_restore_pcie_state(dev);
Index: linux-2.6/drivers/pci/pci-driver.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci-driver.c
+++ linux-2.6/drivers/pci/pci-driver.c
@@ -438,10 +438,24 @@ static int pci_restore_standard_config(s
{
pci_update_current_state(pci_dev, PCI_UNKNOWN);
+ switch (pci_dev->current_state) {
+ case PCI_UNKNOWN:
+ case PCI_POWER_ERROR:
+ dev_info(&pci_dev->dev, "%s: unknown power state\n",
+ __FUNCTION__);
+ break;
+ default:
+ dev_info(&pci_dev->dev, "%s: power state D%d\n",
+ __FUNCTION__, pci_dev->current_state);
+ }
+
if (pci_dev->current_state != PCI_D0) {
int error = pci_set_power_state(pci_dev, PCI_D0);
- if (error)
+ if (error) {
+ dev_err(&pci_dev->dev,
+ "error %d while changing power state\n", error);
return error;
+ }
}
return pci_dev->state_saved ? pci_restore_state(pci_dev) : 0;
@@ -449,6 +463,8 @@ static int pci_restore_standard_config(s
static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
{
+ dev_info(&pci_dev->dev, "%s: calling pci_restore_standard_config()\n",
+ __FUNCTION__);
pci_restore_standard_config(pci_dev);
pci_dev->state_saved = false;
pci_fixup_device(pci_fixup_resume_early, pci_dev);
@@ -615,8 +631,11 @@ static int pci_pm_resume(struct device *
* This is necessary for the suspend error path in which resume is
* called without restoring the standard config registers of the device.
*/
- if (pci_dev->state_saved)
+ if (pci_dev->state_saved) {
+ dev_info(dev, "%s: restoring standard PCI config registers\n",
+ __FUNCTION__);
pci_restore_standard_config(pci_dev);
+ }
if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_resume(dev);
next prev parent reply other threads:[~2009-03-14 11:59 UTC|newest]
Thread overview: 187+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-22 17:37 [RFC][PATCH 0/2] Rework disabling of interrupts during suspend-resume Rafael J. Wysocki
2009-02-22 17:38 ` [RFC][PATCH 1/2] PM: Split up sysdev_[suspend|resume] from device_power_[down|up] Rafael J. Wysocki
2009-02-22 20:56 ` Adrian Bunk
2009-02-22 21:07 ` Linus Torvalds
2009-02-22 21:12 ` Ingo Molnar
2009-02-22 22:42 ` Adrian Bunk
2009-03-05 16:54 ` Pavel Machek
2009-02-22 17:39 ` [RFC][PATCH 2/2] PM: Rework handling of interrupts during suspend-resume Rafael J. Wysocki
2009-02-22 18:01 ` Linus Torvalds
2009-02-22 22:42 ` Rafael J. Wysocki
2009-02-22 23:48 ` Rafael J. Wysocki
2009-02-23 0:05 ` Linus Torvalds
2009-02-23 1:23 ` Linus Torvalds
2009-02-23 10:52 ` Rafael J. Wysocki
2009-02-23 3:04 ` Eric W. Biederman
2009-02-23 8:44 ` Ingo Molnar
2009-02-23 9:22 ` Eric W. Biederman
2009-02-23 9:44 ` Ingo Molnar
2009-02-23 10:42 ` Eric W. Biederman
2009-02-23 11:03 ` Rafael J. Wysocki
2009-02-23 15:28 ` Eric W. Biederman
2009-02-23 21:39 ` Rafael J. Wysocki
2009-02-24 3:30 ` Eric W. Biederman
2009-02-24 22:42 ` Rafael J. Wysocki
2009-02-24 22:51 ` Linus Torvalds
2009-02-24 23:07 ` Rafael J. Wysocki
2009-02-24 23:09 ` Ingo Molnar
2009-02-24 23:29 ` Rafael J. Wysocki
2009-02-25 13:23 ` Ingo Molnar
2009-02-26 1:17 ` Arve Hjønnevåg
2009-02-26 1:27 ` Linus Torvalds
2009-02-26 2:13 ` Arve Hjønnevåg
2009-02-26 2:51 ` Linus Torvalds
2009-02-26 3:00 ` Ingo Molnar
2009-02-26 3:31 ` Arve Hjønnevåg
2009-02-26 3:37 ` Linus Torvalds
2009-02-26 3:50 ` Arve Hjønnevåg
2009-02-26 3:57 ` Linus Torvalds
2009-02-26 4:13 ` Arve Hjønnevåg
2009-02-26 4:20 ` Eric W. Biederman
2009-02-26 4:24 ` Arve Hjønnevåg
2009-02-26 9:50 ` Rafael J. Wysocki
2009-02-26 20:34 ` Arve Hjønnevåg
2009-02-26 20:57 ` Benjamin Herrenschmidt
2009-02-26 21:20 ` Arve Hjønnevåg
2009-02-26 21:49 ` Benjamin Herrenschmidt
2009-02-26 21:58 ` Rafael J. Wysocki
2009-02-26 22:10 ` Linus Torvalds
2009-02-26 22:30 ` Arve Hjønnevåg
2009-02-26 23:10 ` Rafael J. Wysocki
2009-02-27 0:00 ` Arve Hjønnevåg
2009-02-27 0:27 ` Linus Torvalds
2009-02-27 3:20 ` [linux-pm] " Alan Stern
2009-02-27 4:43 ` Linus Torvalds
2009-02-27 14:59 ` Alan Stern
2009-02-27 20:30 ` Linus Torvalds
2009-02-28 3:54 ` Arve Hjønnevåg
2009-02-28 10:06 ` Rafael J. Wysocki
2009-02-28 17:03 ` Linus Torvalds
2009-02-28 22:15 ` Arve Hjønnevåg
2009-02-26 22:30 ` Rafael J. Wysocki
2009-02-25 4:16 ` Eric W. Biederman
2009-02-25 4:26 ` Linus Torvalds
2009-02-25 4:59 ` Eric W. Biederman
2009-02-25 15:32 ` [linux-pm] " Alan Stern
2009-02-25 16:19 ` Linus Torvalds
2009-02-23 11:04 ` Ingo Molnar
2009-02-23 14:45 ` Rafael J. Wysocki
2009-02-23 15:06 ` Ingo Molnar
2009-02-23 21:59 ` Rafael J. Wysocki
2009-02-23 10:13 ` Benjamin Herrenschmidt
2009-02-23 8:36 ` Ingo Molnar
2009-02-23 11:29 ` Rafael J. Wysocki
2009-02-23 12:28 ` Ingo Molnar
2009-02-23 14:48 ` Rafael J. Wysocki
2009-02-23 20:49 ` Benjamin Herrenschmidt
2009-02-23 12:45 ` Ingo Molnar
2009-02-23 15:07 ` Rafael J. Wysocki
2009-02-23 15:52 ` Johannes Berg
2009-02-23 17:16 ` Ingo Molnar
2009-02-23 17:28 ` Linus Torvalds
2009-02-23 22:11 ` Rafael J. Wysocki
2009-02-23 22:11 ` Arve Hjønnevåg
2009-02-23 22:23 ` Rafael J. Wysocki
2009-02-23 22:44 ` Arve Hjønnevåg
2009-02-22 18:13 ` [RFC][PATCH 0/2] Rework disabling " Linus Torvalds
2009-02-22 18:18 ` Ingo Molnar
2009-02-22 18:25 ` Linus Torvalds
2009-02-22 18:35 ` Linus Torvalds
2009-02-22 22:37 ` Eric W. Biederman
2009-02-22 22:56 ` Benjamin Herrenschmidt
2009-02-22 23:02 ` Linus Torvalds
2009-03-01 22:21 ` [RFC][PATCH 0/4] " Rafael J. Wysocki
2009-03-01 22:24 ` [RFC][PATCH 1/4] PM: Rework handling of interrupts during suspend-resume (rev. 4) Rafael J. Wysocki
2009-03-02 23:01 ` Arve Hjønnevåg
2009-03-02 23:13 ` Rafael J. Wysocki
2009-03-02 23:18 ` Arve Hjønnevåg
2009-03-02 23:27 ` Rafael J. Wysocki
2009-03-03 22:56 ` Arve Hjønnevåg
2009-03-04 22:03 ` [Update, rev. 5] " Rafael J. Wysocki
2009-03-05 10:35 ` Ingo Molnar
2009-03-02 23:32 ` Linus Torvalds
2009-03-02 23:35 ` Linus Torvalds
2009-03-03 0:08 ` Arve Hjønnevåg
2009-03-03 8:41 ` Arve Hjønnevåg
2009-03-01 22:25 ` [RFC][PATCH 2/4] PM: Change suspend code ordering Rafael J. Wysocki
2009-03-02 20:48 ` Linus Torvalds
2009-03-02 22:02 ` Rafael J. Wysocki
2009-03-01 22:26 ` [RFC][PATCH 3/4] PM: Change hibernation " Rafael J. Wysocki
2009-03-01 22:27 ` [RFC][PATCH 4/4] kexec: Change kexec jump " Rafael J. Wysocki
2009-03-05 23:44 ` [RFC][PATCH 0/4] Rework disabling of interrupts during suspend-resume Linus Torvalds
2009-03-06 6:47 ` Sitsofe Wheeler
2009-03-06 10:19 ` Rafael J. Wysocki
2009-03-07 10:19 ` [RFC][PATCH][0/8] PM: Rework suspend-resume ordering to avoid problems with shared interrupts Rafael J. Wysocki
2009-03-07 10:20 ` [RFC][PATCH][1/8] PM: Rework handling of interrupts during suspend-resume (rev. 5) Rafael J. Wysocki
2009-03-07 16:51 ` [linux-pm] " Alan Stern
2009-03-07 17:56 ` Rafael J. Wysocki
2009-03-08 3:53 ` Alan Stern
2009-03-08 10:00 ` Rafael J. Wysocki
2009-03-08 12:37 ` Alan Stern
2009-03-08 17:20 ` Linus Torvalds
2009-03-08 20:40 ` Alan Stern
2009-03-08 21:37 ` Rafael J. Wysocki
2009-03-09 14:59 ` Linus Torvalds
2009-03-09 15:13 ` Alan Stern
2009-03-09 15:40 ` Linus Torvalds
2009-03-07 10:21 ` [RFC][PATCH][2/8] PM: Change suspend code ordering Rafael J. Wysocki
2009-03-07 10:22 ` [RFC][PATCH][3/8] PM: Change hibernation " Rafael J. Wysocki
2009-03-07 10:23 ` [RFC][PATCH][4/8] kexec: Change kexec jump " Rafael J. Wysocki
2009-03-07 10:24 ` [RFC][PATCH][5/8] PCI PM: Consistently use variable name "error" for pm call return values Rafael J. Wysocki
2009-03-07 10:25 ` [RFC][PATCH][6/8] PCI PM: Use pci_set_power_state during early resume Rafael J. Wysocki
2009-03-07 10:26 ` [RFC][PATCH][7/8] PCI PM: Move pci_restore_standard_config to pci-driver.c Rafael J. Wysocki
2009-03-07 10:27 ` [RFC][PATCH][8/8] PCI PM: Put devices into low power states during late suspend Rafael J. Wysocki
2009-03-08 19:28 ` [RFC][PATCH][0/8] PM: Rework suspend-resume ordering to avoid problems with shared interrupts Frans Pop
2009-03-08 20:50 ` Rafael J. Wysocki
2009-03-14 8:44 ` Frans Pop
2009-03-14 11:59 ` Rafael J. Wysocki [this message]
2009-03-14 14:11 ` Frans Pop
2009-03-14 22:31 ` Rafael J. Wysocki
2009-03-11 9:30 ` [PATCH 0/10] PM: Rework suspend-resume ordering to avoid problems with shared interrupts (updated) Rafael J. Wysocki
2009-03-11 9:36 ` [PATCH 1/10] PM: Rework handling of interrupts during suspend-resume (rev. 5) Rafael J. Wysocki
2009-03-11 10:33 ` Thomas Gleixner
2009-03-11 20:59 ` Rafael J. Wysocki
2009-03-11 21:42 ` Thomas Gleixner
2009-03-11 22:01 ` Rafael J. Wysocki
2009-03-11 22:45 ` Thomas Gleixner
2009-03-12 13:36 ` Rafael J. Wysocki
2009-03-12 21:43 ` [update, rev. 6] " Rafael J. Wysocki
2009-03-13 0:39 ` Ingo Molnar
2009-03-13 17:07 ` Rafael J. Wysocki
2009-03-13 7:15 ` Arve Hjønnevåg
2009-03-13 16:53 ` Rafael J. Wysocki
2009-03-13 19:55 ` Thomas Gleixner
2009-03-13 21:56 ` Rafael J. Wysocki
2009-03-14 7:31 ` Thomas Gleixner
2009-03-14 10:01 ` Rafael J. Wysocki
2009-03-14 0:04 ` Rafael J. Wysocki
2009-03-11 21:15 ` Rafael J. Wysocki
2009-03-11 21:35 ` Thomas Gleixner
2009-03-11 21:50 ` Rafael J. Wysocki
2009-03-11 21:53 ` Thomas Gleixner
2009-03-11 22:01 ` Linus Torvalds
2009-03-11 22:13 ` Rafael J. Wysocki
2009-03-11 22:25 ` Thomas Gleixner
2009-03-11 22:07 ` Rafael J. Wysocki
2009-03-11 9:37 ` [PATCH 2/10] PM: Change suspend code ordering Rafael J. Wysocki
2009-03-11 9:38 ` [PATCH 3/10] PM: Change hibernation " Rafael J. Wysocki
2009-03-11 9:39 ` [PATCH 4/10] kexec: Change kexec jump " Rafael J. Wysocki
2009-03-11 9:41 ` [PATCH 5/10] PCI PM: Consistently use variable name "error" for pm call return values Rafael J. Wysocki
2009-03-11 9:42 ` [PATCH 6/10] PCI PM: Use pci_set_power_state during early resume Rafael J. Wysocki
2009-03-11 9:47 ` [PATCH 7/10] PCI PM: Move pci_restore_standard_config to pci-driver.c Rafael J. Wysocki
2009-03-11 9:48 ` [PATCH 8/10] PCI PM: Put devices into low power states during late suspend (rev. 2) Rafael J. Wysocki
2009-03-11 9:55 ` [PATCH 9/10] PCI PM: Make pci_set_power_state() handle devices with no PM support Rafael J. Wysocki
2009-03-11 9:56 ` [PATCH 10/10] PCI PM: Restore config spaces of all devices during early resume Rafael J. Wysocki
2009-03-14 11:24 ` [PATCH 0/11] PM: Rework suspend-resume ordering to avoid problems with shared interrupts (updated 2x) Rafael J. Wysocki
2009-03-14 11:26 ` [PATCH 1/11] PM: Introduce functions for suspending and resuming device interrupts Rafael J. Wysocki
2009-03-14 11:27 ` [PATCH 2/11] PM: Rework handling of interrupts during suspend-resume Rafael J. Wysocki
2009-03-14 11:28 ` [PATCH 3/11] PM: Change suspend code ordering Rafael J. Wysocki
2009-03-14 11:28 ` [PATCH 4/11] PM: Change hibernation " Rafael J. Wysocki
2009-03-14 11:29 ` [PATCH 5/11] kexec: Change kexec jump " Rafael J. Wysocki
2009-03-14 11:30 ` [PATCH 6/11] PCI PM: Consistently use variable name "error" for pm call return values Rafael J. Wysocki
2009-03-14 11:31 ` [PATCH 7/11] PCI PM: Use pci_set_power_state during early resume Rafael J. Wysocki
2009-03-14 11:32 ` [PATCH 8/11] PCI PM: Move pci_restore_standard_config to pci-driver.c Rafael J. Wysocki
2009-03-14 11:32 ` [PATCH 9/11] PCI PM: Put devices into low power states during late suspend (rev. 2) Rafael J. Wysocki
2009-03-14 11:33 ` [PATCH 10/11] PCI PM: Make pci_set_power_state() handle devices with no PM support Rafael J. Wysocki
2009-03-14 11:34 ` [PATCH 11/11] PCI PM: Restore config spaces of all devices during early resume Rafael J. Wysocki
2009-03-14 11:43 ` [PATCH 0/11] PM: Rework suspend-resume ordering to avoid problems with shared interrupts (updated 2x) Ingo Molnar
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=200903141259.02164.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=elendil@planet.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--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
all inboxes | Powered by JetHome®