LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: bhelgaas@google.com, linux-pci@vger.kernel.org, airlied@linux.ie,
	alexander.deucher@amd.com, dri-devel@lists.freedesktop.org
Cc: alex.williamson@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] nouveau/radeon: Un-ignore hotplug on resume
Date: Tue, 24 Feb 2015 13:12:40 -0700	[thread overview]
Message-ID: <20150224201240.14443.6308.stgit@gimli.home> (raw)
In-Reply-To: <20150224200603.14443.68971.stgit@gimli.home>

Commit b440bde74f04 enabled drivers to be able to set an ignore
hotplug flag on the device and used it in the suspend routine for
nouveau and radeon to prevent hotplug when the device is powered off.
However, there was no undo function provided, so once set, the ignore
hotplug flag lives on for the life of the pci_dev.  I think the
intention was only to ignore hotplug across the power event for the
device, so we should be able to clear the flag on resume.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 drivers/gpu/drm/nouveau/nouveau_drm.c |    1 +
 drivers/gpu/drm/radeon/radeon_drv.c   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 8763deb..b168c3a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -749,6 +749,7 @@ nouveau_pmops_runtime_resume(struct device *dev)
 		return -EINVAL;
 
 	pci_set_power_state(pdev, PCI_D0);
+	pci_unignore_hotplug(pdev);
 	pci_restore_state(pdev);
 	ret = pci_enable_device(pdev);
 	if (ret)
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 5d684be..1c7c79b 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -472,6 +472,7 @@ static int radeon_pmops_runtime_resume(struct device *dev)
 	drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
 
 	pci_set_power_state(pdev, PCI_D0);
+	pci_unignore_hotplug(pdev);
 	pci_restore_state(pdev);
 	ret = pci_enable_device(pdev);
 	if (ret)


  parent reply	other threads:[~2015-02-24 20:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 20:12 [PATCH 0/2] PCI: pci_unignore_hotplug() Alex Williamson
2015-02-24 20:12 ` [PATCH 1/2] pci: Add reciprocal function for pci_ignore_hotplug() Alex Williamson
2015-02-24 20:12 ` Alex Williamson [this message]
2015-02-24 20:23 ` [PATCH 0/2] PCI: pci_unignore_hotplug() Alex Deucher
2015-03-06 18:49   ` Bjorn Helgaas
2015-03-06 22:12     ` Alex Deucher

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=20150224201240.14443.6308.stgit@gimli.home \
    --to=alex.williamson@redhat.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=bhelgaas@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --subject='Re: [PATCH 2/2] nouveau/radeon: Un-ignore hotplug on resume' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).