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 D326ACAC5A7 for ; Thu, 25 Sep 2025 12:38:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90A6810E2C7; Thu, 25 Sep 2025 12:38:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="OVvrSOG0"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 33AF810E8FC for ; Thu, 25 Sep 2025 12:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758803884; x=1790339884; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eUh5vB6pkxdgD3ZxREvBZaY5buj1bZgCTXY+L1CcTXc=; b=OVvrSOG02Wb998AfhFsp1v7tvVt3IwT8MmebDiaPBlNSVCITxID4MUJJ w3HcUoUuKnMRF/QQizxtQg1eLMgqMIHgAfvhQBKRT6rPSZv7yyr/cHkeN FY09TScIhRwqQCy5RQBftTh0Gw8zKbEE6+mtEzY3tk3g2J2I4t/0wdAnz GfJDeONBBh26w4uNea07qz26nrbZDyM0TA8jp4XImdbF5FOGYNmF0dtaL KbwF/mvEsJCpzdmDcXkbFIGl4p/KaGrr1dyfTMjXXXf6daxa9/VUc0i4z Lswn9Nbee+3swHt0/Qd7SxXgdR/5FVtwGzaLmC4TBD7gdUX5vapydqfhM g==; X-CSE-ConnectionGUID: gTxglHBLTCCFHLSHRqHdiA== X-CSE-MsgGUID: +mz6rUnjQMqGRx5aq6v2Vg== X-IronPort-AV: E=McAfee;i="6800,10657,11563"; a="61226507" X-IronPort-AV: E=Sophos;i="6.18,292,1751266800"; d="scan'208";a="61226507" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2025 05:38:04 -0700 X-CSE-ConnectionGUID: 8MOhzA8sTCO6CihetCRoKg== X-CSE-MsgGUID: u2Fa8v2pTwqfyue/bw5WEg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,292,1751266800"; d="scan'208";a="176894433" Received: from pgcooper-mobl3.ger.corp.intel.com (HELO dpiatkow-mobl1.mshome.net) ([10.245.244.53]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2025 05:38:02 -0700 From: =?UTF-8?q?Dominik=20Karol=20Pi=C4=85tkowski?= To: igt-dev@lists.freedesktop.org Cc: =?UTF-8?q?Zbigniew=20Kempczy=C5=84ski?= , Mika Kuoppala , Christoph Manszewski , =?UTF-8?q?Dominik=20Karol=20Pi=C4=85tkowski?= Subject: [PATCH v6 i-g-t 1/9] lib/xe_eudebug: Fix safe_pipe_read Date: Thu, 25 Sep 2025 14:37:37 +0200 Message-Id: <20250925123745.15721-2-dominik.karol.piatkowski@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250925123745.15721-1-dominik.karol.piatkowski@intel.com> References: <20250925123745.15721-1-dominik.karol.piatkowski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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" In case of poll() failure, safe_pipe_read returns -ETIMEDOUT that can be misleading, as the underlying error may be different. Do an early return with -errno if the poll fails. Signed-off-by: Dominik Karol PiÄ…tkowski --- lib/xe/xe_eudebug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/xe/xe_eudebug.c b/lib/xe/xe_eudebug.c index 667c31c6e..d29c82857 100644 --- a/lib/xe/xe_eudebug.c +++ b/lib/xe/xe_eudebug.c @@ -271,6 +271,8 @@ static int safe_pipe_read(int pipe[2], void *buf, int nbytes, int timeout_ms) if (!ret) { catch_child_failure(); t += interval_ms; + } else if (ret == -1) { + return -errno; } } while (!ret && t < timeout_ms); -- 2.34.1