[PATCH 1/2] drm/xe/guc: Prepare fast-path to be called outside of IRQ handler

Matthew Brost matthew.brost at intel.com
Wed Jun 5 21:33:54 UTC 2024


On Wed, Jun 05, 2024 at 10:19:46PM +0200, Michal Wajdeczko wrote:
> G2H fast-path processing is done today only from the IRQ handler,
> but in upcoming patch we want to use it also from the work.
> Update spin lock to the _irq variant like rest of the code.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Matthew Brost <matthew.brost at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_guc_ct.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index c1f258348f5c..17f0e5019bb8 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -1216,6 +1216,7 @@ static void g2h_fast_path(struct xe_guc_ct *ct, u32 *msg, u32 len)
>  void xe_guc_ct_fast_path(struct xe_guc_ct *ct)

Can we just avoid calling this function in safe_mode_worker_func? More
on this in my reply to 2nd patch.

Matt 

>  {
>  	struct xe_device *xe = ct_to_xe(ct);
> +	unsigned long flags;
>  	bool ongoing;
>  	int len;
>  
> @@ -1223,13 +1224,13 @@ void xe_guc_ct_fast_path(struct xe_guc_ct *ct)
>  	if (!ongoing && xe_pm_read_callback_task(ct_to_xe(ct)) == NULL)
>  		return;
>  
> -	spin_lock(&ct->fast_lock);
> +	spin_lock_irqsave(&ct->fast_lock, flags);
>  	do {
>  		len = g2h_read(ct, ct->fast_msg, true);
>  		if (len > 0)
>  			g2h_fast_path(ct, ct->fast_msg, len);
>  	} while (len > 0);
> -	spin_unlock(&ct->fast_lock);
> +	spin_unlock_irqrestore(&ct->fast_lock, flags);
>  
>  	if (ongoing)
>  		xe_pm_runtime_put(xe);
> -- 
> 2.43.0
> 


More information about the Intel-xe mailing list