Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Shuicheng Lin <shuicheng.lin@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe: Skip TLB invalidation time out log if ct is disabled
Date: Tue, 20 Feb 2024 15:05:27 +0000	[thread overview]
Message-ID: <ZdS/t2KKI79Kyy7C@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240220021356.3514454-1-shuicheng.lin@intel.com>

On Tue, Feb 20, 2024 at 02:13:56AM +0000, Shuicheng Lin wrote:
> Suspend may cause the TLB invalidation time out as below log.
> Skip the log print if ct is disabled to make log clean.
> "
> [  228.812266] xe_gt_tlb_invalidation_wait enter
> [  228.812311] xe_gt_suspend enter
> [  228.812782] xe 0000:03:00.0: [drm] GT0: suspended
> [  228.812786] xe_gt_suspend enter
> [  228.813508] xe 0000:03:00.0: [drm] GT1: suspended
> …
> [  229.067007] xe 0000:03:00.0: [drm] *ERROR* TILE0 [GTT] GT0: TLB invalidation time'd out, seqno=321, recv=319
> [  229.067099] xe 0000:03:00.0: [drm] *ERROR* GT0: CT disabled
> "
> 

This doesn't look right for a few reasons.
- The timeout still can race suspend and then a resume
- The xe_guc_ct_enabled check also supresses the -ETIME return
- I think this message it actually valid

What should probably be done is signal all pending TLB invalidations on
suspend. I think we are doing a bit of rework in [1] in this area too.
I'd say let's get [1] to land and if this is still an issue fixup the
suspend path to signal all TLB invalidation waiters. Signaling all
waiters on suspend shoud avoid having this message be printed.

Matt

[1] https://patchwork.freedesktop.org/series/129217/

> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> index 7b3a54748b49..8aac12efea84 100644
> --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> @@ -330,11 +330,18 @@ int xe_gt_tlb_invalidation_wait(struct xe_gt *gt, int seqno)
>  	if (!ret) {
>  		struct drm_printer p = xe_gt_err_printer(gt);
>  
> -		xe_tile_report_driver_error(gt_to_tile(gt), XE_TILE_DRV_ERR_GTT,
> -					    "GT%u: TLB invalidation time'd out, seqno=%d, recv=%d",
> -					    gt->info.id, seqno, gt->tlb_invalidation.seqno_recv);
> -		xe_guc_ct_print(&guc->ct, &p, true);
> -		return -ETIME;
> +		/*
> +		 * guc ct may be disabled during the waiting period and lead to the timeout.
> +		 * Such as power suspend just after this tlb invalidation wait.
> +		 * Skip the error log print if ct is disabled.
> +		 */
> +		if (xe_guc_ct_enabled(&guc->ct)) {
> +			xe_tile_report_driver_error(gt_to_tile(gt), XE_TILE_DRV_ERR_GTT,
> +						    "GT%u: TLB invalidation time'd out, seqno=%d, recv=%d",
> +						    gt->info.id, seqno, gt->tlb_invalidation.seqno_recv);
> +			xe_guc_ct_print(&guc->ct, &p, true);
> +			return -ETIME;
> +		}
>  	}
>  
>  	return 0;
> -- 
> 2.25.1
> 

  parent reply	other threads:[~2024-02-20 17:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  2:13 [PATCH] drm/xe: Skip TLB invalidation time out log if ct is disabled Shuicheng Lin
2024-02-20  2:19 ` ✗ CI.Patch_applied: failure for " Patchwork
2024-02-20 15:05 ` Matthew Brost [this message]
2024-02-20 18:07   ` [PATCH] " Matthew Auld
2024-02-20 18:35     ` Matthew Brost
2024-02-21  0:43       ` Lin, Shuicheng

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=ZdS/t2KKI79Kyy7C@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=shuicheng.lin@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