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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
---
 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 e8119bcbf178..401eb6c71ae1 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -898,11 +898,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.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux