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 661BC1061B1E for ; Mon, 30 Mar 2026 20:15:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19ADA10E7BE; Mon, 30 Mar 2026 20:15:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="BxUXr2pD"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F35010E7BE for ; Mon, 30 Mar 2026 20:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774901701; x=1806437701; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=XQGEHRRgRcxni13XsvZ/lz9cbgRlPbzH16y9B1p6JDM=; b=BxUXr2pDU5QAHkaxLJvIOiy571sFwWlbQ4e/fCjQ5LKEKkbvUZPbjZ+w 1ye8HAmXqOg/A/B38v6Ua2ZIW0RNJa3mWyWLRwJvNWyV2NRDcD2Yoqx34 QvgZC+h2R5/s4qrzo0n+W9ZkKkKY0OOZua6mVlg7X1rZVyp5oo7SfIIov NVI3x1+yJyJVKhUWTiAU8ArbnnDy86fxKs9idldRiMY2tPZpD6WZkT2/w 9EpYS1vVmZGOutP015TaRyWYhvUKXykIzQUr3j2Z+5huxPHH/xQGdGurZ xGjsrC9PpSCMF3SLoyrIt5R5yRealm4YbFlX0ovEVahSgtf3g/y2kB9Fl w==; X-CSE-ConnectionGUID: am0wgP35R8e7LMO5MnQJcQ== X-CSE-MsgGUID: Ri8gPGpKRgSJvZrjxEM/JA== X-IronPort-AV: E=McAfee;i="6800,10657,11744"; a="76096430" X-IronPort-AV: E=Sophos;i="6.23,150,1770624000"; d="scan'208";a="76096430" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2026 13:15:01 -0700 X-CSE-ConnectionGUID: rCwae7YpQPm4w9/lZ5OZKQ== X-CSE-MsgGUID: +UiW+DVeQFaKszIP2E3POA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,150,1770624000"; d="scan'208";a="231082645" Received: from btannenx-mobl.amr.corp.intel.com (HELO adixit-MOBL3.intel.com) ([10.125.41.43]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2026 13:15:00 -0700 Date: Mon, 30 Mar 2026 13:14:59 -0700 Message-ID: <87zf3pxef0.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa Cc: Subject: Re: [PATCH i-g-t] tests/intel/xe_oa: Extend enable-disable to read after disabling stream In-Reply-To: References: <20260317223910.3539034-1-ashutosh.dixit@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/30.2 (x86_64-pc-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 Mon, 30 Mar 2026 10:58:57 -0700, Umesh Nerlige Ramappa wrote: > > On Tue, Mar 17, 2026 at 03:39:10PM -0700, Ashutosh Dixit wrote: > > Extend enable-disable subtest to validate the new feature of reading after > > disabling OA stream. > > > > Signed-off-by: Ashutosh Dixit > > LGTM, > > Reviewed-by: Umesh Nerlige Ramappa > Thanks Umesh, but if you see Xe.CI.FULL results, the test actually fails. See below. > > --- > > tests/intel/xe_oa.c | 25 +++++++++++++++++++++++++ > > 1 file changed, 25 insertions(+) > > > > diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c > > index 387f29535e..6a602a014c 100644 > > --- a/tests/intel/xe_oa.c > > +++ b/tests/intel/xe_oa.c > > @@ -2774,6 +2774,31 @@ test_enable_disable(const struct drm_xe_oa_unit *oau) > > get_stream_status(stream_fd); > > igt_assert_eq(ret, sizeof(buf)); > > > > + /* > > + * Wait again for number of reports specified in > > + * DRM_XE_OA_PROPERTY_WAIT_NUM_REPORTS > > + */ > > + pollfd.fd = stream_fd; > > + pollfd.events = POLLIN; > > + poll(&pollfd, 1, -1); > > + igt_assert(pollfd.revents & POLLIN); > > + > > + do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_DISABLE, 0); > > + > > + /* Ensure num_reports can be read even with disabled stream */ > > + while ((ret = read(stream_fd, buf, sizeof(buf))) < 0 && errno == EINTR) > > + ; > > + get_stream_status(stream_fd); > > + igt_assert_eq(ret, sizeof(buf)); The failure is here, where we sometimes see 1 report instead of 5 (wait_num_reports is 5). I finally figured out how it could happen. Let's say 6 reports were available in the *previous* read (before disabling the stream). Now if we read with a buffer size of 5 reports, in the kernel pollin would remain set. So when we read the next time we only will read 1 report. To get around this I have changed the above assert to just 'igt_assert(ret > 0)' basically: igt_assert_lt(0, ret); Thanks. -- Ashutosh > > + > > + /* In non-blocking mode read till we see a -EAGAIN, signifying all available data is read */ > > + set_fd_flags(stream_fd, O_CLOEXEC | O_NONBLOCK); > > + while ((ret = read(stream_fd, buf, sizeof(buf))) > 0 || > > + (ret == -1 && (errno == EINTR || errno == EIO))) > > + ; > > + igt_assert_eq(ret, -1); > > + igt_assert_eq(errno, EAGAIN); > > + > > __perf_close(stream_fd); > > } > > > > -- > > 2.48.1 > >