Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Nirmoy Das <nirmoy.das@intel.com>,
	Chris Wilson <chris.p.wilson@linux.intel.com>
Subject: [Intel-gfx] [PATCH] drm/i915/gt: Clear wedged status upon suspend
Date: Tue, 24 Jan 2023 12:05:15 +0100	[thread overview]
Message-ID: <20230124110515.17017-1-nirmoy.das@intel.com> (raw)

From: Chris Wilson <chris.p.wilson@linux.intel.com>

Currently we use set-wedged on suspend if the workload is not responding
in order to allow a fast suspend (albeit at the cost of discarding the
current userspace). This may leave the device wedged during suspend,
where we may require the device available in order to swapout CPU
inaccessible device memory. Clear any temporary wedged-status after
flushing userspace off the device so we can use the blitter ourselves
inside suspend.

Testcase: igt/gem_eio/in-flight-suspend
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index cef3d6f5c34e..74d1dd3793f9 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -317,19 +317,17 @@ int intel_gt_resume(struct intel_gt *gt)
 
 static void wait_for_suspend(struct intel_gt *gt)
 {
-	if (!intel_gt_pm_is_awake(gt))
-		return;
-
-	if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME) {
+	if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME)
 		/*
 		 * Forcibly cancel outstanding work and leave
 		 * the gpu quiet.
 		 */
 		intel_gt_set_wedged(gt);
-		intel_gt_retire_requests(gt);
-	}
 
 	intel_gt_pm_wait_for_idle(gt);
+
+	/* Make the GPU available again for swapout */
+	intel_gt_unset_wedged(gt);
 }
 
 void intel_gt_suspend_prepare(struct intel_gt *gt)
-- 
2.39.0


             reply	other threads:[~2023-01-24 11:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 11:05 Nirmoy Das [this message]
2023-01-24 11:07 ` [Intel-gfx] [PATCH] drm/i915/gt: Clear wedged status upon suspend Das, Nirmoy
2023-01-24 19:26   ` Rodrigo Vivi
2023-01-25 13:28     ` Das, Nirmoy
2023-01-24 19:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-01-24 22:28 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20230124110515.17017-1-nirmoy.das@intel.com \
    --to=nirmoy.das@intel.com \
    --cc=chris.p.wilson@linux.intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox