]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/tests: Fix g2g_test_array indexing
authorPallavi Mishra <pallavi.mishra@intel.com>
Thu, 29 Jan 2026 05:47:22 +0000 (05:47 +0000)
committerVinay Belgaumkar <vinay.belgaumkar@intel.com>
Thu, 5 Feb 2026 22:10:22 +0000 (14:10 -0800)
commit106340775a8f5ec45e18bab18666f56e4af13d92
tree233e0ba2ea260176710650d022bfc6fd08f16df9
parent9b5e995e61290741b0e2b70fc631cc591e21d499
drm/xe/tests: Fix g2g_test_array indexing

The G2G KUnit test allocates a compact N×N
matrix sized by gt_count and verifies entries
using dense indices: idx = (j * gt_count) + i

The producer path currently computes idx using
gt->info.id. However, gt->info.id values
are not guaranteed to be contiguous.
For example, with gt_count=2 and IDs {0,3},
this formula produces indices beyond the
allocated range, causing mismatches and
potential out-of-bounds access.

Update the producer to map each GT to a dense
index in [0..gt_count-1] and compute:
    idx = (tx_dense * gt_count) + rx_dense

Additionally, introduce an event-based delay
in g2g_test_in_order() to ensure ordering
between sends.

v2: Add single helper function (Daniele)

v3: Modify comment (Daniele)

Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Link: https://patch.msgid.link/20260129054722.2150674-1-pallavi.mishra@intel.com
drivers/gpu/drm/xe/tests/xe_guc_g2g_test.c