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 795BDC369C9 for ; Thu, 17 Apr 2025 23:00:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2208D10E3D4; Thu, 17 Apr 2025 23:00:55 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="OZ4a8Fbj"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id E867410E3D7 for ; Thu, 17 Apr 2025 23:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744930853; x=1776466853; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=yIRVO8TBsh9cnGG1X3pOjZOW75/dgr2+p6+igT7Sg18=; b=OZ4a8FbjJFuK+0C/k7dZnzEBGvMQw05zTC9Bx/3X9vh9HacexnrgsB7x D+3GUI3KZNBUSTDfu6oH4y05QHX4MY1ZN9tnnWoCGB06W5ZsA9E5Msw35 5uzLLocNTH70sKxOCy0VhnJI8P2A2br5Lq462483iHO07oS2z0drQcJxH boiIYbVYWTeT9hESI5t20kHtzqL26TNw6bClsT/V6e2P7CwcBi7qzmGeZ Vut0Qu11rilURvjOjryp8QHDgycNzJ9YkU7HrgJhi4dT1gajydl3dIE1b UUaDW6fTtz1nUCjp/FV7d2YkNM8uY64lVtZkISZqgVmovzbz7yV1PZwxo A==; X-CSE-ConnectionGUID: 9QlpzZmWRiy+9xviTdeubA== X-CSE-MsgGUID: KhsnUxu4Sey7YpDoviXC1Q== X-IronPort-AV: E=McAfee;i="6700,10204,11406"; a="46442013" X-IronPort-AV: E=Sophos;i="6.15,220,1739865600"; d="scan'208";a="46442013" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2025 16:00:52 -0700 X-CSE-ConnectionGUID: A4dYFnppRiWVW3KCQzKIxQ== X-CSE-MsgGUID: E0Zi082bRkGgkK9JrEXe0Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,220,1739865600"; d="scan'208";a="168161998" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.142]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2025 16:00:52 -0700 Date: Thu, 17 Apr 2025 16:00:51 -0700 Message-ID: <85zfgeqtp8.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa Cc: Subject: Re: [PATCH i-g-t] tests/intel/xe_oa: Save and restore errno in get_stream_status In-Reply-To: <20250417223931.5504-1-umesh.nerlige.ramappa@intel.com> References: <20250417223931.5504-1-umesh.nerlige.ramappa@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-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 Thu, 17 Apr 2025 15:39:31 -0700, Umesh Nerlige Ramappa wrote: > > Turns out that get_stream_status resets errno and anything that checks > errno afterwards fails. This resulted in a bunch of test failures. Fix > it by saving and restoring errno within get_stream_status. > > v2: Go back to calling get_stream_status unconditionally (Ashutosh) Reviewed-by: Ashutosh Dixit > > Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4804 > Signed-off-by: Umesh Nerlige Ramappa > --- > tests/intel/xe_oa.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c > index 1fc8bfaafee2..a219f80fdcf3 100644 > --- a/tests/intel/xe_oa.c > +++ b/tests/intel/xe_oa.c > @@ -380,9 +380,11 @@ static void set_fd_flags(int fd, int flags) > static u32 get_stream_status(int fd) > { > struct drm_xe_oa_stream_status status; > + int _e = errno; > > do_ioctl(fd, DRM_XE_OBSERVATION_IOCTL_STATUS, &status); > igt_debug("oa status %llx\n", status.oa_status); > + errno = _e; > > return status.oa_status; > } > -- > 2.45.2 >