From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gaudenz Steinlin <gaudenz@soziologie.ch>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: commit "radeonfb: Fix resume from D3Cold on some platforms" breaks resume from RAM on PowerBook
Date: Wed, 11 Mar 2009 07:58:46 +1100 [thread overview]
Message-ID: <1236718726.7086.11.camel@pasglop> (raw)
In-Reply-To: <20090310150126.GB5633@soziologie.ch>
On Tue, 2009-03-10 at 16:01 +0100, Gaudenz Steinlin wrote:
> Hi Rafael
>
> On Tue, Mar 10, 2009 at 10:32:58AM +0100, Rafael J. Wysocki wrote:
> >
> > Gaudenz, I'd also like to know if the appended patch (on top of vanilla Linus'
> > tree) makes any different. Unfortunately, I haven't had the time to test it
> > myself yet.
>
> No, this patch does not make any difference.
What about the one I sent you that removes the early wakeup ?
Cheers,
Ben.
> Gaudenz
>
> >
> > Thanks,
> > Rafael
> >
> > ---
> > drivers/pci/pci-driver.c | 42 ++++++++++++++++++++++++++++++------------
> > 1 file changed, 30 insertions(+), 12 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
> > @@ -556,7 +556,7 @@ static int pci_pm_suspend_noirq(struct d
> > static int pci_pm_resume_noirq(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;
> >
> > pci_pm_default_resume_noirq(pci_dev);
> > @@ -564,8 +564,13 @@ static int pci_pm_resume_noirq(struct de
> > if (pci_has_legacy_pm_support(pci_dev))
> > return pci_legacy_resume_early(dev);
> >
> > - if (drv && drv->pm && drv->pm->resume_noirq)
> > - error = drv->pm->resume_noirq(dev);
> > + if (pm) {
> > + if (pm->resume_noirq)
> > + error = pm->resume_noirq(dev);
> > + } else {
> > + if (pci_is_bridge(pci_dev))
> > + pci_pm_reenable_device(pci_dev);
> > + }
> >
> > return error;
> > }
> > @@ -592,7 +597,8 @@ static int pci_pm_resume(struct device *
> > if (pm->resume)
> > error = pm->resume(dev);
> > } else {
> > - pci_pm_reenable_device(pci_dev);
> > + if (!pci_is_bridge(pci_dev))
> > + pci_pm_reenable_device(pci_dev);
> > }
> >
> > return 0;
> > @@ -662,7 +668,7 @@ static int pci_pm_freeze_noirq(struct de
> > static int pci_pm_thaw_noirq(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))
> > @@ -670,8 +676,13 @@ static int pci_pm_thaw_noirq(struct devi
> >
> > pci_update_current_state(pci_dev, PCI_D0);
> >
> > - if (drv && drv->pm && drv->pm->thaw_noirq)
> > - error = drv->pm->thaw_noirq(dev);
> > + if (pm) {
> > + if (pm->thaw_noirq)
> > + error = pm->thaw_noirq(dev);
> > + } else {
> > + if (pci_is_bridge(pci_dev))
> > + pci_pm_reenable_device(pci_dev);
> > + }
> >
> > return error;
> > }
> > @@ -689,7 +700,8 @@ static int pci_pm_thaw(struct device *de
> > if (pm->thaw)
> > error = pm->thaw(dev);
> > } else {
> > - pci_pm_reenable_device(pci_dev);
> > + if (!pci_is_bridge(pci_dev))
> > + pci_pm_reenable_device(pci_dev);
> > }
> >
> > return error;
> > @@ -744,7 +756,7 @@ static int pci_pm_poweroff_noirq(struct
> > static int pci_pm_restore_noirq(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;
> >
> > pci_pm_default_resume_noirq(pci_dev);
> > @@ -752,8 +764,13 @@ static int pci_pm_restore_noirq(struct d
> > if (pci_has_legacy_pm_support(pci_dev))
> > return pci_legacy_resume_early(dev);
> >
> > - if (drv && drv->pm && drv->pm->restore_noirq)
> > - error = drv->pm->restore_noirq(dev);
> > + if (pm) {
> > + if (pm->restore_noirq)
> > + error = pm->restore_noirq(dev);
> > + } else {
> > + if (pci_is_bridge(pci_dev))
> > + pci_pm_reenable_device(pci_dev);
> > + }
> >
> > return error;
> > }
> > @@ -780,7 +797,8 @@ static int pci_pm_restore(struct device
> > if (pm->restore)
> > error = pm->restore(dev);
> > } else {
> > - pci_pm_reenable_device(pci_dev);
> > + if (!pci_is_bridge(pci_dev))
> > + pci_pm_reenable_device(pci_dev);
> > }
> >
> > return error;
>
next prev parent reply other threads:[~2009-03-10 20:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-04 8:38 commit "radeonfb: Fix resume from D3Cold on some platforms" breaks resume from RAM on PowerBook Gaudenz Steinlin
2009-03-04 23:22 ` Benjamin Herrenschmidt
2009-03-05 10:25 ` Gaudenz Steinlin
2009-03-05 2:25 ` Benjamin Herrenschmidt
2009-03-05 12:59 ` Gaudenz Steinlin
2009-03-06 5:50 ` Benjamin Herrenschmidt
2009-03-06 9:09 ` Gaudenz Steinlin
2009-03-06 9:57 ` Benjamin Herrenschmidt
2009-03-06 11:41 ` Gaudenz Steinlin
2009-03-06 21:26 ` Benjamin Herrenschmidt
2009-03-09 22:37 ` Benjamin Herrenschmidt
2009-03-10 9:32 ` Rafael J. Wysocki
2009-03-10 15:01 ` Gaudenz Steinlin
2009-03-10 20:58 ` Benjamin Herrenschmidt [this message]
2009-03-10 21:27 ` Gaudenz Steinlin
2009-03-10 21:30 ` Gaudenz Steinlin
2009-03-10 22:07 ` Benjamin Herrenschmidt
2009-03-10 23:04 ` Rafael J. Wysocki
2009-03-11 0:34 ` Benjamin Herrenschmidt
2009-03-09 22:49 ` Benjamin Herrenschmidt
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=1236718726.7086.11.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=akpm@linux-foundation.org \
--cc=gaudenz@soziologie.ch \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/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