From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B96F3C3DA61 for ; Mon, 29 Jul 2024 07:00:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A04410E083; Mon, 29 Jul 2024 07:00:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="fTKcgPAo"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C5F510E083 for ; Mon, 29 Jul 2024 07:00:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722236437; x=1753772437; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=eE3btEVClyZEIPmH6oDpNjPQBo1tD6DQ1vIam/oq8UU=; b=fTKcgPAoeori/G2MqDhznicHKU+zcRLQkjZbirnPAYjjW/gwEAtUjGCd AuJJ18K6CM4aOd+AFb2EQZbpuwJiuq+d0qfIDZl/GgpW4WUDdT5sjkMoA ZYjnJLM5xygqR8NHXysvSdZ2EJznbCktU8zl23NWxqEQ54KOW9zusSOdi KK7DPcPkjV9KrmLCeXC5pB50M6OTEya6rGKDozFB5v4rDm5l72wUGiI26 xHWQxHveTYC1r9JPNU/HSbM7d0/GwkFZETxyo2NNQNTPj6wjKD5CtDASb gIGKCljNqljNKhyqOa6B+hMh35JcfwNW4Vo9/jElbWxGMD7ynzgtU1Kxl Q==; X-CSE-ConnectionGUID: mCxU+ty/QVGXDmYk9EcLyg== X-CSE-MsgGUID: pIcMM5ppSh+pHmrD3hIX4w== X-IronPort-AV: E=McAfee;i="6700,10204,11147"; a="23761359" X-IronPort-AV: E=Sophos;i="6.09,245,1716274800"; d="scan'208";a="23761359" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2024 00:00:32 -0700 X-CSE-ConnectionGUID: OxAFVKjtS66Hi69P7Q58wg== X-CSE-MsgGUID: h2hvuxVSSj+NU+pqgdVsaA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,245,1716274800"; d="scan'208";a="77128532" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.138]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2024 00:00:31 -0700 Date: Mon, 29 Jul 2024 00:00:30 -0700 Message-ID: <85y15k7kdt.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Peter Senna Tschudin Cc: "igt-dev@lists.freedesktop.org" , Kamil Konieczny Subject: Re: [PATCH i-g-t v3] Do not require QUERY_OA_UNITS for all Xe tests In-Reply-To: References: <78c5f531-f482-49c7-8290-38710698e4a7@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-redhat-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" On Sun, 28 Jul 2024 22:25:39 -0700, Peter Senna Tschudin wrote: > > Changes xe_query_oa_units_new() to return NULL instead of aborting > due to assertion failure when querying for DRM_XE_DEVICE_QUERY_OA_UNITS. > > It adds a skip to xe_oa.c to make sure it will not try to run the tests if the > query has failed before. > > The motivation is as follows: > - The only test that requires oa_units is tests/intel/xe_oa.c, however current > code will prevent all Xe tests from running if OA_UNITS is not supported > - Before this patch, trying to run IGT on the Xe module from Fedora 40 > (6.9.9-200.fc40.x86_64) fails > - After this patch, we can run some tests, such as xe_exec_basic > successfully > > Here is an example of the impact of this patch: > 1. Use Fedora 40 with the following kernel command line arguments: > "xe.force_probe=* i915.force_probe=!* modprobe.blacklist=i915,ast,snd_hda_intel,xe" > > 2. Running IGT without this patch will fail: > $ sudo ./build/tests/xe_exec_basic > $ echo $? > 98 > > 3. Running after fix applied will succeed: > sudo ./build/tests/xe_exec_basic > $ sudo ./build/tests/xe_exec_basic > $ echo $? > 0 > > V3: > - Update comment syntax and shorten comments > - Update comment content to describe from kernel version perspective only > - Update test to make '!= 0' implicit Reviewed-by: Ashutosh Dixit > V2: > - Cleanup headers from message body > - Add 'lib/xe/xe_query:' to subject line > > Signed-off-by: Peter Senna Tschudin > --- > lib/xe/xe_query.c | 4 +++- > tests/intel/xe_oa.c | 6 +++++- > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c > index 84eaaac96..8694fa3f9 100644 > --- a/lib/xe/xe_query.c > +++ b/lib/xe/xe_query.c > @@ -124,7 +124,9 @@ static struct drm_xe_query_oa_units *xe_query_oa_units_new(int fd) > .data = 0, > }; > > - igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), 0); > + /* Support older kernels where this uapi is not yet available */ > + if (igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query)) > + return NULL; > > oa_units = malloc(query.size); > igt_assert(oa_units); > diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c > index ff2218300..1f82dce06 100644 > --- a/tests/intel/xe_oa.c > +++ b/tests/intel/xe_oa.c > @@ -4503,6 +4503,7 @@ static const char *xe_engine_class_name(uint32_t engine_class) > igt_main > { > struct drm_xe_engine_class_instance *hwe = NULL; > + struct xe_device *xe_dev; > > igt_fixture { > struct stat sb; > @@ -4527,7 +4528,10 @@ igt_main > igt_assert_eq(drm_fd, -1); > > drm_fd = drm_open_driver(DRIVER_XE); > - xe_device_get(drm_fd); > + xe_dev = xe_device_get(drm_fd); > + > + /* See xe_query_oa_units_new() */ > + igt_require(xe_dev->oa_units); > > devid = intel_get_drm_devid(drm_fd); > sysfs = igt_sysfs_open(drm_fd); > -- > 2.34.1 >