[Intel-xe] [PATCH v2 26/30] drm/xe/tlb: Obtain forcewake when doing GGTT TLB invalidations
Das, Nirmoy
nirmoy.das at linux.intel.com
Mon May 22 11:47:35 UTC 2023
On 5/20/2023 1:18 AM, Matt Roper wrote:
> Updates to the GGTT can happen when there are no in-flight jobs keeping
> the hardware awake. If the GT is powered down when invalidation is
> requested, we will not be able to communicate with the GuC (or MMIO) and
> the invalidation request will go missing. Explicitly grab GT forcewake
> to ensure the GT and GuC are powered up during the TLB invalidation.
>
> Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
> Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
> drivers/gpu/drm/xe/xe_ggtt.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
> index 31f958613c2f..8f8d0f6a82cd 100644
> --- a/drivers/gpu/drm/xe/xe_ggtt.c
> +++ b/drivers/gpu/drm/xe/xe_ggtt.c
> @@ -193,6 +193,13 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt)
> if (!gt)
> return;
>
> + /*
> + * Invalidation can happen when there's no in-flight work keeping the
> + * GT awake. We need to explicitly grab forcewake to ensure the GT
> + * and GuC are accessible.
> + */
> + xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> +
> /* TODO: vfunc for GuC vs. non-GuC */
>
> if (gt->uc.guc.submission_state.enabled) {
> @@ -214,6 +221,8 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt)
> xe_mmio_write32(gt, GUC_TLB_INV_CR,
> GUC_TLB_INV_CR_INVALIDATE);
> }
> +
> + xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
> }
>
> void xe_ggtt_invalidate(struct xe_ggtt *ggtt)
More information about the Intel-xe
mailing list