drm/xe: Skip TLB invalidation time out log if ct is disabled
Subsystems (2)
PATCH 1/1 drm/xe: Skip TLB invalidation time out log if ct is disabled
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
"
--- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +12 -5
@@ -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 ;
Signature · 1 line
2.25.1
Patchwork
CI✗ CI.Patch_applied: failure for drm/xe: Skip TLB invalidation time out log if ct is disabled
== Series Details ==
== Series Details ==
Series: drm/xe: Skip TLB invalidation time out log if ct is disabled
URL : https://patchwork.freedesktop.org/series/130101/
State : failure
== Summary ==
=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: faa7ecc2f307 drm-tip: 2024y-02m-19d-20h-31m-40s UTC integration manifest === git am output follows ===
error: patch failed: drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c:330
error: drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Applying: drm/xe: Skip TLB invalidation time out log if ct is disabled Patch failed at 0001 drm/xe: Skip TLB invalidation time out log if ct is disabled When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Matthew Brost
maintainerQuoted 11 lines · Shuicheng Lin
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
Quoted 2 lines
"
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/
Quoted 36 lines
Signed-off-by Shuicheng Lin <[email protected]>--- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +12
-5@@ -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 ;Signature · 1 line
2.25.1
Quoted 20 lines · Matthew Brost
Quoted 11 lines · Shuicheng Lin
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 disabledQuoted 2 lines
"
This doesn't look right for a few reasons.
- The timeout still can race suspend and then a resume
- Thexe_guc_ct_enabledcheck also supresses the-ETIMEreturn
- I think this message it actually valid
Quoted 5 lines
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.
I think [1] will only help with rpm, also currently all callers of xe_gt_tlb_invalidation_wait() will always have an rpm ref anyway, AFAICT. There is the forced suspend path which is quite a different beast though, so likely it is there where we need to be more solid?
Quoted 41 lines
Matt
[1] https://patchwork.freedesktop.org/series/129217/
Quoted 36 lines
Signed-off-by Shuicheng Lin <[email protected]>--- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +12
-5@@ -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 ;Signature · 1 line
2.25.1
Matthew Brost
maintainerQuoted 27 lines · Matthew Auld
Quoted 20 lines · Matthew Brost
Quoted 11 lines · Shuicheng Lin
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 disabledQuoted 2 lines
"
This doesn't look right for a few reasons.
- The timeout still can race suspend and then a resume
- Thexe_guc_ct_enabledcheck also supresses the-ETIMEreturn
- I think this message it actually validQuoted 5 lines
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.
Quoted 5 lines
I think [1] will only help with rpm, also currently all callers of
xe_gt_tlb_invalidation_wait()will always have an rpm ref anyway, AFAICT. There is the forced suspend path which is quite a different beast though, so likely it is there where we need to be more solid?
Yes it likely not the rpm path here but still think it worth getting [1] in and perhaps a version [2] in first though.
Matt
[1] https://patchwork.freedesktop.org/series/129217/
[2] https://patchwork.freedesktop.org/series/122772/
Quoted 39 lines
Quoted 39 lines
Matt
[1] https://patchwork.freedesktop.org/series/129217/
Quoted 34 lines
Signed-off-by Shuicheng Lin <[email protected]>--- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +12
-5@@ -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 ;Signature · 1 line
2.25.1
Thanks all for the review. Will check it again after the 2 series are merged.
Best Regards
Shuicheng
Quoted 95 lines
-----Original Message-----
From: Brost, Matthew <[email protected]>
Sent: Wednesday, February 21, 2024 2:35 AM
To: Auld, Matthew <[email protected]>
Cc: Lin, Shuicheng <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/xe: Skip TLB invalidation time out log if ct is disabledQuoted 25 lines · Matthew Auld
Quoted 18 lines · Matthew Brost
Quoted 11 lines · Shuicheng Lin
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_suspendenter [ 228.812782] xe 0000:03:00.0: [drm] GT0:
suspended [ 228.812786]xe_gt_suspendenter [ 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
- Thexe_guc_ct_enabledcheck also supresses the-ETIMEreturn
- I think this message it actually validQuoted 5 lines
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.
Quoted 5 lines
I think [1] will only help with rpm, also currently all callers of
xe_gt_tlb_invalidation_wait()will always have an rpm ref anyway, AFAICT. There is the forced suspend path which is quite a different beast though, so likely it is there where we need to be more solid?Yes it likely not the rpm path here but still think it worth getting [1] in and perhaps a version [2] in first though.
Matt
[1] https://patchwork.freedesktop.org/series/129217/
[2] https://patchwork.freedesktop.org/series/122772/Quoted 10 lines
Quoted 10 lines
Matt
[1] https://patchwork.freedesktop.org/series/129217/
Quoted 5 lines
Signed-off-by Shuicheng Lin <[email protected]>--- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c int xe_gt_tlb_invalidation_wait(struct xe_gt
Quoted 6 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +0
-0@@ -330,11 +330,18 @@ int xe_gt_tlb_invalidation_wait(struct xe_gt*gt, int seqno)
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c int xe_gt_tlb_invalidation_wait(struct xe_gt *gt, int seqno)
Quoted 3 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +0
-1if (!ret) {struct drm_printer p =xe_gt_err_printer (gt); - xe_tile_report_driver_error(gt_to_tile(gt),
XE_TILE_DRV_ERR_GTT,Quoted 1 line
Quoted 1 line
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c int xe_gt_tlb_invalidation_wait(struct xe_gt · line 333
Quoted 1 line
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +0
-1- "GT%u: TLB invalidation time'd out,seqno=%d, recv=%d",
Quoted 6 lines
Quoted 1 line
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c int xe_gt_tlb_invalidation_wait(struct xe_gt · line 334
Quoted 1 line
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +0
-1- gt->info.id, seqno, gt-tlb_invalidation.seqno_recv);
Quoted 4 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c int xe_gt_tlb_invalidation_wait(struct xe_gt *gt, int seqno)
Quoted 4 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +2
-2-xe_guc_ct_print (&guc->ct, &p, true); -return -ETIME ; +/* +* guc ct may be disabled during the waiting period and lead to the timeout.
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c int xe_gt_tlb_invalidation_wait(struct xe_gt *gt, int seqno)
Quoted 5 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +5
-0+* 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,Quoted 1 line
Quoted 1 line
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c int xe_gt_tlb_invalidation_wait(struct xe_gt · line 339
Quoted 1 line
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +1
-0+ "GT%u: TLB invalidationtime'd out, seqno=%d, recv=%d",
Quoted 10 lines
Quoted 1 line
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c int xe_gt_tlb_invalidation_wait(struct xe_gt · line 340
Quoted 1 line
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +1
-0+ gt->info.id, seqno, gt-tlb_invalidation.seqno_recv);
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +3
-1+xe_guc_ct_print (&guc->ct, &p, true); +return -ETIME ; + } }return 0 ; --2.25.1