[PATCH 02/33] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations

Chris Wilson chris at chris-wilson.co.uk
Mon Nov 26 11:30:45 UTC 2018


When the system is being shutdown, we no longer care about the results
of outstanding GPU operations, and so we can cancel them to speed up the
reboot. This helps most if we happen to be stuck waiting for a timeout
to declare the GPU hung.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_pci.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 1b81d7cb209e..cf2396856d38 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -763,11 +763,25 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	return 0;
 }
 
+static void i915_pci_shutdown(struct pci_dev *pdev)
+{
+	struct drm_i915_private *i915;
+
+	i915 = pci_get_drvdata(pdev);
+	if (!i915) /* driver load aborted? */
+		return;
+
+	/* Cancel any outstanding rendering */
+	if (READ_ONCE(i915->gt.awake))
+		i915_gem_set_wedged(i915);
+}
+
 static struct pci_driver i915_pci_driver = {
 	.name = DRIVER_NAME,
 	.id_table = pciidlist,
 	.probe = i915_pci_probe,
 	.remove = i915_pci_remove,
+	.shutdown = i915_pci_shutdown,
 	.driver.pm = &i915_pm_ops,
 };
 
-- 
2.20.0.rc1



More information about the Intel-gfx-trybot mailing list