[Intel-xe] [PATCH] drm/xe: Move wa processing to gt_init
Lucas De Marchi
lucas.demarchi at intel.com
Tue Nov 21 14:48:47 UTC 2023
On Tue, Nov 21, 2023 at 04:55:55PM +0530, Tejas Upadhyay wrote:
>Currently WA processing for gt is happening in early init API.
>It also includes processing of WAs which needs filter based on
>hardware engine by looping over number of hardware engines in gt.
>
>However at early init stage hardware engines are not associated
>with gt in software which skips processing such WAs.
>
>Example WAs which will be fixed to apply after this change,
>"14011060649",
>"16010515920",
>"16021867713"
>
>Fixes: 811a9b3d262d8 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
>Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
>---
> drivers/gpu/drm/xe/xe_gt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
>index 0dddb751c6a4..3d0f7b6f952c 100644
>--- a/drivers/gpu/drm/xe/xe_gt.c
>+++ b/drivers/gpu/drm/xe/xe_gt.c
>@@ -311,7 +311,6 @@ int xe_gt_init_early(struct xe_gt *gt)
> if (err)
> return err;
>
>- xe_wa_process_gt(gt);
> xe_wa_process_oob(gt);
> xe_tuning_process_gt(gt);
>
>@@ -495,6 +494,7 @@ int xe_gt_init(struct xe_gt *gt)
> if (err)
> return err;
>
>+ xe_wa_process_gt(gt);
the problem with that is that if we need to touch any register already
touched until this point, the workarounds would not had been applied.
Digging the git history, I had added this commit exactly to be able to
initialize the gt workarounds as soon as possible:
4eb2e8d25ab4 ("drm/xe: Add xe_hw_engines_init_early()")
And then
816d37907ac6 ("drm/xe: Plug gt WAs to gt init/reset")
Note that these commits are in the xe branch, not drm-xe-next.
So, it was:
xe_hw_engines_init_early(gt);
...
xe_wa_process_gt();
That gt_fw_domain_init() seems a very poor place to initialize these
things now. It started with commit b892e30c6cd7 ("drm/xe: Move load of
minimal GuC and hwconfig read much earlier") and then people end up
adding random stuff in that function :(
So I think we need to get back to the original idea of _early()
initializing what's needed. Then we'd probably need a few cleanups in
the initialization sequence so the function names at least partially
matches what's being initialized.
Lucas De Marchi
> xe_force_wake_init_engines(gt, gt_to_fw(gt));
>
> err = all_fw_domain_init(gt);
>--
>2.25.1
>
More information about the Intel-xe
mailing list