Commit 757d9fdf authored by Matthew Brost's avatar Matthew Brost Committed by Rodrigo Vivi
Browse files

drm/xe: Remove XE_GUC_CT_SELFTEST



XE_GUC_CT_SELFTEST enabled a debugfs entry to which ran a very simple
selftest ensuring the GuC CT code worked. This was added before the
kunit framework was available and before submissions were working too.
This test isn't worth porting over to the kunit frame as if the GuC CT
didn't work, literally almost nothing would work so just remove this.

Suggested-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent fe58a243
Loading
Loading
Loading
Loading
+0 −65
Original line number Diff line number Diff line
@@ -1310,68 +1310,3 @@ void xe_guc_ct_print(struct xe_guc_ct *ct, struct drm_printer *p, bool atomic)
	xe_guc_ct_snapshot_print(snapshot, p);
	xe_guc_ct_snapshot_free(snapshot);
}

#ifdef XE_GUC_CT_SELFTEST
/*
 * Disable G2H processing in IRQ handler to force xe_guc_ct_send to enter flow
 * control if enough sent, 8k sends is enough. Verify forward process, verify
 * credits expected values on exit.
 */
void xe_guc_ct_selftest(struct xe_guc_ct *ct, struct drm_printer *p)
{
	struct guc_ctb *g2h = &ct->ctbs.g2h;
	u32 action[] = { XE_GUC_ACTION_SCHED_ENGINE_MODE_SET, 0, 0, 1, };
	u32 bad_action[] = { XE_GUC_ACTION_SCHED_CONTEXT_MODE_SET, 0, 0, };
	int ret;
	int i;

	ct->suppress_irq_handler = true;
	drm_puts(p, "Starting GuC CT selftest\n");

	for (i = 0; i < 8192; ++i) {
		ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 4, 1);
		if (ret) {
			drm_printf(p, "Aborted pass %d, ret %d\n", i, ret);
			xe_guc_ct_print(ct, p, true);
			break;
		}
	}

	ct->suppress_irq_handler = false;
	if (!ret) {
		xe_guc_ct_irq_handler(ct);
		msleep(200);
		if (g2h->info.space !=
		    CIRC_SPACE(0, 0, g2h->info.size) - g2h->info.resv_space) {
			drm_printf(p, "Mismatch on space %d, %d\n",
				   g2h->info.space,
				   CIRC_SPACE(0, 0, g2h->info.size) -
				   g2h->info.resv_space);
			ret = -EIO;
		}
		if (ct->g2h_outstanding) {
			drm_printf(p, "Outstanding G2H, %d\n",
				   ct->g2h_outstanding);
			ret = -EIO;
		}
	}

	/* Check failure path for blocking CTs too */
	xe_guc_ct_send_block(ct, bad_action, ARRAY_SIZE(bad_action));
	if (g2h->info.space !=
	    CIRC_SPACE(0, 0, g2h->info.size) - g2h->info.resv_space) {
		drm_printf(p, "Mismatch on space %d, %d\n",
			   g2h->info.space,
			   CIRC_SPACE(0, 0, g2h->info.size) -
			   g2h->info.resv_space);
		ret = -EIO;
	}
	if (ct->g2h_outstanding) {
		drm_printf(p, "Outstanding G2H, %d\n",
			   ct->g2h_outstanding);
		ret = -EIO;
	}

	drm_printf(p, "GuC CT selftest done - %s\n", ret ? "FAIL" : "PASS");
}
#endif
+0 −9
Original line number Diff line number Diff line
@@ -25,13 +25,8 @@ void xe_guc_ct_print(struct xe_guc_ct *ct, struct drm_printer *p, bool atomic);
static inline void xe_guc_ct_irq_handler(struct xe_guc_ct *ct)
{
	wake_up_all(&ct->wq);
#ifdef XE_GUC_CT_SELFTEST
	if (!ct->suppress_irq_handler && ct->enabled)
		queue_work(system_unbound_wq, &ct->g2h_worker);
#else
	if (ct->enabled)
		queue_work(system_unbound_wq, &ct->g2h_worker);
#endif
	xe_guc_ct_fast_path(ct);
}

@@ -61,8 +56,4 @@ xe_guc_ct_send_block_no_fail(struct xe_guc_ct *ct, const u32 *action, u32 len)
	return xe_guc_ct_send_recv_no_fail(ct, action, len, NULL);
}

#ifdef XE_GUC_CT_SELFTEST
void xe_guc_ct_selftest(struct xe_guc_ct *ct, struct drm_printer *p);
#endif

#endif
+0 −6
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@

#include "abi/guc_communication_ctb_abi.h"

#define XE_GUC_CT_SELFTEST

struct xe_bo;

/**
@@ -110,10 +108,6 @@ struct xe_guc_ct {
	wait_queue_head_t wq;
	/** @g2h_fence_wq: wait queue used for G2H fencing */
	wait_queue_head_t g2h_fence_wq;
#ifdef XE_GUC_CT_SELFTEST
	/** @suppress_irq_handler: force flow control to sender */
	bool suppress_irq_handler;
#endif
	/** @msg: Message buffer */
	u32 msg[GUC_CTB_MSG_MAX_LEN];
	/** @fast_msg: Message buffer */
+0 −18
Original line number Diff line number Diff line
@@ -58,27 +58,9 @@ static int guc_log(struct seq_file *m, void *data)
	return 0;
}

#ifdef XE_GUC_CT_SELFTEST
static int guc_ct_selftest(struct seq_file *m, void *data)
{
	struct xe_guc *guc = node_to_guc(m->private);
	struct xe_device *xe = guc_to_xe(guc);
	struct drm_printer p = drm_seq_file_printer(m);

	xe_device_mem_access_get(xe);
	xe_guc_ct_selftest(&guc->ct, &p);
	xe_device_mem_access_put(xe);

	return 0;
}
#endif

static const struct drm_info_list debugfs_list[] = {
	{"guc_info", guc_info, 0},
	{"guc_log", guc_log, 0},
#ifdef XE_GUC_CT_SELFTEST
	{"guc_ct_selftest", guc_ct_selftest, 0},
#endif
};

void xe_guc_debugfs_register(struct xe_guc *guc, struct dentry *parent)