Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Ilia Levi <ilia.levi@intel.com>, intel-xe@lists.freedesktop.org
Cc: jonathan.cavitt@intel.com, niranjana.vishwanathapura@intel.com,
	matthew.brost@intel.com, koby.elbaz@intel.com,
	yaron.avizrat@intel.com
Subject: Re: [PATCH v2 5/5] drm/xe: separate memirq reset/postinstall from vf
Date: Wed, 28 Aug 2024 22:42:32 +0200	[thread overview]
Message-ID: <1429c1eb-91b8-43e0-9e3d-51b2367f2b9d@intel.com> (raw)
In-Reply-To: <20240828091841.1840086-6-ilia.levi@intel.com>



On 28.08.2024 11:18, Ilia Levi wrote:
> Up until now only VF used Memory Based Interrupts (memirq).
> Moving reset/postinstall flows out of VF to cater for other usages.
> 
> Signed-off-by: Ilia Levi <ilia.levi@intel.com>
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_device.c |  2 +-
>  drivers/gpu/drm/xe/xe_device.h |  6 ++++++
>  drivers/gpu/drm/xe/xe_irq.c    | 36 +++++++++++++++++++---------------
>  3 files changed, 27 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index c4f8bfd08b09..a23fb0c81ca6 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -660,7 +660,7 @@ int xe_device_probe(struct xe_device *xe)
>  		err = xe_ggtt_init_early(tile->mem.ggtt);
>  		if (err)
>  			return err;
> -		if (IS_SRIOV_VF(xe)) {
> +		if (xe_device_needs_memirq(xe)) {
>  			err = xe_memirq_init(&tile->memirq, false);
>  			if (err)
>  				return err;
> diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> index f052c06a2d2f..4ba07617084c 100644
> --- a/drivers/gpu/drm/xe/xe_device.h
> +++ b/drivers/gpu/drm/xe/xe_device.h
> @@ -9,6 +9,7 @@
>  #include <drm/drm_util.h>
>  
>  #include "xe_device_types.h"
> +#include "xe_sriov.h"
>  
>  static inline struct xe_device *to_xe_device(const struct drm_device *dev)
>  {
> @@ -154,6 +155,11 @@ static inline bool xe_device_has_memirq(struct xe_device *xe)
>  	return GRAPHICS_VERx100(xe) >= 1250;
>  }
>  
> +static inline bool xe_device_needs_memirq(struct xe_device *xe)
> +{
> +	return IS_SRIOV_VF(xe) && xe_device_has_memirq(xe);
> +}

maybe worth to introduce this helper earlier in the series?

> +
>  u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size);
>  
>  void xe_device_snapshot_print(struct xe_device *xe, struct drm_printer *p);
> diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
> index 18a5272d9bb0..a080d4869b16 100644
> --- a/drivers/gpu/drm/xe/xe_irq.c
> +++ b/drivers/gpu/drm/xe/xe_irq.c
> @@ -559,17 +559,15 @@ static void vf_irq_reset(struct xe_device *xe)
>  
>  	xe_assert(xe, IS_SRIOV_VF(xe));
>  
> -	if (GRAPHICS_VERx100(xe) < 1210)
> -		xelp_intr_disable(xe);
> -	else
> +	if (GRAPHICS_VERx100(xe) >= 1210) {
>  		xe_assert(xe, xe_device_has_memirq(xe));
> -
> -	for_each_tile(tile, xe, id) {
> -		if (xe_device_has_memirq(xe))
> -			xe_memirq_reset(&tile->memirq);
> -		else
> -			gt_irq_reset(tile);
> +		return;
>  	}
> +
> +	xelp_intr_disable(xe);
> +
> +	for_each_tile(tile, xe, id)
> +		gt_irq_reset(tile);
>  }
>  
>  static void xe_irq_reset(struct xe_device *xe)
> @@ -577,6 +575,11 @@ static void xe_irq_reset(struct xe_device *xe)
>  	struct xe_tile *tile;
>  	u8 id;
>  
> +	if (xe_device_needs_memirq(xe)) {
> +		for_each_tile(tile, xe, id)
> +			xe_memirq_reset(&tile->memirq);
> +	}
> +

"else" or "return" ?

>  	if (IS_SRIOV_VF(xe))
>  		return vf_irq_reset(xe);
>  
> @@ -604,13 +607,6 @@ static void xe_irq_reset(struct xe_device *xe)
>  
>  static void vf_irq_postinstall(struct xe_device *xe)
>  {
> -	struct xe_tile *tile;
> -	unsigned int id;
> -
> -	for_each_tile(tile, xe, id)
> -		if (xe_device_has_memirq(xe))
> -			xe_memirq_postinstall(&tile->memirq);
> -
>  	if (GRAPHICS_VERx100(xe) < 1210)
>  		xelp_intr_enable(xe, true);
>  	else
> @@ -619,6 +615,14 @@ static void vf_irq_postinstall(struct xe_device *xe)
>  
>  static void xe_irq_postinstall(struct xe_device *xe)
>  {
> +	struct xe_tile *tile;
> +	unsigned int id;
> +
> +	if (xe_device_needs_memirq(xe)) {
> +		for_each_tile(tile, xe, id)
> +			xe_memirq_postinstall(&tile->memirq);
> +	}
> +
>  	if (IS_SRIOV_VF(xe))
>  		return vf_irq_postinstall(xe);
>  

  reply	other threads:[~2024-08-28 20:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  9:18 [PATCH v2 0/5] memirq infra changes Ilia Levi
2024-08-28  9:18 ` [PATCH v2 1/5] drm/xe: move memirq out of vf Ilia Levi
2024-08-28 20:01   ` Michal Wajdeczko
2024-08-28  9:18 ` [PATCH v2 2/5] drm/xe: memirq infra changes for msix Ilia Levi
2024-08-28 20:17   ` Michal Wajdeczko
2024-09-02 13:28     ` Ilia Levi
2024-08-28  9:18 ` [PATCH v2 3/5] drm/xe: add memirq offsets for engine instance 0 to hw engine properties Ilia Levi
2024-08-28 20:36   ` Michal Wajdeczko
2024-08-28  9:18 ` [PATCH v2 4/5] drm/xe: memirq handler changes Ilia Levi
2024-08-28 20:38   ` Michal Wajdeczko
2024-09-02 13:38     ` Ilia Levi
2024-08-28  9:18 ` [PATCH v2 5/5] drm/xe: separate memirq reset/postinstall from vf Ilia Levi
2024-08-28 20:42   ` Michal Wajdeczko [this message]
2024-09-02 13:49     ` Ilia Levi
2024-08-28 11:48 ` ✓ CI.Patch_applied: success for memirq infra changes (rev3) Patchwork
2024-08-28 11:49 ` ✓ CI.checkpatch: " Patchwork
2024-08-28 11:50 ` ✓ CI.KUnit: " Patchwork
2024-08-28 12:02 ` ✓ CI.Build: " Patchwork
2024-08-28 12:04 ` ✓ CI.Hooks: " Patchwork
2024-08-28 12:06 ` ✓ CI.checksparse: " Patchwork
2024-08-28 12:25 ` ✓ CI.BAT: " Patchwork
2024-08-28 18:53 ` ✗ CI.FULL: failure " 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=1429c1eb-91b8-43e0-9e3d-51b2367f2b9d@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=ilia.levi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=koby.elbaz@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=niranjana.vishwanathapura@intel.com \
    --cc=yaron.avizrat@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