Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Ohad Sharabi <osharabi@habana.ai>, intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [CI 1/3] drm/xe: proper setting of irq enabled flag
Date: Fri, 22 Sep 2023 08:11:05 -0400	[thread overview]
Message-ID: <ZQ2EWcV+y46hKkDu@intel.com> (raw)
In-Reply-To: <ZQ1N3V244SX9l71G@intel.com>

On Fri, Sep 22, 2023 at 11:18:37AM +0300, Ville Syrjälä wrote:
> On Thu, Sep 21, 2023 at 05:07:58PM -0400, Rodrigo Vivi wrote:
> > From: Dani Liberman <dliberman@habana.ai>
> >
> > IRQ enabled flag should be set only after request irq succeeds.
> >
> > Reviewed-by: Ohad Sharabi <osharabi@habana.ai>
> > Signed-off-by: Dani Liberman <dliberman@habana.ai>
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > ---
> >  drivers/gpu/drm/xe/xe_irq.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
> > index ccb934f8fa34..f98aa1f06c8f 100644
> > --- a/drivers/gpu/drm/xe/xe_irq.c
> > +++ b/drivers/gpu/drm/xe/xe_irq.c
> > @@ -590,16 +590,14 @@ int xe_irq_install(struct xe_device *xe)
> >  		return -EINVAL;
> >  	}
> >
> > -	xe->irq.enabled = true;
> > -
> >  	xe_irq_reset(xe);
> >
> >  	err = request_irq(irq, irq_handler,
> >  			  IRQF_SHARED, DRIVER_NAME, xe);
> > -	if (err < 0) {
> > -		xe->irq.enabled = false;
> > +	if (err < 0)
> >  		return err;
> > -	}
> > +
> > +	xe->irq.enabled = true;
>
> Why does this even exist?

I had tried to kill this, but then I noticed it was needed
for i915-display.

@drivers/gpu/drm/xe/display/ext/i915_irq.c:

bool intel_irqs_enabled(struct xe_device *xe)
{
 	/*
         * XXX: i915 has a racy handling of the irq.enabled, since it doesn't
         * lock its transitions. Because of that, the irq.enabled sometimes
         * is not read with the irq.lock in place.
         * However, the most critical cases like vblank and page flips are
         * properly using the locks.
         * We cannot take the lock in here or run any kind of assert because
         * of i915 inconsistency.
         * But at this point the xe irq is better protected against races,
         * although the full solution would be protecting the i915 side.
         */
	return xe->irq.enabled;
}


>
> >
> >  	xe_irq_postinstall(xe);
> >
> > --
> > 2.41.0
>
> --
> Ville Syrjälä
> Intel

  reply	other threads:[~2023-09-22 12:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 21:07 [Intel-xe] [CI 1/3] drm/xe: proper setting of irq enabled flag Rodrigo Vivi
2023-09-21 21:07 ` [Intel-xe] [CI 2/3] drm/xe: change old msi irq api to a new one Rodrigo Vivi
2023-09-21 21:08 ` [Intel-xe] [CI 3/3] drm/xe: add msix support Rodrigo Vivi
2023-09-21 21:54 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [CI,1/3] drm/xe: proper setting of irq enabled flag Patchwork
2023-09-21 21:54 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-09-21 21:56 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-09-21 22:03 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-21 22:03 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-09-21 22:04 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-09-21 22:39 ` [Intel-xe] ✓ CI.BAT: " Patchwork
2023-09-22  8:18 ` [Intel-xe] [CI 1/3] " Ville Syrjälä
2023-09-22 12:11   ` Rodrigo Vivi [this message]
2023-09-22 12:54     ` Ville Syrjälä
2023-09-22 21:05       ` Rodrigo Vivi

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=ZQ2EWcV+y46hKkDu@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=osharabi@habana.ai \
    --cc=ville.syrjala@linux.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