[PATCH] drm/xe/vf: Don't touch GuC irq registers if using memory irqs

Matt Roper matthew.d.roper at intel.com
Mon Jun 17 19:44:43 UTC 2024


On Mon, Jun 17, 2024 at 05:47:36PM +0200, Michal Wajdeczko wrote:
> On platforms where VFs are using memory based interrupts, we
> missed invalid access to no longer existing interrupt registers,
> as we keep them marked with XE_REG_OPTION_VF. To fix that just
> either setup memirq vectors in GuC or enable legacy interrupts.
> 
> Fixes: aef4eb7c7dec ("drm/xe/vf: Setup memory based interrupts in GuC")
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Matt Roper <matthew.d.roper at intel.com>

Confirmed in bspec folder 53221; the registers written by guc_enable_irq
used to be VF-accessible on the pre-memirq platforms (e.g., TGL and
such), but are no longer part of the VF interface on any newer platforms
with memirq.

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_guc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index 0e1a5674ef13..7ecb509c87d7 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -854,8 +854,6 @@ int xe_guc_enable_communication(struct xe_guc *guc)
>  	struct xe_device *xe = guc_to_xe(guc);
>  	int err;
>  
> -	guc_enable_irq(guc);
> -
>  	if (IS_SRIOV_VF(xe) && xe_device_has_memirq(xe)) {
>  		struct xe_gt *gt = guc_to_gt(guc);
>  		struct xe_tile *tile = gt_to_tile(gt);
> @@ -863,6 +861,8 @@ int xe_guc_enable_communication(struct xe_guc *guc)
>  		err = xe_memirq_init_guc(&tile->sriov.vf.memirq, guc);
>  		if (err)
>  			return err;
> +	} else {
> +		guc_enable_irq(guc);
>  	}
>  
>  	xe_mmio_rmw32(guc_to_gt(guc), PMINTRMSK,
> -- 
> 2.43.0
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list