While debugging an issue with full GT resets I went down a rabbit hole thinking the scrubbing of lost G2H wasn't working correctly. This proved to be incorrect as this was working just fine but this chase inspired me to write a selftest to prove that this works. This simple selftest injects errors dropping various G2H and then issues a full GT reset proving that the scrubbing of these G2H doesn't blow up. v2: (Daniel Vetter) - Use ifdef instead of macros for selftests v3: (Checkpatch) - A space after 'switch' statement v4: (Daniele) - A comment saying GT won't idle if G2H are lost Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210909164744.31249-12-matthew.brost@intel.com
36 lines
907 B
C
36 lines
907 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2021 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _INTEL_SELFTEST_SCHEDULER_HELPERS_H_
|
|
#define _INTEL_SELFTEST_SCHEDULER_HELPERS_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct i915_request;
|
|
struct intel_engine_cs;
|
|
struct intel_gt;
|
|
|
|
struct intel_selftest_saved_policy {
|
|
u32 flags;
|
|
u32 reset;
|
|
u64 timeslice;
|
|
u64 preempt_timeout;
|
|
};
|
|
|
|
enum selftest_scheduler_modify {
|
|
SELFTEST_SCHEDULER_MODIFY_NO_HANGCHECK = 0,
|
|
SELFTEST_SCHEDULER_MODIFY_FAST_RESET,
|
|
};
|
|
|
|
struct intel_engine_cs *intel_selftest_find_any_engine(struct intel_gt *gt);
|
|
int intel_selftest_modify_policy(struct intel_engine_cs *engine,
|
|
struct intel_selftest_saved_policy *saved,
|
|
enum selftest_scheduler_modify modify_type);
|
|
int intel_selftest_restore_policy(struct intel_engine_cs *engine,
|
|
struct intel_selftest_saved_policy *saved);
|
|
int intel_selftest_wait_for_rq(struct i915_request *rq);
|
|
|
|
#endif
|