Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/selftests: Hold rpm for unparking
@ 2018-08-09  6:34 Chris Wilson
  2018-08-09  7:12 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Chris Wilson @ 2018-08-09  6:34 UTC (permalink / raw)
  To: intel-gfx; +Cc: Matthew Auld

The call to i915_gem_unpark() checks that we hold a rpm wakeref before
taking a long term wakeref for i915->gt.awake. We should therefore make
sure we do hold the wakeref when directly calling unpark to disable
the retire worker.

Fixes: 932cac10c8fb ("drm/i915/selftests: Prevent background reaping of active objects")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
---
 .../gpu/drm/i915/selftests/i915_gem_object.c  | 20 +++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
index d9eca1b02aee..6d3516d5bff9 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
@@ -499,6 +499,19 @@ static bool assert_mmap_offset(struct drm_i915_private *i915,
 	return err == expected;
 }
 
+static void disable_retire_worker(struct drm_i915_private *i915)
+{
+	mutex_lock(&i915->drm.struct_mutex);
+	if (!i915->gt.active_requests++) {
+		intel_runtime_pm_get(i915);
+		i915_gem_unpark(i915);
+		intel_runtime_pm_put(i915);
+	}
+	mutex_unlock(&i915->drm.struct_mutex);
+	cancel_delayed_work_sync(&i915->gt.retire_work);
+	cancel_delayed_work_sync(&i915->gt.idle_work);
+}
+
 static int igt_mmap_offset_exhaustion(void *arg)
 {
 	struct drm_i915_private *i915 = arg;
@@ -509,12 +522,7 @@ static int igt_mmap_offset_exhaustion(void *arg)
 	int loop, err;
 
 	/* Disable background reaper */
-	mutex_lock(&i915->drm.struct_mutex);
-	if (!i915->gt.active_requests++)
-		i915_gem_unpark(i915);
-	mutex_unlock(&i915->drm.struct_mutex);
-	cancel_delayed_work_sync(&i915->gt.retire_work);
-	cancel_delayed_work_sync(&i915->gt.idle_work);
+	disable_retire_worker(i915);
 	GEM_BUG_ON(!i915->gt.awake);
 
 	/* Trim the device mmap space to only a page */
-- 
2.18.0

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

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

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Hold rpm for unparking
  2018-08-09  6:34 [PATCH] drm/i915/selftests: Hold rpm for unparking Chris Wilson
@ 2018-08-09  7:12 ` Patchwork
  2018-08-09  9:03 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-08-09  7:12 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Hold rpm for unparking
URL   : https://patchwork.freedesktop.org/series/47930/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4636 -> Patchwork_9897 =

== Summary - SUCCESS ==

  No regressions found.

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

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      fi-skl-guc:         PASS -> DMESG-FAIL (fdo#107174)

    igt@drv_selftest@live_workarounds:
      {fi-bsw-kefka}:     PASS -> DMESG-FAIL (fdo#107292)
      fi-whl-u:           PASS -> DMESG-FAIL (fdo#107292)

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

    
    ==== Warnings ====

    {igt@kms_psr@primary_page_flip}:
      fi-cnl-psr:         DMESG-WARN (fdo#107372) -> DMESG-FAIL (fdo#107372)

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

  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
  fdo#107292 https://bugs.freedesktop.org/show_bug.cgi?id=107292
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107372 https://bugs.freedesktop.org/show_bug.cgi?id=107372


== Participating hosts (50 -> 47) ==

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


== Build changes ==

    * Linux: CI_DRM_4636 -> Patchwork_9897

  CI_DRM_4636: 084bb2fb549650b6da80976c9bc594779ce342b4 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4590: e6ddaca7a8ea9d3d27f0ecaa36b357cc02e2df3b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9897: 68d39a6b2408820f4c146396e499cf48e25dcecc @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

68d39a6b2408 drm/i915/selftests: Hold rpm for unparking

== Logs ==

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

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

* ✓ Fi.CI.IGT: success for drm/i915/selftests: Hold rpm for unparking
  2018-08-09  6:34 [PATCH] drm/i915/selftests: Hold rpm for unparking Chris Wilson
  2018-08-09  7:12 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-08-09  9:03 ` Patchwork
  2018-08-09 10:40 ` [PATCH] " Mika Kuoppala
  2018-08-09 10:49 ` Mika Kuoppala
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-08-09  9:03 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Hold rpm for unparking
URL   : https://patchwork.freedesktop.org/series/47930/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4636_full -> Patchwork_9897_full =

== Summary - SUCCESS ==

  No regressions found.

  

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

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

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s3:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_busy@extended-pageflip-hang-oldfb-render-a:
      shard-apl:          DMESG-WARN (fdo#106247) -> PASS

    igt@pm_rpm@cursor-dpms:
      shard-glk:          WARN -> PASS

    igt@pm_rpm@dpms-mode-unset-non-lpsp:
      shard-apl:          FAIL (fdo#106539) -> PASS +3

    
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106247 https://bugs.freedesktop.org/show_bug.cgi?id=106247
  fdo#106539 https://bugs.freedesktop.org/show_bug.cgi?id=106539
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4636 -> Patchwork_9897

  CI_DRM_4636: 084bb2fb549650b6da80976c9bc594779ce342b4 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4590: e6ddaca7a8ea9d3d27f0ecaa36b357cc02e2df3b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9897: 68d39a6b2408820f4c146396e499cf48e25dcecc @ 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_9897/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/selftests: Hold rpm for unparking
  2018-08-09  6:34 [PATCH] drm/i915/selftests: Hold rpm for unparking Chris Wilson
  2018-08-09  7:12 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-08-09  9:03 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-08-09 10:40 ` Mika Kuoppala
  2018-08-09 10:45   ` Chris Wilson
  2018-08-09 10:49 ` Mika Kuoppala
  3 siblings, 1 reply; 6+ messages in thread
From: Mika Kuoppala @ 2018-08-09 10:40 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Matthew Auld

Chris Wilson <chris@chris-wilson.co.uk> writes:

> The call to i915_gem_unpark() checks that we hold a rpm wakeref before
> taking a long term wakeref for i915->gt.awake. We should therefore make
> sure we do hold the wakeref when directly calling unpark to disable
> the retire worker.

We as a caller need to hold the rpm as i915_gem_unpark does 
intel_runtime_pm_get_noresume() ?

As I don't see any other checks before gt.awake being set.

-Mika

>
> Fixes: 932cac10c8fb ("drm/i915/selftests: Prevent background reaping of active objects")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> ---
>  .../gpu/drm/i915/selftests/i915_gem_object.c  | 20 +++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> index d9eca1b02aee..6d3516d5bff9 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> @@ -499,6 +499,19 @@ static bool assert_mmap_offset(struct drm_i915_private *i915,
>  	return err == expected;
>  }
>  
> +static void disable_retire_worker(struct drm_i915_private *i915)
> +{
> +	mutex_lock(&i915->drm.struct_mutex);
> +	if (!i915->gt.active_requests++) {
> +		intel_runtime_pm_get(i915);
> +		i915_gem_unpark(i915);
> +		intel_runtime_pm_put(i915);
> +	}
> +	mutex_unlock(&i915->drm.struct_mutex);
> +	cancel_delayed_work_sync(&i915->gt.retire_work);
> +	cancel_delayed_work_sync(&i915->gt.idle_work);
> +}
> +
>  static int igt_mmap_offset_exhaustion(void *arg)
>  {
>  	struct drm_i915_private *i915 = arg;
> @@ -509,12 +522,7 @@ static int igt_mmap_offset_exhaustion(void *arg)
>  	int loop, err;
>  
>  	/* Disable background reaper */
> -	mutex_lock(&i915->drm.struct_mutex);
> -	if (!i915->gt.active_requests++)
> -		i915_gem_unpark(i915);
> -	mutex_unlock(&i915->drm.struct_mutex);
> -	cancel_delayed_work_sync(&i915->gt.retire_work);
> -	cancel_delayed_work_sync(&i915->gt.idle_work);
> +	disable_retire_worker(i915);
>  	GEM_BUG_ON(!i915->gt.awake);
>  
>  	/* Trim the device mmap space to only a page */
> -- 
> 2.18.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/selftests: Hold rpm for unparking
  2018-08-09 10:40 ` [PATCH] " Mika Kuoppala
@ 2018-08-09 10:45   ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-08-09 10:45 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx; +Cc: Matthew Auld

Quoting Mika Kuoppala (2018-08-09 11:40:35)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > The call to i915_gem_unpark() checks that we hold a rpm wakeref before
> > taking a long term wakeref for i915->gt.awake. We should therefore make
> > sure we do hold the wakeref when directly calling unpark to disable
> > the retire worker.
> 
> We as a caller need to hold the rpm as i915_gem_unpark does 
> intel_runtime_pm_get_noresume() ?

Correct. noresume says that the caller must have down the synchronous
rpm_get for us.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/selftests: Hold rpm for unparking
  2018-08-09  6:34 [PATCH] drm/i915/selftests: Hold rpm for unparking Chris Wilson
                   ` (2 preceding siblings ...)
  2018-08-09 10:40 ` [PATCH] " Mika Kuoppala
@ 2018-08-09 10:49 ` Mika Kuoppala
  3 siblings, 0 replies; 6+ messages in thread
From: Mika Kuoppala @ 2018-08-09 10:49 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Matthew Auld

Chris Wilson <chris@chris-wilson.co.uk> writes:

> The call to i915_gem_unpark() checks that we hold a rpm wakeref before
> taking a long term wakeref for i915->gt.awake. We should therefore make
> sure we do hold the wakeref when directly calling unpark to disable
> the retire worker.
>
> Fixes: 932cac10c8fb ("drm/i915/selftests: Prevent background reaping of active objects")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

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

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

end of thread, other threads:[~2018-08-09 10:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-09  6:34 [PATCH] drm/i915/selftests: Hold rpm for unparking Chris Wilson
2018-08-09  7:12 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-08-09  9:03 ` ✓ Fi.CI.IGT: " Patchwork
2018-08-09 10:40 ` [PATCH] " Mika Kuoppala
2018-08-09 10:45   ` Chris Wilson
2018-08-09 10:49 ` Mika Kuoppala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox