From: Andrzej Hajda <andrzej.hajda@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [Intel-gfx] [PATCH 2/2] drm/i915/gt: use fetch_and_zero if applicable
Date: Thu, 8 Dec 2022 12:12:17 +0100 [thread overview]
Message-ID: <20221208111217.3734461-2-andrzej.hajda@intel.com> (raw)
In-Reply-To: <20221208111217.3734461-1-andrzej.hajda@intel.com>
Simplify the code.
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
drivers/gpu/drm/i915/gt/selftest_context.c | 6 ++----
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/selftest_context.c b/drivers/gpu/drm/i915/gt/selftest_context.c
index 76fbae358072df..307dbbe853a3e9 100644
--- a/drivers/gpu/drm/i915/gt/selftest_context.c
+++ b/drivers/gpu/drm/i915/gt/selftest_context.c
@@ -227,8 +227,7 @@ static int __live_active_context(struct intel_engine_cs *engine)
if (IS_ERR(ce))
return PTR_ERR(ce);
- saved_heartbeat = engine->props.heartbeat_interval_ms;
- engine->props.heartbeat_interval_ms = 0;
+ saved_heartbeat = fetch_and_zero(&engine->props.heartbeat_interval_ms);
for (pass = 0; pass <= 2; pass++) {
struct i915_request *rq;
@@ -385,8 +384,7 @@ static int __live_remote_context(struct intel_engine_cs *engine)
goto err_remote;
}
- saved_heartbeat = engine->props.heartbeat_interval_ms;
- engine->props.heartbeat_interval_ms = 0;
+ saved_heartbeat = fetch_and_zero(&engine->props.heartbeat_interval_ms);
intel_engine_pm_get(engine);
for (pass = 0; pass <= 2; pass++) {
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index 53f7f599cde3a2..f9dd77838917f6 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -4747,8 +4747,7 @@ static void reset_fail_worker_func(struct work_struct *w)
unsigned long flags;
spin_lock_irqsave(&guc->submission_state.lock, flags);
- reset_fail_mask = guc->submission_state.reset_fail_mask;
- guc->submission_state.reset_fail_mask = 0;
+ reset_fail_mask = fetch_and_zero(&guc->submission_state.reset_fail_mask);
spin_unlock_irqrestore(&guc->submission_state.lock, flags);
if (likely(reset_fail_mask))
--
2.34.1
next prev parent reply other threads:[~2022-12-08 11:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-08 11:12 [Intel-gfx] [PATCH 1/2] drm/i915/display: use fetch_and_zero if applicable Andrzej Hajda
2022-12-08 11:12 ` Andrzej Hajda [this message]
2022-12-08 11:47 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/2] " Patchwork
2022-12-08 12:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-08 12:32 ` [Intel-gfx] [PATCH 1/2] " Jani Nikula
2022-12-08 12:37 ` Jani Nikula
2022-12-08 13:36 ` Vivi, Rodrigo
2022-12-08 15:02 ` Jani Nikula
2022-12-08 15:44 ` Tvrtko Ursulin
2022-12-08 16:26 ` Andrzej Hajda
2022-12-08 15:02 ` Andrzej Hajda
2022-12-08 19:03 ` [Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [1/2] " 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=20221208111217.3734461-2-andrzej.hajda@intel.com \
--to=andrzej.hajda@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@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