Skip to content

Commit 38402b6

Browse files
ksatya-devpiotrkira
authored andcommitted
drm/xe: Add helper function to inject fault into ct_dead_capture()
When injecting fault to xe_guc_ct_send_recv() & xe_guc_mmio_send_recv() functions, the CI test systems are going out of space and crashing. To avoid this issue, a new helper function is created and when fault is injected into this xe_should_fail_ct_dead_capture() helper function, ct dead capture is avoided which suppresses ct dumps in the log. Signed-off-by: Satyanarayana K V P <[email protected]> Suggested-by: John Harrison <[email protected]> Tested-by: Aditya Chauhan <[email protected]>
1 parent 21c916e commit 38402b6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/gpu/drm/xe/xe_guc_ct.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,20 @@ void xe_guc_ct_print(struct xe_guc_ct *ct, struct drm_printer *p, bool want_ctb)
17691769
}
17701770

17711771
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
1772+
/**
1773+
* xe_should_fail_ct_dead_capture - Helper function to inject fault.
1774+
*
1775+
* This is a helper function to inject fault into ct_dead_capture().
1776+
* As fault is injected using this function, need to make sure that
1777+
* the compiler does not optimize and make it as a inline function.
1778+
* To prevent compile optimization, "noinline" is added.
1779+
*/
1780+
static noinline int xe_should_fail_ct_dead_capture(void)
1781+
{
1782+
return 0;
1783+
}
1784+
ALLOW_ERROR_INJECTION(xe_should_fail_ct_dead_capture, ERRNO);
1785+
17721786
static void ct_dead_capture(struct xe_guc_ct *ct, struct guc_ctb *ctb, u32 reason_code)
17731787
{
17741788
struct xe_guc_log_snapshot *snapshot_log;
@@ -1777,6 +1791,13 @@ static void ct_dead_capture(struct xe_guc_ct *ct, struct guc_ctb *ctb, u32 reaso
17771791
unsigned long flags;
17781792
bool have_capture;
17791793

1794+
/*
1795+
* Huge dump is getting generated when injecting error for guc CT/MMIO
1796+
* functions. So, let us suppress the dump when fault is injected.
1797+
*/
1798+
if (xe_should_fail_ct_dead_capture())
1799+
return;
1800+
17801801
if (ctb)
17811802
ctb->info.broken = true;
17821803

0 commit comments

Comments
 (0)