[Intel-gfx] [CI] drm/i915/gt: Refactor hangcheck selftest to use igt_spinner

John Harrison john.c.harrison at intel.com
Tue Aug 22 17:59:03 UTC 2023


On 8/19/2023 15:50, Andi Shyti wrote:
> From: Jonathan Cavitt <jonathan.cavitt at intel.com>
>
> The hangcheck live selftest contains duplicate declarations of some
> functions that already exist in igt_spinner.c, such as the creation and
> deconstruction of a spinning batch buffer (spinner) that hangs an engine.
> It's undesireable to have such code duplicated, as the requirements for
> the spinner may change with hardware updates, necessitating both
> execution paths be updated.  To avoid this, have the hangcheck live
> selftest use the declaration from igt_spinner.  This eliminates the need
> for the declarations in the selftest itself, as well as the associated
> local helper structures, so we can erase those.
>
> Suggested-by: Matt Roper <matthew.d.roper at intel.com>
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
> ---
>   drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 457 ++++++-------------
>   drivers/gpu/drm/i915/selftests/igt_spinner.c |  15 +-
>   drivers/gpu/drm/i915/selftests/igt_spinner.h |   9 +
>   3 files changed, 155 insertions(+), 326 deletions(-)
[snip]

> -		pr_err("[%s] Hang init failed: %d!\n", engine->name, err);
> +		pr_err("[%s] Spinner init failed: %d!\n", engine->name, err);
If this code is being touched, can you also change it to use gt_err 
instead of pr_err? And gt_info instead of pr_info, etc. The pr_err 
functions are the worst of the worst for message prints, they don't even 
tag the output with 'i915' let alone anything useful like which GT it 
was or which card in a multi-card system.

John.



More information about the Intel-gfx mailing list