public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Subject: [Intel-gfx] [PATCH v2 06/10] drm/i915/pm: Move CONTEXT_VALID_BIT check
Date: Fri, 29 Oct 2021 09:31:14 +0100	[thread overview]
Message-ID: <20211029083118.3386312-6-matthew.auld@intel.com> (raw)
In-Reply-To: <20211029083118.3386312-1-matthew.auld@intel.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Resetting will clear the CONTEXT_VALID_BIT, so wait until after that to
test.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_engine_pm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_pm.c b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
index a1334b48dde7..849fbb229bd3 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
@@ -52,8 +52,6 @@ static int __engine_unpark(struct intel_wakeref *wf)
 	/* Discard stale context state from across idling */
 	ce = engine->kernel_context;
 	if (ce) {
-		GEM_BUG_ON(test_bit(CONTEXT_VALID_BIT, &ce->flags));
-
 		/* Flush all pending HW writes before we touch the context */
 		while (unlikely(intel_context_inflight(ce)))
 			intel_engine_flush_submission(engine);
@@ -68,6 +66,9 @@ static int __engine_unpark(struct intel_wakeref *wf)
 			 ce->timeline->seqno,
 			 READ_ONCE(*ce->timeline->hwsp_seqno),
 			 ce->ring->emit);
+
+		GEM_BUG_ON(test_bit(CONTEXT_VALID_BIT, &ce->flags));
+
 		GEM_BUG_ON(ce->timeline->seqno !=
 			   READ_ONCE(*ce->timeline->hwsp_seqno));
 	}
-- 
2.26.3


  parent reply	other threads:[~2021-10-29  8:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29  8:31 [Intel-gfx] [PATCH v2 01/10] drm/i915: Remove unused bits of i915_vma/active api Matthew Auld
2021-10-29  8:31 ` [Intel-gfx] [PATCH v2 02/10] drm/i915: Remove gen6_ppgtt_unpin_all Matthew Auld
2021-10-29  8:31 ` [Intel-gfx] [PATCH v2 03/10] drm/i915: Create a dummy object for gen6 ppgtt Matthew Auld
2021-10-29  8:31 ` [Intel-gfx] [PATCH v2 04/10] drm/i915: Create a full object for mock_ring, v2 Matthew Auld
2021-10-29  8:31 ` [Intel-gfx] [PATCH v2 05/10] drm/i915: vma is always backed by an object Matthew Auld
2021-10-29  8:31 ` Matthew Auld [this message]
2021-10-29  8:31 ` [Intel-gfx] [PATCH v2 07/10] drm/i915: Remove resv from i915_vma Matthew Auld
2021-10-29  8:31 ` [Intel-gfx] [PATCH v2 08/10] drm/i915: Rework context handling in hugepages selftests Matthew Auld
2021-10-29  8:31 ` [Intel-gfx] [PATCH v2 09/10] drm/i915: Drain the ttm delayed workqueue too Matthew Auld
2021-10-29  8:31 ` [Intel-gfx] [PATCH v2 10/10] drm/i915: Require object lock when freeing pages during destruction Matthew Auld

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=20211029083118.3386312-6-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=niranjana.vishwanathapura@intel.com \
    /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