public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Raag Jadav <raag.jadav@intel.com>
Cc: intel-xe@lists.freedesktop.org, andi.shyti@linux.intel.com,
	rodrigo.vivi@intel.com, matthew.d.roper@intel.com
Subject: Re: [PATCH v1] drm/xe/i2c: Assert/Deassert I2C IRQ
Date: Fri, 13 Mar 2026 10:55:24 +0200	[thread overview]
Message-ID: <abPQ_Ej-I6dZJfxJ@kuha> (raw)
In-Reply-To: <20260313080438.4166251-1-raag.jadav@intel.com>

Fri, Mar 13, 2026 at 01:34:38PM +0530, Raag Jadav kirjoitti:
> I2C IRQ is triggered using virtual wire. Assert/Deassert it in IRQ
> handler to allow subsequent interrupt generation.
> 
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>

Looks good to me. FWIW:

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/gpu/drm/xe/xe_i2c.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_i2c.c b/drivers/gpu/drm/xe/xe_i2c.c
> index 1deb812fe01d..706783863d07 100644
> --- a/drivers/gpu/drm/xe/xe_i2c.c
> +++ b/drivers/gpu/drm/xe/xe_i2c.c
> @@ -176,11 +176,18 @@ static bool xe_i2c_irq_present(struct xe_device *xe)
>   */
>  void xe_i2c_irq_handler(struct xe_device *xe, u32 master_ctl)
>  {
> -	if (!xe_i2c_irq_present(xe))
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +
> +	if (!(master_ctl & I2C_IRQ) || !xe_i2c_irq_present(xe))
>  		return;
>  
> -	if (master_ctl & I2C_IRQ)
> -		generic_handle_irq_safe(xe->i2c->adapter_irq);
> +	/* Forward interrupt to I2C adapter */
> +	generic_handle_irq_safe(xe->i2c->adapter_irq);
> +
> +	/* Deassert after I2C adapter clears the interrupt */
> +	xe_mmio_rmw32(mmio, I2C_CONFIG_CMD, 0, PCI_COMMAND_INTX_DISABLE);
> +	/* Reassert to allow subsequent interrupt generation */
> +	xe_mmio_rmw32(mmio, I2C_CONFIG_CMD, PCI_COMMAND_INTX_DISABLE, 0);
>  }
>  
>  void xe_i2c_irq_reset(struct xe_device *xe)
> @@ -190,6 +197,7 @@ void xe_i2c_irq_reset(struct xe_device *xe)
>  	if (!xe_i2c_irq_present(xe))
>  		return;
>  
> +	xe_mmio_rmw32(mmio, I2C_CONFIG_CMD, 0, PCI_COMMAND_INTX_DISABLE);
>  	xe_mmio_rmw32(mmio, I2C_BRIDGE_PCICFGCTL, ACPI_INTR_EN, 0);
>  }
>  
> @@ -201,6 +209,7 @@ void xe_i2c_irq_postinstall(struct xe_device *xe)
>  		return;
>  
>  	xe_mmio_rmw32(mmio, I2C_BRIDGE_PCICFGCTL, 0, ACPI_INTR_EN);
> +	xe_mmio_rmw32(mmio, I2C_CONFIG_CMD, PCI_COMMAND_INTX_DISABLE, 0);
>  }
>  
>  static int xe_i2c_irq_map(struct irq_domain *h, unsigned int virq,
> -- 
> 2.43.0

-- 
heikki

  parent reply	other threads:[~2026-03-13  8:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13  8:04 [PATCH v1] drm/xe/i2c: Assert/Deassert I2C IRQ Raag Jadav
2026-03-13  8:14 ` ✓ CI.KUnit: success for " Patchwork
2026-03-13  8:55 ` Heikki Krogerus [this message]
2026-03-13  9:00 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-14 10:15 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-14 18:23   ` Raag Jadav
2026-03-16 14:39     ` Matt Roper
2026-03-17 17:16 ` [PATCH v1] " Andi Shyti
2026-03-18 11:30 ` Heikki Krogerus
2026-03-23  7:56   ` Raag Jadav

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=abPQ_Ej-I6dZJfxJ@kuha \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=raag.jadav@intel.com \
    --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