From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB22310E37C for ; Mon, 11 Dec 2023 09:43:59 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------PwGBJaFCiXn2YWUPxD2EQ6u0" Message-ID: <97d5c699-d900-47d8-aab3-dccb2439f819@intel.com> Date: Mon, 11 Dec 2023 10:43:53 +0100 Subject: Re: [PATCH v2 i-g-t] benchmarks/gem_wsim: Fix array index issue in xe_sync object referencing To: Marcin Bernatowicz , References: <20231208102438.12894-1-marcin.bernatowicz@linux.intel.com> Content-Language: pl From: "Laguna, Lukasz" In-Reply-To: <20231208102438.12894-1-marcin.bernatowicz@linux.intel.com> MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: --------------PwGBJaFCiXn2YWUPxD2EQ6u0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit On 12/8/2023 11:24, Marcin Bernatowicz wrote: > During the split of xe_sync types from flags introduced in commit > ce4e53b0faec ("drm-uapi/xe: Split xe_sync types from flags"), the array > index of xe_sync objects was unnecessarily incremented in one of the lines. > This caused the next line to reference the wrong xe_sync object. > > This patch fixes the array index issue, ensuring the correct xe_sync > object is referenced. > > Fixes: ce4e53b0faec ("drm-uapi/xe: Split xe_sync types from flags") > Signed-off-by: Marcin Bernatowicz > --- > benchmarks/gem_wsim.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c > index e937e1027..30673da8f 100644 > --- a/benchmarks/gem_wsim.c > +++ b/benchmarks/gem_wsim.c > @@ -1784,7 +1784,7 @@ xe_alloc_step_batch(struct workload *wrk, struct w_step *w) > i = 0; > /* out fence */ > w->xe.syncs[i].handle = syncobj_create(fd, 0); > - w->xe.syncs[i++].type = DRM_XE_SYNC_TYPE_SYNCOBJ; > + w->xe.syncs[i].type = DRM_XE_SYNC_TYPE_SYNCOBJ; > w->xe.syncs[i++].flags = DRM_XE_SYNC_FLAG_SIGNAL; > /* in fence(s) */ > for_each_dep(dep, w->data_deps) { Reviewed-by: Lukasz Laguna > --------------PwGBJaFCiXn2YWUPxD2EQ6u0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 7bit


On 12/8/2023 11:24, Marcin Bernatowicz wrote:
During the split of xe_sync types from flags introduced in commit
ce4e53b0faec ("drm-uapi/xe: Split xe_sync types from flags"), the array
index of xe_sync objects was unnecessarily incremented in one of the lines.
This caused the next line to reference the wrong xe_sync object.

This patch fixes the array index issue, ensuring the correct xe_sync
object is referenced.

Fixes: ce4e53b0faec ("drm-uapi/xe: Split xe_sync types from flags")
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
 benchmarks/gem_wsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index e937e1027..30673da8f 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -1784,7 +1784,7 @@ xe_alloc_step_batch(struct workload *wrk, struct w_step *w)
 	i = 0;
 	/* out fence */
 	w->xe.syncs[i].handle = syncobj_create(fd, 0);
-	w->xe.syncs[i++].type = DRM_XE_SYNC_TYPE_SYNCOBJ;
+	w->xe.syncs[i].type = DRM_XE_SYNC_TYPE_SYNCOBJ;
 	w->xe.syncs[i++].flags = DRM_XE_SYNC_FLAG_SIGNAL;
 	/* in fence(s) */
 	for_each_dep(dep, w->data_deps) {

Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>

--------------PwGBJaFCiXn2YWUPxD2EQ6u0--