Skip to contentSkip to conversation

drm/i915/guc: Don't leak stage descriptor pool on init failure

PATCH In review Michal Wajdeczko 4 participants 5 messages Jun 5, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/guc: Don't leak stage descriptor pool on init failure

In case of failure during GuC clients creation, we forget to cleanup earlier pool allocation. Use proper teardown to fix that.

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
---
 drivers/gpu/drm/i915/intel_guc_submission.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_guc_submission.c +4 -1
index 133367a..23e9f20 100644
@@ -1157,7 +1157,7 @@ int intel_guc_submission_init(struct intel_guc *guc)
 	WARN_ON(!guc_verify_doorbells(guc));
 	ret = guc_clients_create(guc);
 	if (ret)
-		return ret;
+		goto err_pool;
 
 	for_each_engine(engine, dev_priv, id) {
 		guc->preempt_work[id].engine = engine;
@@ -1166,6 +1166,9 @@ int intel_guc_submission_init(struct intel_guc *guc)
 
 	return 0;
 
+err_pool:
+	guc_stage_desc_pool_destroy(guc);
+	return ret;
 }
 
 void intel_guc_submission_fini(struct intel_guc *guc)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915/guc: Don't leak stage descriptor pool on init failure

== Series Details ==

== Series Details ==

Series: drm/i915/guc: Don't leak stage descriptor pool on init failure
URL : https://patchwork.freedesktop.org/series/44270/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4278 -> Patchwork_9200 =

== Summary - SUCCESS ==

No regressions found.

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

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload-inject:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106248, fdo#106725)

    igt@gem_ctx_switch@basic-default-heavy:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106000)

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106097) +1

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
      fi-cfl-s3:          PASS -> FAIL (fdo#103481) +2

    
    ==== Possible fixes ====

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-cfl-s3:          FAIL (fdo#100368) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
      fi-glk-j4005:       FAIL (fdo#103481) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-c:
      fi-glk-j4005:       DMESG-WARN (fdo#106000) -> PASS

    igt@prime_vgem@basic-fence-flip:
      fi-ilk-650:         FAIL (fdo#104008) -> PASS

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725

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

Additional (2): fi-bxt-dsi fi-hsw-4200u
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-hsw-peppy fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4278 -> Patchwork_9200

CI_DRM_4278: 6832f9f1d1d74ea696ae703d6ce9aa195be663f2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4506: 6c9d04797b7ef972b1b3746df6985071d1d2de26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9200: fd1503771ae8123098a57033d46636564a77cbbc @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

fd1503771ae8 drm/i915/guc: Don't leak stage descriptor pool on init failure

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9200/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✓ Fi.CI.IGT: success for drm/i915/guc: Don't leak stage descriptor pool on init failure

In reply to Michal Wajdeczko
== Series Details ==

== Series Details ==

Series: drm/i915/guc: Don't leak stage descriptor pool on init failure
URL : https://patchwork.freedesktop.org/series/44270/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4278_full -> Patchwork_9200_full =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_9200_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9200_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

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

== Possible new issues ==

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

=== IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-bsd2:
      shard-kbl:          PASS -> SKIP +1

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_flip@plain-flip-fb-recreate:
      shard-hsw:          PASS -> FAIL (fdo#100368)

    
    ==== Possible fixes ====

    igt@gem_exec_big:
      shard-hsw:          INCOMPLETE (fdo#103540) -> PASS

    igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
      shard-glk:          FAIL (fdo#105703) -> PASS +1

    igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
      shard-glk:          FAIL (fdo#105454, fdo#106509) -> PASS

    igt@kms_cursor_legacy@cursor-vs-flip-varying-size:
      shard-hsw:          FAIL (fdo#103355) -> PASS

    igt@kms_flip@2x-flip-vs-wf_vblank-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS

    igt@kms_flip_tiling@flip-y-tiled:
      shard-glk:          FAIL (fdo#104724) -> PASS

    igt@perf@polling:
      shard-hsw:          FAIL (fdo#102252) -> PASS

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509

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

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4278 -> Patchwork_9200

CI_DRM_4278: 6832f9f1d1d74ea696ae703d6ce9aa195be663f2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4506: 6c9d04797b7ef972b1b3746df6985071d1d2de26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9200: fd1503771ae8123098a57033d46636564a77cbbc @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9200/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#3 lore raw
In reply to Michal Wajdeczko
Quoted 7 lines · Michal Wajdeczko

In case of failure during GuC clients creation, we forget to cleanup earlier pool allocation. Use proper teardown to fix that.

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Quoted 19 lines
---
  drivers/gpu/drm/i915/intel_guc_submission.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_guc_submission.c +1 -1
index 133367a..23e9f20 100644
@@ -1157,7 +1157,7 @@ int intel_guc_submission_init(struct intel_guc *guc)
  	WARN_ON(!guc_verify_doorbells(guc));
  	ret = guc_clients_create(guc);
  	if (ret)
-		return ret;
+		goto err_pool;
 
  	for_each_engine(engine, dev_priv, id) {
  		guc->preempt_work[id].engine = engine;

drivers/gpu/drm/i915/intel_guc_submission.c int intel_guc_submission_init(struct intel_guc *guc) · line 1174

Quoted 9 lines
drivers/gpu/drm/i915/intel_guc_submission.c +3 -0
@@ -1166,6 +1166,9 @@ int intel_guc_submission_init(struct intel_guc *guc)
 
  	return 0;
 
+err_pool:
+	guc_stage_desc_pool_destroy(guc);
+	return ret;
  }
 
  void intel_guc_submission_fini(struct intel_guc *guc)

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

Quoting Daniele Ceraolo Spurio (2018-06-05 18:38:38)

Quoted 12 lines · Michal Wajdeczko
Quoted 7 lines

In case of failure during GuC clients creation, we forget to cleanup earlier pool allocation. Use proper teardown to fix that.

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>

Applied, thank you for the patch and review.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx