From: "Dong, Zhanjun" <zhanjun.dong@intel.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: <intel-gfx@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>,
Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Subject: Re: [PATCH v2] drm/i915/guc: Add synchronization on interrupt enable flag
Date: Mon, 25 Aug 2025 17:09:06 -0400 [thread overview]
Message-ID: <5714a47e-8b36-491a-a2e7-5af89491b6a4@intel.com> (raw)
In-Reply-To: <lmfc6jvlzgmd3xy7ed7rwk2yp66o572hnp7wmq7t4qlenzwv56@izbw6hrdkfa2>
On 2025-08-25 6:00 a.m., Andi Shyti wrote:
> Hi Zhanjun,
>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_irq.c b/drivers/gpu/drm/i915/gt/intel_gt_irq.c
>> index 75e802e10be2..21804eec8320 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_gt_irq.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_gt_irq.c
>> @@ -20,7 +20,7 @@
>>
>> static void guc_irq_handler(struct intel_guc *guc, u16 iir)
>> {
>> - if (unlikely(!guc->interrupts.enabled))
>> + if (unlikely(!atomic_read(&guc->interrupts.enabled)))
>> return;
>>
>> if (iir & GUC_INTR_GUC2HOST)
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
>> index f360f020d8f1..48148cb6cba0 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
>> @@ -100,8 +100,9 @@ static void gen9_enable_guc_interrupts(struct intel_guc *guc)
>> gt->pm_guc_events);
>> gen6_gt_pm_enable_irq(gt, gt->pm_guc_events);
>> spin_unlock_irq(gt->irq_lock);
>> -
>> - guc->interrupts.enabled = true;
>> + atomic_set(&guc->interrupts.enabled, true);
>> + /* make sure interrupt handler will see changes */
>> + smp_mb();
>
> Are we sure we need the barriers here? Can you please explain
> better what you are trying to achieve?
>
> My idea of barriers was to use in order to avoid converting
> everything into atomic, which doesn't necessarily mean that it's
> the best solution, it was just a thought.
>
> But maybe I misunderstood your intention.
>
> Andi
The barriers seems not needed, the synchronization issue is for
interrupt.enable only, no extra memory barrier is needed, to be removed
in next rev.
Regards,
Zhanjun Dong
prev parent reply other threads:[~2025-08-25 21:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 14:13 [PATCH v2] drm/i915/guc: Add synchronization on interrupt enable flag Zhanjun Dong
2025-08-22 15:59 ` ✓ i915.CI.BAT: success for drm/i915/guc: Add synchronization on interrupt enable flag (rev2) Patchwork
2025-08-22 19:55 ` ✗ i915.CI.Full: failure " Patchwork
2025-08-25 10:00 ` [PATCH v2] drm/i915/guc: Add synchronization on interrupt enable flag Andi Shyti
2025-08-25 21:09 ` Dong, Zhanjun [this message]
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=5714a47e-8b36-491a-a2e7-5af89491b6a4@intel.com \
--to=zhanjun.dong@intel.com \
--cc=andi.shyti@kernel.org \
--cc=daniele.ceraolospurio@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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;
as well as URLs for NNTP newsgroup(s).