[Intel-xe] [PATCH 7/7] drm/xe/gt: Dump PAT table when failing to initialize

Lucas De Marchi lucas.demarchi at intel.com
Mon Oct 2 21:09:42 UTC 2023


On Fri, Sep 29, 2023 at 01:49:27PM -0700, Matt Roper wrote:
>On Thu, Sep 28, 2023 at 10:02:53PM -0700, Lucas De Marchi wrote:
>> When failing on early initialization, one cause may be that the PAT
>> configuration is not correct. Dump it for ease of debugging.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
>> ---
>>  drivers/gpu/drm/xe/xe_gt.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
>> index 1aa44d4f9ac1..1a750c88cdd6 100644
>> --- a/drivers/gpu/drm/xe/xe_gt.c
>> +++ b/drivers/gpu/drm/xe/xe_gt.c
>> @@ -307,6 +307,17 @@ int xe_gt_init_early(struct xe_gt *gt)
>>  	return 0;
>>  }
>>
>> +static void dump_pat_on_error(struct xe_gt *gt)
>> +{
>> +	struct drm_printer p;
>> +	char prefix[32];
>> +
>> +	snprintf(prefix, sizeof(prefix), "[GT%u Error]", gt->info.id);
>
>Should we put 'PAT' somewhere in the string here so it's clear what all

the number are being printed with:

drm_printf(p, "PAT table:\n");
...
drm_printf(p, "PAT[%2d] = [ %u, %u, %u, %u, %u, %u ]  (%#8x)\n", i,
            !!(pat & XE2_NO_PROMOTE),
            !!(pat & XE2_COMP_EN),
            REG_FIELD_GET(XE2_L3_CLOS, pat),
            REG_FIELD_GET(XE2_L3_POLICY, pat),
            REG_FIELD_GET(XE2_L4_POLICY, pat),
            REG_FIELD_GET(XE2_COH_MODE, pat),
            pat);

So, I don't think we should add another PAT string.

Lucas De Marchi


>the numbers getting dumped are supposed to be?  Or else add a
>drm_printf() to add a "title" before calling the dump command below?
>
>Up to you.
>
>Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
>
>> +	p = drm_debug_printer(prefix);
>> +
>> +	xe_pat_dump(gt, &p);
>> +}
>> +
>>  static int gt_fw_domain_init(struct xe_gt *gt)
>>  {
>>  	int err, i;
>> @@ -360,6 +371,7 @@ static int gt_fw_domain_init(struct xe_gt *gt)
>>  	return 0;
>>
>>  err_force_wake:
>> +	dump_pat_on_error(gt);
>>  	xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
>>  err_hw_fence_irq:
>>  	for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
>> --
>> 2.40.1
>>
>
>-- 
>Matt Roper
>Graphics Software Engineer
>Linux GPU Platform Enablement
>Intel Corporation


More information about the Intel-xe mailing list