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 0DCAFC54756 for ; Thu, 22 May 2025 06:37:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 169D096A31; Thu, 22 May 2025 06:37:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="SCVuo991"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 094E596B27 for ; Thu, 22 May 2025 06:37:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747895835; x=1779431835; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=jIkWfoyWhHh7gcgvMGurdSzsc9nq4i8JILioBENqmHk=; b=SCVuo991BLlrei9nTcyG6JJQllLPmS6qr/E3mDL7yXnx3I/NvfyEBBxL zBrieqSBOJn5ArM8EUUzG+eM4bQwzC256qG3P1PtRwo9yV6VcjUsKjmon BRdZ4brVNW66RORURxnf0N0e2FlEELztUPJxWNG3+wKZhsBJLGNKKmjDy pNEkQWcyjARXpdBTevISwSCQ5nHgCjznGuOaZ8l2hZNjF33d4mP2EgkHW ReeFIDxyVMa0fG2AV2eOGclyoN6LpwutRbatoC+64rCP3LtZnrqjUCV8H VCYly747PMFxWn13H0lVoIvFNWYg/F3CThkVzzra4SxScUanLSt3E03zc A==; X-CSE-ConnectionGUID: lVWnDc8MTru0kDKaJtLC5A== X-CSE-MsgGUID: A+dopB8oRIqyNbZAbS+9gA== X-IronPort-AV: E=McAfee;i="6700,10204,11440"; a="49779789" X-IronPort-AV: E=Sophos;i="6.15,305,1739865600"; d="scan'208";a="49779789" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2025 23:37:14 -0700 X-CSE-ConnectionGUID: WbLrorJ3T4a6nyV6DHy+Gg== X-CSE-MsgGUID: YEA0bkx9QPWm9sI0cx8Ndw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,305,1739865600"; d="scan'208";a="177604473" Received: from rvenkat1-mobl2.amr.corp.intel.com (HELO adixit-MOBL3.intel.com) ([10.125.181.75]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2025 23:37:14 -0700 Date: Wed, 21 May 2025 23:37:13 -0700 Message-ID: <87ldqp40di.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa Cc: Subject: Re: [PATCH] tests/intel/xe_oa: Ignore other errors when looking for buffer overflow In-Reply-To: References: <20250520195249.326080-2-umesh.nerlige.ramappa@intel.com> <87o6vl4tar.wl-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/29.4 (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 Wed, 21 May 2025 13:25:02 -0700, Umesh Nerlige Ramappa wrote: > > On Wed, May 21, 2025 at 01:12:28PM -0700, Dixit, Ashutosh wrote: > > On Tue, 20 May 2025 12:52:50 -0700, Umesh Nerlige Ramappa wrote: > >> > >> Occassionally other error bits will result in EIO and prematurely end > >> the buffer-fill test. For this test, ignore other errors. > >> > >> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4565 > > > > From CI buglog it looks like, a REPORT_LOST (0x1) status is returned before > > BUFFER_OVERFLOW (0x2) status? > > In this case yes, but I have seem other occurrences where counter overflow > bit is set before buffer overflow. > > > > > Patch generally looks ok, but a question below. > > > > > >> Signed-off-by: Umesh Nerlige Ramappa > >> --- > >> tests/intel/xe_oa.c | 17 +++++++++++------ > >> 1 file changed, 11 insertions(+), 6 deletions(-) > >> > >> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c > >> index 73841a359daf..2022c5cb3955 100644 > >> --- a/tests/intel/xe_oa.c > >> +++ b/tests/intel/xe_oa.c > >> @@ -2520,7 +2520,6 @@ test_buffer_fill(const struct drm_xe_engine_class_instance *hwe) > >> char *buf = malloc(1024); > >> bool overflow_seen; > >> u32 oa_status; > >> - int len; > >> > >> igt_debug("oa_period %s\n", pretty_print_oa_period(oa_period)); > >> stream_fd = __perf_open(drm_fd, ¶m, true /* prevent_pm */); > >> @@ -2535,16 +2534,22 @@ test_buffer_fill(const struct drm_xe_engine_class_instance *hwe) > >> > >> errno = 0; > >> /* Read 0 bytes repeatedly until you see an EIO */ > >> - while ((len = read(stream_fd, buf, 0)) == -1 && (errno == EINTR || errno == ENOSPC)) { > >> + while (-1 == read(stream_fd, buf, 0)) { > >> + if (errno == EIO) { > >> + oa_status = get_stream_status(stream_fd); > >> + overflow_seen = oa_status & DRM_XE_OASTATUS_BUFFER_OVERFLOW; > >> + if (overflow_seen) > >> + break; > >> + } > >> usleep(100); > >> } > >> - igt_assert_eq(len, -1); > >> - igt_assert_eq(errno, EIO); > >> + igt_assert(overflow_seen); > >> > >> - /* Ensure buffer overflowed */ > >> + /* Make sure the buffer overflow is cleared */ > >> + read(stream_fd, buf, 0); > > > > How does the buffer overflow status get cleared? We are still doing 0 size reads? > > Hoping I understood what you are asking: > > It would have been cleared as part of the read itself since the KMD > implementation is doing a read-modify-write. Right? After that a subsequent > read should have that bit set to 0. > > The 0 size reads do not seem to affect the OA status update. So the KMD > state should be pointing to the last values stored during read(). OK, yes, so KMD is clearing the status and because overrun is enabled, the next time buffer overflow is set will be after the whole buffer fills up again. So hopefully we will not hit that. Otherwise we'll see what to do. So for now this is: Reviewed-by: Ashutosh Dixit > > Regards, > Umesh > > > >> oa_status = get_stream_status(stream_fd); > >> overflow_seen = oa_status & DRM_XE_OASTATUS_BUFFER_OVERFLOW; > >> - igt_assert(overflow_seen); > >> + igt_assert_eq(overflow_seen, 0); > >> > >> __perf_close(stream_fd); > >> } > >> -- > >> 2.43.0 > >> > > > > Thanks. > > -- > > Ashutosh