All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations
@ 2018-11-25 17:24 Chris Wilson
  2018-11-25 17:24 ` [PATCH 2/2] drm/i915: Disable active links before rebooting Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chris Wilson @ 2018-11-25 17:24 UTC (permalink / raw)
  To: intel-gfx

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@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.19.2

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] drm/i915: Disable active links before rebooting
  2018-11-25 17:24 [PATCH 1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations Chris Wilson
@ 2018-11-25 17:24 ` Chris Wilson
  2018-11-26 12:55   ` Jani Nikula
  2018-11-26 10:02 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations Patchwork
  2018-11-26 11:17 ` ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2018-11-25 17:24 UTC (permalink / raw)
  To: intel-gfx

Certain monitors, e.g. Dell, do not like it when we reboot with an
active link, leaving them in a confused state where they refuse to
renegotiate the link after the reboot. If we hook into the reboot
notifier, we can switch off any active link before rebooting, leaving
everything in a consistent, hopefully happy, state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pci.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index cf2396856d38..e4248adb2032 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -26,6 +26,8 @@
 #include <linux/vgaarb.h>
 #include <linux/vga_switcheroo.h>
 
+#include <drm/drm_atomic_helper.h>
+
 #include "i915_drv.h"
 #include "i915_selftest.h"
 
@@ -774,6 +776,9 @@ static void i915_pci_shutdown(struct pci_dev *pdev)
 	/* Cancel any outstanding rendering */
 	if (READ_ONCE(i915->gt.awake))
 		i915_gem_set_wedged(i915);
+
+	/* Disable active links to avoid confusing certain (Dell) monitors */
+	drm_atomic_helper_shutdown(&i915->drm);
 }
 
 static struct pci_driver i915_pci_driver = {
-- 
2.19.2

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations
  2018-11-25 17:24 [PATCH 1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations Chris Wilson
  2018-11-25 17:24 ` [PATCH 2/2] drm/i915: Disable active links before rebooting Chris Wilson
@ 2018-11-26 10:02 ` Patchwork
  2018-11-26 11:17 ` ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-11-26 10:02 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations
URL   : https://patchwork.freedesktop.org/series/52984/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_5199 -> Patchwork_10901 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/52984/revisions/1/mbox/

== Known issues ==

  Here are the changes found in Patchwork_10901 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_ctx_create@basic-files:
      {fi-icl-u3}:        PASS -> DMESG-WARN (fdo#107724)
      fi-icl-u2:          PASS -> DMESG-WARN (fdo#107724)
      fi-bsw-kefka:       PASS -> FAIL (fdo#108656)

    igt@i915_selftest@live_execlists:
      fi-apl-guc:         PASS -> INCOMPLETE (fdo#103927, fdo#108622)

    igt@kms_frontbuffer_tracking@basic:
      {fi-icl-u3}:        PASS -> FAIL (fdo#103167)

    igt@kms_pipe_crc_basic@read-crc-pipe-b:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s3:
      fi-icl-u2:          DMESG-WARN (fdo#107724) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       DMESG-WARN (fdo#102614) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-a:
      fi-byt-clapper:     FAIL (fdo#107362) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-byt-clapper:     FAIL (fdo#103191, fdo#107362) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
  fdo#108622 https://bugs.freedesktop.org/show_bug.cgi?id=108622
  fdo#108656 https://bugs.freedesktop.org/show_bug.cgi?id=108656


== Participating hosts (44 -> 40) ==

  Missing    (4): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_5199 -> Patchwork_10901

  CI_DRM_5199: d04475fd1ae06cbe402329cbd715920c0c5626e8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4726: f48bebb15d3d2c1e6382e1f11b0aeac06fae6082 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10901: c349ef544719f887db85a9a96a93f206e62a4b4b @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

c349ef544719 drm/i915: Disable active links before rebooting
f615c77694c9 drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10901/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations
  2018-11-25 17:24 [PATCH 1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations Chris Wilson
  2018-11-25 17:24 ` [PATCH 2/2] drm/i915: Disable active links before rebooting Chris Wilson
  2018-11-26 10:02 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations Patchwork
@ 2018-11-26 11:17 ` Patchwork
  2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-11-26 11:17 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations
URL   : https://patchwork.freedesktop.org/series/52984/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_5199_full -> Patchwork_10901_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_10901_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10901_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10901_full:

  === IGT changes ===

    ==== Possible regressions ====

    igt@pm_rpm@dpms-lpsp:
      {shard-iclb}:       PASS -> INCOMPLETE

    
    ==== Warnings ====

    igt@pm_rc6_residency@rc6-accuracy:
      shard-snb:          PASS -> SKIP

    
== Known issues ==

  Here are the changes found in Patchwork_10901_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_tiled_swapping@non-threaded:
      shard-skl:          PASS -> DMESG-WARN (fdo#108686)

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#107956)
      shard-kbl:          NOTRUN -> DMESG-WARN (fdo#107956)

    igt@kms_cursor_crc@cursor-256x85-sliding:
      shard-skl:          PASS -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-64x64-dpms:
      shard-apl:          PASS -> FAIL (fdo#103232)

    igt@kms_draw_crc@draw-method-xrgb2101010-blt-xtiled:
      shard-skl:          NOTRUN -> FAIL (fdo#103184)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
      shard-apl:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-apl:          PASS -> FAIL (fdo#105682, fdo#103167)

    igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-mmap-cpu:
      shard-skl:          PASS -> FAIL (fdo#105682, fdo#103167)

    igt@kms_frontbuffer_tracking@fbcpsr-1p-rte:
      shard-skl:          PASS -> FAIL (fdo#105682)

    igt@kms_frontbuffer_tracking@fbcpsr-stridechange:
      shard-skl:          NOTRUN -> FAIL (fdo#105683)

    igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-render:
      shard-skl:          PASS -> FAIL (fdo#103167) +2

    igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-mmap-gtt:
      shard-skl:          NOTRUN -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-blt:
      {shard-iclb}:       PASS -> FAIL (fdo#103167) +5

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      {shard-iclb}:       PASS -> FAIL (fdo#103166) +1

    igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
      shard-skl:          NOTRUN -> FAIL (fdo#108145)

    igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
      shard-skl:          PASS -> FAIL (fdo#107815, fdo#108145)

    igt@kms_psr@suspend:
      shard-skl:          PASS -> INCOMPLETE (fdo#107773)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)

    igt@kms_sysfs_edid_timing:
      shard-skl:          NOTRUN -> FAIL (fdo#100047)

    igt@pm_rpm@fences:
      {shard-iclb}:       PASS -> DMESG-WARN (fdo#107724) +2

    igt@pm_rpm@gem-execbuf-stress-pc8:
      shard-skl:          SKIP -> INCOMPLETE (fdo#107807)

    igt@pm_rpm@i2c:
      shard-skl:          PASS -> INCOMPLETE (fdo#107807)

    igt@pm_rpm@modeset-lpsp-stress-no-wait:
      {shard-iclb}:       PASS -> DMESG-WARN (fdo#108654)

    
    ==== Possible fixes ====

    igt@gem_ppgtt@blt-vs-render-ctxn:
      shard-kbl:          INCOMPLETE (fdo#106023, fdo#106887, fdo#103665) -> PASS

    igt@kms_busy@extended-modeset-hang-newfb-render-a:
      shard-hsw:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
      shard-kbl:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_cursor_crc@cursor-64x21-random:
      shard-apl:          FAIL (fdo#103232) -> PASS

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-skl:          FAIL (fdo#105363) -> PASS

    igt@kms_flip@plain-flip-ts-check:
      shard-skl:          FAIL (fdo#100368) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
      {shard-iclb}:       FAIL (fdo#103167) -> PASS +2

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-glk:          FAIL (fdo#103166) -> PASS

    igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
      shard-apl:          FAIL (fdo#103166) -> PASS

    igt@kms_setmode@basic:
      shard-kbl:          FAIL (fdo#99912) -> PASS

    igt@pm_rpm@basic-rte:
      {shard-iclb}:       DMESG-WARN (fdo#107724) -> PASS

    igt@pm_rpm@gem-pread:
      shard-skl:          INCOMPLETE (fdo#107807) -> PASS +1

    igt@pm_rpm@universal-planes:
      {shard-iclb}:       INCOMPLETE -> PASS

    
    ==== Warnings ====

    igt@i915_suspend@shrink:
      shard-skl:          INCOMPLETE (fdo#106886) -> DMESG-WARN (fdo#108784)

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
  fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
  fdo#105683 https://bugs.freedesktop.org/show_bug.cgi?id=105683
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887
  fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
  fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
  fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
  fdo#107815 https://bugs.freedesktop.org/show_bug.cgi?id=107815
  fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  fdo#108654 https://bugs.freedesktop.org/show_bug.cgi?id=108654
  fdo#108686 https://bugs.freedesktop.org/show_bug.cgi?id=108686
  fdo#108784 https://bugs.freedesktop.org/show_bug.cgi?id=108784
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (7 -> 7) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_5199 -> Patchwork_10901

  CI_DRM_5199: d04475fd1ae06cbe402329cbd715920c0c5626e8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4726: f48bebb15d3d2c1e6382e1f11b0aeac06fae6082 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10901: c349ef544719f887db85a9a96a93f206e62a4b4b @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10901/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/i915: Disable active links before rebooting
  2018-11-25 17:24 ` [PATCH 2/2] drm/i915: Disable active links before rebooting Chris Wilson
@ 2018-11-26 12:55   ` Jani Nikula
  2018-11-27 13:07     ` Ville Syrjälä
  0 siblings, 1 reply; 7+ messages in thread
From: Jani Nikula @ 2018-11-26 12:55 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Sun, 25 Nov 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Certain monitors, e.g. Dell, do not like it when we reboot with an
> active link, leaving them in a confused state where they refuse to
> renegotiate the link after the reboot. If we hook into the reboot
> notifier, we can switch off any active link before rebooting, leaving
> everything in a consistent, hopefully happy, state.

Hmm, we already have this overly specific reboot notifier in intel_dp.c
for vlv/chv. I guess we should generalize these somehow.

BR,
Jani.


>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_pci.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index cf2396856d38..e4248adb2032 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -26,6 +26,8 @@
>  #include <linux/vgaarb.h>
>  #include <linux/vga_switcheroo.h>
>  
> +#include <drm/drm_atomic_helper.h>
> +
>  #include "i915_drv.h"
>  #include "i915_selftest.h"
>  
> @@ -774,6 +776,9 @@ static void i915_pci_shutdown(struct pci_dev *pdev)
>  	/* Cancel any outstanding rendering */
>  	if (READ_ONCE(i915->gt.awake))
>  		i915_gem_set_wedged(i915);
> +
> +	/* Disable active links to avoid confusing certain (Dell) monitors */
> +	drm_atomic_helper_shutdown(&i915->drm);
>  }
>  
>  static struct pci_driver i915_pci_driver = {

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/i915: Disable active links before rebooting
  2018-11-26 12:55   ` Jani Nikula
@ 2018-11-27 13:07     ` Ville Syrjälä
  0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2018-11-27 13:07 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Mon, Nov 26, 2018 at 02:55:54PM +0200, Jani Nikula wrote:
> On Sun, 25 Nov 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Certain monitors, e.g. Dell, do not like it when we reboot with an
> > active link, leaving them in a confused state where they refuse to
> > renegotiate the link after the reboot. If we hook into the reboot
> > notifier, we can switch off any active link before rebooting, leaving
> > everything in a consistent, hopefully happy, state.
> 
> Hmm, we already have this overly specific reboot notifier in intel_dp.c
> for vlv/chv. I guess we should generalize these somehow.

The earlier discussion we had on this topic:
https://lists.freedesktop.org/archives/intel-gfx/2016-August/102461.html
https://lists.freedesktop.org/archives/intel-gfx/2016-August/103145.html

Anyone have time to resurrect/rework that? I guess simply ignoring
the hpd issues for now is better than ignoring the entire problem.

> 
> BR,
> Jani.
> 
> 
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_pci.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > index cf2396856d38..e4248adb2032 100644
> > --- a/drivers/gpu/drm/i915/i915_pci.c
> > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > @@ -26,6 +26,8 @@
> >  #include <linux/vgaarb.h>
> >  #include <linux/vga_switcheroo.h>
> >  
> > +#include <drm/drm_atomic_helper.h>
> > +
> >  #include "i915_drv.h"
> >  #include "i915_selftest.h"
> >  
> > @@ -774,6 +776,9 @@ static void i915_pci_shutdown(struct pci_dev *pdev)
> >  	/* Cancel any outstanding rendering */
> >  	if (READ_ONCE(i915->gt.awake))
> >  		i915_gem_set_wedged(i915);
> > +
> > +	/* Disable active links to avoid confusing certain (Dell) monitors */
> > +	drm_atomic_helper_shutdown(&i915->drm);
> >  }
> >  
> >  static struct pci_driver i915_pci_driver = {
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations
  2019-05-15 15:00 Shutdown hooks Chris Wilson
@ 2019-05-15 15:00 ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-05-15 15:00 UTC (permalink / raw)
  To: intel-gfx; +Cc: janusz.krzysztofik

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@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 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-15 15:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-25 17:24 [PATCH 1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations Chris Wilson
2018-11-25 17:24 ` [PATCH 2/2] drm/i915: Disable active links before rebooting Chris Wilson
2018-11-26 12:55   ` Jani Nikula
2018-11-27 13:07     ` Ville Syrjälä
2018-11-26 10:02 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations Patchwork
2018-11-26 11:17 ` ✓ Fi.CI.IGT: " Patchwork
2019-05-15 15:00 Shutdown hooks Chris Wilson
2019-05-15 15:00 ` [PATCH 1/2] drm/i915: Hook into the reboot notifier to cancel outstanding GPU operations Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.