From: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>
To: Eric Sesterhenn <snakebyte-Mmb7MZpHnFY@public.gmane.org>
Cc: linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
vandrove-hnqZr3NxcozrBKCeMvbIDA@public.gmane.org,
Kernel Testers
<kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [linux-pm] Suspend regression, hang after matroxfb
Date: Fri, 30 Jan 2009 23:59:17 +0100 [thread overview]
Message-ID: <200901302359.18309.rjw@sisk.pl> (raw)
In-Reply-To: <20090130223144.GD13207@alice>
On Friday 30 January 2009, Eric Sesterhenn wrote:
> * Rafael J. Wysocki (rjw-KKrjLPT3xs0@public.gmane.org) wrote:
> > On Friday 30 January 2009, Eric Sesterhenn wrote:
> > > * Rafael J. Wysocki (rjw-KKrjLPT3xs0@public.gmane.org) wrote:
> > > > On Friday 30 January 2009, Eric Sesterhenn wrote:
> > > > > * Rafael J. Wysocki (rjw-KKrjLPT3xs0@public.gmane.org) wrote:
> > > > > > On Thursday 29 January 2009, Eric Sesterhenn wrote:
> > > > > > > hi,
> > > > > > >
> > > > > > > on this box standby worked with 2.6.28, but is broken with 2.6.29-rc3.
> > > > > > >
> > > > > > > Dmesg of startup
> > > > > > > http://www.cccmz.de/~snakebyte/200.log
> > > > > > > .config
> > > > > > > http://www.cccmz.de/~snakebyte/config_200
> > > > > > >
> > > > > > > When testing the devices
> > > > > > >
> > > > > > > root@computer-desktop:/sys/power# echo devices > pm_test
> > > > > >
> > > > > > What happens if you replace 'devices' with 'core' ?
> > > > >
> > > > > no change, it hangs after matroxfb
> > > > >
> > > > > root@computer-desktop:/sys/power# echo core > pm_test
> > > > > root@computer-desktop:/sys/power# echo standby > state
> > > > >
> > > > [--snip--]
> > > > >
> > > > > > If the same, what happens without the matroxfb driver?
> > > > >
> > > > > It gets a bit further, suspend seems to complete,
> > > > > but hangs during resume
> > > >
> > > > Please check if the appended patch helps.
> > >
> > > It does help in both cases (with matroxfb enabled and disabled)
> > > thanks.
> >
> > What machine is that?
>
> I mean the driver enabled in .config.
>
> box is one of my kernel testgrounds running ubuntu intrepid,
> for .config and dmesg see the links above
Ah, so this is just a desktop. OK, thanks.
I have prepared a final fix that I'd like to push for merging. Can you please
test it (it won't apply cleanly to the current -git, but should be easy to fix
up)?
Rafael
---
From: Rafael J. Wysocki <rjw-KKrjLPT3xs0@public.gmane.org>
Subject: PCI PM: Fix handling of devices without drivers
Suspend to RAM is reported to break on some machines as a result of
attempting to put one of driverless PCI devices into a low power
state. Avoid that by not attepmting to power manage driverless
devices during suspend.
Fix up pci_pm_poweroff() after a previous incomplete fix for the same
thing during hibernation.
Signed-off-by: Rafael J. Wysocki <rjw-KKrjLPT3xs0@public.gmane.org>
---
drivers/pci/pci-driver.c | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
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
@@ -445,11 +445,11 @@ static void pci_pm_default_suspend_gener
pci_save_state(pci_dev);
}
-static void pci_pm_default_suspend(struct pci_dev *pci_dev)
+static void pci_pm_default_suspend(struct pci_dev *pci_dev, bool prepare)
{
pci_pm_default_suspend_generic(pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (prepare && !pci_is_bridge(pci_dev))
pci_prepare_to_sleep(pci_dev);
pci_fixup_device(pci_fixup_suspend, pci_dev);
@@ -497,19 +497,19 @@ static void pci_pm_complete(struct devic
static int pci_pm_suspend(struct device *dev)
{
struct pci_dev *pci_dev = to_pci_dev(dev);
- struct device_driver *drv = dev->driver;
+ struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
int error = 0;
if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_suspend(dev, PMSG_SUSPEND);
- if (drv && drv->pm && drv->pm->suspend) {
- error = drv->pm->suspend(dev);
- suspend_report_result(drv->pm->suspend, error);
+ if (pm && pm->suspend) {
+ error = pm->suspend(dev);
+ suspend_report_result(pm->suspend, error);
}
if (!error)
- pci_pm_default_suspend(pci_dev);
+ pci_pm_default_suspend(pci_dev, !!pm);
return error;
}
@@ -663,22 +663,19 @@ static int pci_pm_thaw(struct device *de
static int pci_pm_poweroff(struct device *dev)
{
struct pci_dev *pci_dev = to_pci_dev(dev);
- struct device_driver *drv = dev->driver;
+ struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
int error = 0;
if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_suspend(dev, PMSG_HIBERNATE);
- if (!drv || !drv->pm)
- return 0;
-
- if (drv->pm->poweroff) {
- error = drv->pm->poweroff(dev);
- suspend_report_result(drv->pm->poweroff, error);
+ if (pm && pm->poweroff) {
+ error = pm->poweroff(dev);
+ suspend_report_result(pm->poweroff, error);
}
if (!error)
- pci_pm_default_suspend(pci_dev);
+ pci_pm_default_suspend(pci_dev, !!pm);
return error;
}
next prev parent reply other threads:[~2009-01-30 22:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-29 12:58 Suspend regression, hang after matroxfb Eric Sesterhenn
2009-01-29 22:12 ` [linux-pm] " Rafael J. Wysocki
2009-01-30 12:46 ` Eric Sesterhenn
[not found] ` <200901292312.44884.rjw-KKrjLPT3xs0@public.gmane.org>
2009-01-30 12:46 ` [linux-pm] " Eric Sesterhenn
2009-01-30 21:15 ` Rafael J. Wysocki
2009-01-30 21:15 ` [linux-pm] " Rafael J. Wysocki
2009-01-30 22:03 ` Rafael J. Wysocki
[not found] ` <200901302215.28057.rjw-KKrjLPT3xs0@public.gmane.org>
2009-01-30 22:03 ` [linux-pm] " Rafael J. Wysocki
2009-01-30 22:09 ` Eric Sesterhenn
[not found] ` <200901302303.23143.rjw-KKrjLPT3xs0@public.gmane.org>
2009-01-30 22:09 ` [linux-pm] " Eric Sesterhenn
2009-01-30 22:06 ` Eric Sesterhenn
2009-01-30 22:27 ` Rafael J. Wysocki
[not found] ` <200901302327.50887.rjw-KKrjLPT3xs0@public.gmane.org>
2009-01-30 22:31 ` Eric Sesterhenn
2009-01-30 22:59 ` Rafael J. Wysocki
2009-01-30 22:59 ` Rafael J. Wysocki [this message]
[not found] ` <200901302359.18309.rjw-KKrjLPT3xs0@public.gmane.org>
2009-01-30 23:21 ` [linux-pm] " Alan Stern
2009-01-30 23:40 ` Rafael J. Wysocki
[not found] ` <Pine.LNX.4.44L0.0901301818400.2785-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-01-30 23:40 ` [linux-pm] " Rafael J. Wysocki
2009-01-30 23:36 ` Eric Sesterhenn
2009-01-30 23:21 ` Alan Stern
2009-01-30 23:36 ` Eric Sesterhenn
2009-01-30 22:31 ` Eric Sesterhenn
2009-01-30 22:27 ` Rafael J. Wysocki
2009-01-30 22:06 ` Eric Sesterhenn
2009-01-29 22:12 ` 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=200901302359.18309.rjw@sisk.pl \
--to=rjw-kkrjlpt3xs0@public.gmane.org \
--cc=kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=snakebyte-Mmb7MZpHnFY@public.gmane.org \
--cc=vandrove-hnqZr3NxcozrBKCeMvbIDA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.