drm/xe: Remove XE_GUC_CT_SELFTEST
authorMatthew Brost <matthew.brost@intel.com>
Fri, 28 Jul 2023 02:00:14 +0000 (19:00 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:39:16 +0000 (11:39 -0500)
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: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_guc_ct.c
drivers/gpu/drm/xe/xe_guc_ct.h
drivers/gpu/drm/xe/xe_guc_ct_types.h
drivers/gpu/drm/xe/xe_guc_debugfs.c

index cb75db30800ce5cc86254fa8182ab05cc6718618..3f5084c6ffc86c7bf59d10d5a27e849063e29846 100644 (file)
@@ -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
index 3e04ee64652c1ec4cac422070da1cb5085f17981..f15f8a4857e07e12c036c4f6f72736c9527e52ff 100644 (file)
@@ -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
index 93046d95b009eb9045dd77905136593ae1db60f0..dedbd686428ba0f8e28a014897a7faaf189ad8f7 100644 (file)
@@ -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 */
index b43c70de7e37370a8c63a03245dc3500ed439b7b..167eb5593e03ca3936b0adb2dafcda7c5a4e0cf9 100644 (file)
@@ -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)