From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Greg KH <greg@kroah.com>, Jesse Barnes <jbarnes@virtuousgeek.org>,
Alek Du <alek.du@intel.com>, Dave Airlie <airlied@redhat.com>,
Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: Suspend problems in 2.6.31-rc6
Date: Mon, 24 Aug 2009 20:55:49 +0200 [thread overview]
Message-ID: <200908242055.49912.rjw@sisk.pl> (raw)
In-Reply-To: <20090824023423.GC4624@zhen-devel.sh.intel.com>
On Monday 24 August 2009, Zhenyu Wang wrote:
> On 2009.08.21 19:01:06 +0200, Rafael J. Wysocki wrote:
> > Yes. Moreover, it doesn't need to be restored at that point, because it has
> > already been restored earlier by the PCI bus type code.
>
> true.
>
> >
> > So, Zhenyu, it is completely unnecessary to call pci_restore_state() from
> > a driver's ->resume() routine, because the PCI bus type driver has
> > already called it in its ->resume_noirq(). And please note that
> > pci_pm_default_resume_noirq() clears state_saved, which is why the Alek's
> > patch helps.
> >
> > Without the Alek's patch on the Alan's system the config registers of both
> > PCI devices are restored twice, first by the PCI bus type at the "noirq" stage
> > and next by the driver. The Alek's patch turns the second restorations into
> > NOPs, which is fine, because they are unnecessary in general and they break
> > things on the Alan's system.
> >
>
> yeah, Alex's patch is ok in general, and Alan's problem seems specific on 845G.
> So the origin restore order issue for us seems gone with pci layer early resume,
> we could remove the restore in intel_agp and drm/i915, although Alex's patch makes
> them noop.
>
> How about this one? Alan, could you help to test this with drm/i915 module loaded?
>
> thanks.
>
> From 7ab123a67e3ab3f31051d95e74362ae711e0657e Mon Sep 17 00:00:00 2001
> From: Zhenyu Wang <zhenyuw@linux.intel.com>
> Date: Mon, 24 Aug 2009 10:29:07 +0800
> Subject: [PATCH] agp/intel: remove restore in resume
>
> As earlier pci driver resume has already restored space for
> host bridge and graphics device, don't need to restore it
> again which might cause problem on some chips, e.g 845G tested
> by Alan.
>
> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
> ---
> drivers/char/agp/intel-agp.c | 9 ---------
> drivers/gpu/drm/i915/i915_drv.c | 1 -
> 2 files changed, 0 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
> index 8c9d50d..ed43ab2 100644
> --- a/drivers/char/agp/intel-agp.c
> +++ b/drivers/char/agp/intel-agp.c
> @@ -2308,15 +2308,6 @@ static int agp_intel_resume(struct pci_dev *pdev)
> struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
> int ret_val;
>
> - pci_restore_state(pdev);
> -
> - /* We should restore our graphics device's config space,
> - * as host bridge (00:00) resumes before graphics device (02:00),
> - * then our access to its pci space can work right.
> - */
> - if (intel_private.pcidev)
> - pci_restore_state(intel_private.pcidev);
> -
> if (bridge->driver == &intel_generic_driver)
> intel_configure();
> else if (bridge->driver == &intel_850_driver)
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index fc4b68a..645f298 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -95,7 +95,6 @@ static int i915_resume(struct drm_device *dev)
> int ret = 0;
>
> pci_set_power_state(dev->pdev, PCI_D0);
> - pci_restore_state(dev->pdev);
You can also drop the pci_set_power_state() above, the device is already in D0
at this point.
> if (pci_enable_device(dev->pdev))
> return -1;
> pci_set_master(dev->pdev);
>
Thanks,
Rafael
next prev parent reply other threads:[~2009-08-24 18:55 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 [this message]
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
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=200908242055.49912.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