From: Alex Williamson <alex.williamson@redhat.com>
To: bhelgaas@google.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Alex Williamson <alex.williamson@redhat.com>,
Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 2/4] PCI: quirk AMD/ATI VGA cards to avoid PM reset
Date: Fri, 21 Nov 2014 11:24:14 -0700 [thread overview]
Message-ID: <20141121182414.26669.48397.stgit@gimli.home> (raw)
In-Reply-To: <20141121180322.26669.65689.stgit@gimli.home>
Some AMD/ATI GPUs report that they support PM reset (NoSoftRst-) but
initiating such a reset has no apparent affect on the device. The
monitor remains sync'd, the framebuffer contents are retained, etc.
Callers of pci_reset_function() don't necessarily have a way to
validate whether a reset was effective, so we really want to avoid
making use of a known non-effective reset. Returning an error in
such cases appears to be the better option. For users like vfio-pci,
this allows the driver to escalate to the bus reset interfaces.
If a device lives on the root bus, there's really no further
escalation path, so we exempt PM reset as potentially better than
nothing.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
---
drivers/pci/quirks.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 90acb32..561e10d 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3008,6 +3008,27 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK, 0x8169,
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, PCI_ANY_ID,
quirk_broken_intx_masking);
+static void quirk_no_pm_reset(struct pci_dev *dev)
+{
+ /*
+ * A non-effective PM reset may be better than nothing
+ * if we can't do a bus reset
+ */
+ if (!pci_is_root_bus(dev->bus))
+ dev->dev_flags |= PCI_DEV_FLAGS_NO_PM_RESET;
+}
+
+/*
+ * Some AMD/ATI GPUS (HD8570 - Oland) report supporting PM reset via D3->D0
+ * transition (NoSoftRst-). This reset mechanims seems to have no effect
+ * whatsoever on the device, even retaining the framebuffer contents and
+ * monitor sync. Advertising this support makes other layers, like VFIO
+ * assume pci_reset_function() is viable for this device. Mark it as
+ * unavailable to skip it when testing reset methods.
+ */
+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_ATI, PCI_ANY_ID,
+ PCI_CLASS_DISPLAY_VGA, 8, quirk_no_pm_reset);
+
#ifdef CONFIG_ACPI
/*
* Apple: Shutdown Cactus Ridge Thunderbolt controller.
next prev parent reply other threads:[~2014-11-21 18:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 18:24 [PATCH 0/4] PCI: Reset exclusions Alex Williamson
2014-11-21 18:24 ` [PATCH 1/4] PCI: Allow device quirks to exclude D3->D0 PM reset Alex Williamson
2014-11-21 18:24 ` Alex Williamson [this message]
2014-11-21 19:00 ` [PATCH 2/4] PCI: quirk AMD/ATI VGA cards to avoid " Deucher, Alexander
2014-11-21 18:24 ` [PATCH 3/4] PCI: Allow device quirks to exclude bus reset Alex Williamson
2014-11-21 18:24 ` [PATCH 4/4] PCI: quirk Atheros AR93xx to avoid " Alex Williamson
2014-12-26 7:56 ` Andreas Hartmann
2015-01-08 16:07 ` Bjorn Helgaas
2015-01-08 19:30 ` Alex Williamson
2015-01-08 23:10 ` Bjorn Helgaas
2015-01-12 15:20 ` Andreas Hartmann
2015-01-12 16:49 ` Alex Williamson
2015-01-12 19:15 ` Andreas Hartmann
2015-01-13 0:37 ` Bjorn Helgaas
2015-01-16 0:28 ` [PATCH 0/4] PCI: Reset exclusions Bjorn Helgaas
2015-01-16 16:15 ` Bjorn Helgaas
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=20141121182414.26669.48397.stgit@gimli.home \
--to=alex.williamson@redhat.com \
--cc=alexander.deucher@amd.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.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 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).