From: Maciej Patelczyk <maciej.patelczyk@intel.com>
To: Krzysztof Karas <krzysztof.karas@intel.com>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Subject: Re: [PATCH v3] drm/i915/gt: Use spin_lock_irqsave() in interruptible context
Date: Thu, 16 Jan 2025 12:22:54 +0100 [thread overview]
Message-ID: <16e02f7a-5dc4-49aa-b81e-25c0d313b9a1@intel.com> (raw)
In-Reply-To: <pusppq5ybyszau2oocboj3mtj5x574gwij323jlclm5zxvimmu@mnfg6odxbpsv>
On 16.01.2025 11:40, Krzysztof Karas wrote:
> spin_lock/unlock() functions used in interrupt contexts could
> result in a deadlock, as seen in GitLab issue #13399:
> https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13399,
> which occurs when interrupt comes in while holding a lock.
>
> Try to remedy the problem by saving irq state before spin lock
> acquisition.
>
> v2: add irqs' state save/restore calls to all locks/unlocks in
> signal_irq_work() execution (Maciej)
>
> v3: use with spin_lock_irqsave() in guc_lrc_desc_unpin() instead
> of other lock/unlock calls and add Fixes and Cc tags (Tvrtko);
> change title and commit message
>
> Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
> Fixes: 2f2cc53b5fe7 ("drm/i915/guc: Close deregister-context race against CT-loss")
> Cc: <stable@vger.kernel.org> # v6.9+
> ---
> drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> 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 12f1ba7ca9c1..29d9c81473cc 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
> @@ -3433,10 +3433,10 @@ static inline int guc_lrc_desc_unpin(struct intel_context *ce)
> */
> ret = deregister_context(ce, ce->guc_id.id);
> if (ret) {
> - spin_lock(&ce->guc_state.lock);
> + spin_lock_irqsave(&ce->guc_state.lock, flags);
> set_context_registered(ce);
> clr_context_destroyed(ce);
> - spin_unlock(&ce->guc_state.lock);
> + spin_unlock_irqrestore(&ce->guc_state.lock, flags);
> /*
> * As gt-pm is awake at function entry, intel_wakeref_put_async merely decrements
> * the wakeref immediately but per function spec usage call this after unlock.
Looked at this and wasn't seeing it. There is spin_lock_irqsave() used
earlier.
Reviewed-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
next prev parent reply other threads:[~2025-01-16 11:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 10:40 [PATCH v3] drm/i915/gt: Use spin_lock_irqsave() in interruptible context Krzysztof Karas
2025-01-16 11:22 ` Maciej Patelczyk [this message]
2025-01-16 12:13 ` ✗ Fi.CI.SPARSE: warning for " Patchwork
2025-01-16 13:18 ` ✗ i915.CI.BAT: failure " Patchwork
2025-01-17 11:51 ` Krzysztof Karas
2025-01-20 9:25 ` Ravali, JupallyX
2025-01-20 9:20 ` ✓ i915.CI.BAT: success " Patchwork
2025-01-21 4:20 ` ✗ i915.CI.Full: failure " Patchwork
2025-01-31 10:40 ` ✓ i915.CI.BAT: success for drm/i915/gt: Use spin_lock_irqsave() in interruptible context (rev2) Patchwork
2025-01-31 12:52 ` ✓ i915.CI.Full: " Patchwork
2025-02-13 18:56 ` [PATCH v3] drm/i915/gt: Use spin_lock_irqsave() in interruptible context Andi Shyti
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=16e02f7a-5dc4-49aa-b81e-25c0d313b9a1@intel.com \
--to=maciej.patelczyk@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=krzysztof.karas@intel.com \
--cc=tursulin@ursulin.net \
/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