All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] drm/i915/gt: Undo partial gt-pm enabling on error paths
Date: Tue, 14 Jan 2020 14:56:39 +0000	[thread overview]
Message-ID: <20200114145639.2406801-1-chris@chris-wilson.co.uk> (raw)

Undo the rps/llc enabling operations if we fail to bring up the engine
subsequently. For bonus paranoia, scrub the GT state along the error
path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index d1c2f034296a..b8585bc8ac91 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -179,10 +179,6 @@ int intel_gt_resume(struct intel_gt *gt)
 	enum intel_engine_id id;
 	int err;
 
-	err = intel_gt_has_init_error(gt);
-	if (err)
-		return err;
-
 	GT_TRACE(gt, "\n");
 
 	/*
@@ -192,13 +188,13 @@ int intel_gt_resume(struct intel_gt *gt)
 	 * allowing us to fixup the user contexts on their first pin.
 	 */
 	intel_gt_pm_get(gt);
-
 	intel_uncore_forcewake_get(gt->uncore, FORCEWAKE_ALL);
+
 	intel_rc6_sanitize(&gt->rc6);
 	gt_sanitize(gt, true);
 	if (intel_gt_is_wedged(gt)) {
 		err = -EIO;
-		goto out_fw;
+		goto err_sanitize;
 	}
 
 	/* Only when the HW is re-initialised, can we replay the requests */
@@ -223,23 +219,26 @@ int intel_gt_resume(struct intel_gt *gt)
 			dev_err(gt->i915->drm.dev,
 				"Failed to restart %s (%d)\n",
 				engine->name, err);
-			goto err_wedged;
+			goto err_disable;
 		}
 	}
 
 	intel_rc6_enable(&gt->rc6);
-
 	intel_uc_resume(&gt->uc);
 
-	user_forcewake(gt, false);
-
 out_fw:
+	user_forcewake(gt, false);
 	intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_ALL);
 	intel_gt_pm_put(gt);
 	return err;
 
+err_disable:
+	intel_rps_disable(&gt->rps);
+	intel_llc_disable(&gt->llc);
 err_wedged:
 	intel_gt_set_wedged(gt);
+err_sanitize:
+	gt_sanitize(gt, false);
 	goto out_fw;
 }
 
-- 
2.25.0.rc2

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

             reply	other threads:[~2020-01-14 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 14:56 Chris Wilson [this message]
2020-01-14 17:38 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gt: Undo partial gt-pm enabling on error paths Patchwork
2020-01-14 17:38 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-01-16 21:24 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200114145639.2406801-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.