public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: linux-pm@lists.linux-foundation.org
Cc: Greg KH <greg@kroah.com>, Zhenyu Wang <zhenyuw@linux.intel.com>,
	Alek Du <alek.du@intel.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Dave Airlie <airlied@redhat.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: Suspend problems in 2.6.31-rc6
Date: Thu, 20 Aug 2009 17:41:06 +0200	[thread overview]
Message-ID: <200908201741.06423.rjw@sisk.pl> (raw)
In-Reply-To: <200908192322.25261.rjw@sisk.pl>

On Wednesday 19 August 2009, Rafael J. Wysocki wrote:
> On Wednesday 19 August 2009, Alan Stern wrote:
> > On Wed, 19 Aug 2009, Rafael J. Wysocki wrote:
> > 
> > > > Commenting out the second call to pci_restore_state() apparently fixes 
> > > > the problem.  I have no idea whether it's the right thing to do, 
> > > > though.
> > > 
> > > It is.  The PCI core have restored the PCI config already anyway at the early
> > > resume stage.
> > > 
> > > I think the first pci_restore_state() could be dropped from there as well.
> > 
> > What about the other AGP drivers in drivers/char/agp?  Looks like their
> > suspend and resume routines could all use some updating.
> 
> As well as many other drivers. :-)
> 
> Usually, however, restoring the PCI config space twice doesn't hurt, although
> it evidently does hurt on your system.
> 
> Hm, there's a patch that should help here I think.  Can you please test
> this one: http://patchwork.kernel.org/patch/40062/ ?

Quoting the patch for completness.

---
From: Alek Du <alek.du@intel.com>
Subject: [PATCH] pci: check saved state before restore

Without the check, the config space may be filled with zeros. Though
the driver should try to avoid call restoring before saving, but the
pci layer also should check this.

Also removed the existing check in pci_restore_standard_config.

Signed-off-by: Alek Du <alek.du@intel.com>
---
 drivers/pci/pci-driver.c |    2 +-
 drivers/pci/pci.c        |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index d76c4c8..f99bc7f 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -508,7 +508,7 @@ static int pci_restore_standard_config(struct pci_dev *pci_dev)
 			return error;
 	}
 
-	return pci_dev->state_saved ? pci_restore_state(pci_dev) : 0;
+	return pci_restore_state(pci_dev);
 }
 
 static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index dbd0f94..7b70312 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -846,6 +846,8 @@ pci_restore_state(struct pci_dev *dev)
 	int i;
 	u32 val;
 
+	if (!dev->state_saved)
+		return 0;
 	/* PCI Express register must be restored first */
 	pci_restore_pcie_state(dev);
 
-- 

  parent reply	other threads:[~2009-08-20 15:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 15:11 Suspend problems in 2.6.31-rc6 Alan Stern
2009-08-17 18:28 ` Rafael J. Wysocki
2009-08-17 20:53   ` Alan Stern
2009-08-17 21:14     ` Greg KH
2009-08-17 21:15       ` Greg KH
2009-08-17 21:31         ` Jiri Slaby
2009-08-17 21:33           ` Jiri Slaby
2009-08-17 21:21     ` Rafael J. Wysocki
2009-08-17 21:50       ` Alan Stern
2009-08-18 16:07     ` Alan Stern
2009-08-18 23:22       ` Rafael J. Wysocki
2009-08-19  2:01         ` Zhenyu Wang
2009-08-19 14:42           ` Alan Stern
2009-08-20  1:05             ` Zhenyu Wang
2009-08-20 14:03               ` Alan Stern
2009-08-21  1:17                 ` Zhenyu Wang
2009-08-20 15:34               ` Rafael J. Wysocki
2009-08-19 14:26         ` Alan Stern
2009-08-19 21:22           ` Rafael J. Wysocki
2009-08-20 15:17             ` Alan Stern
2009-08-20 16:17               ` Rafael J. Wysocki
2009-08-21  1:21               ` Zhenyu Wang
2009-08-21  3:13                 ` Zhenyu Wang
2009-08-21 14:32                   ` Alan Stern
2009-08-21 17:01                     ` Rafael J. Wysocki
2009-08-24  2:34                       ` Zhenyu Wang
2009-08-24 18:55                         ` Rafael J. Wysocki
2009-08-25  0:59                         ` Alan Stern
2009-08-27 14:51                         ` Alan Stern
2009-08-27 16:18                           ` Jesse Barnes
2009-08-24  1:30                     ` Zhenyu Wang
2009-08-20 15:41             ` Rafael J. Wysocki [this message]
2009-08-20 16:05               ` Jesse Barnes

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=200908201741.06423.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=airlied@redhat.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=alek.du@intel.com \
    --cc=greg@kroah.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=zhenyuw@linux.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