From patchwork Fri Jul 26 08:34:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 13742490 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 3F643C52D1D for ; Fri, 26 Jul 2024 08:40:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB46610E2E2; Fri, 26 Jul 2024 08:40:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="RE8Xa3EB"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 62C4C10E027; Fri, 26 Jul 2024 08:40:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721983256; x=1753519256; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KUIsNVfb3a0rUEWJ95cv4D+/nROly11Sq37YDXprtEY=; b=RE8Xa3EBPRH6fdWTHCGCtj500rotYqlBWA1jhSugHn7v2t/gQ9xk+B7b oo8JxclJchZanyeqN16XmqYyLMFLIHt5TZ02KwKkOBK2/oKhNnanVaHHV SKugC12zXYXgsA/dgLUA3rDS+IQxGWP4DkCLCj+lFncaS2FL6OoIfCw/B /orm34TQVpv0w0tOugO4yd3oCjN5V/epQ31gvZCrwGY96Zfd6ixSlKf1g qYxolnuq2KmEcJbvlYOiUsRj9dgzI24yZpQUge9+scQvykgt9NGx7FCH9 OiVsD1WRs83WE48d2gESUZmqZvPzzm/ZvEplpmlYK8mgJsqzxlKUqsksE w==; X-CSE-ConnectionGUID: F6THY3M8QFK7N8/BM2ACjQ== X-CSE-MsgGUID: tGcE2NCPQ8WjFCoD/GQNSg== X-IronPort-AV: E=McAfee;i="6700,10204,11144"; a="19951833" X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="19951833" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2024 01:40:55 -0700 X-CSE-ConnectionGUID: 04oFdMS0QeGvOCGA1+P41g== X-CSE-MsgGUID: vD1jYG2XSW+oErLxAKVuww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="57477869" Received: from jkrzyszt-mobl2.ger.corp.intel.com (HELO jkrzyszt-mobl2.intranet) ([10.245.246.60]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2024 01:40:53 -0700 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Kamil Konieczny Subject: [PATCH i-g-t 1/2] tests/device_reset: Wait for device nodes to re-appear Date: Fri, 26 Jul 2024 10:34:56 +0200 Message-ID: <20240726084022.356654-5-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240726084022.356654-4-janusz.krzysztofik@linux.intel.com> References: <20240726084022.356654-4-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" CI sporadically reports the following issue: (device_reset:1335) DEBUG: rebind the driver to the device (device_reset:1335) DEBUG: reopen the device (device_reset:1335) drmtest-DEBUG: Looking for devices to open using filter 0: sys:/sys/devices/pci0000:00/0000:00:02.0 (device_reset:1335) drmtest-DEBUG: Filter matched | /dev/dri/renderD128 (device_reset:1335) drmtest-WARNING: No card matches the filter! [sys:/sys/devices/pci0000:00/0000:00:02.0] (device_reset:1335) CRITICAL: Test assertion failure function healthcheck, file ../../../usr/src/igt-gpu-tools/tests/device_reset.c:393: (device_reset:1335) CRITICAL: Failed assertion: dev->fds.dev >= 0 (device_reset:1335) CRITICAL: Last errno: 22, Invalid argument (device_reset:1335) CRITICAL: file descriptor dev->fds.dev failed After rebinding a DRM device driver, we now immediately start looking for DRM devices that match our PCI filter established before unbind. The above messages indicate that occasionally not all device nodes are ready by the time we are doing that. Introduce a delay to give the kernel a chance to re-create in devtmpfs all device nodes we are going to scan for. Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11626 Signed-off-by: Janusz Krzysztofik Reviewed-by: Kamil Konieczny --- tests/device_reset.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/device_reset.c b/tests/device_reset.c index a669e1224e..8ed3ef5220 100644 --- a/tests/device_reset.c +++ b/tests/device_reset.c @@ -385,6 +385,8 @@ static bool is_i915_wedged(int i915) static void healthcheck(struct device_fds *dev) { if (dev->fds.dev == -1) { + /* give the kernel a breath for re-creating device nodes in devtmpfs */ + sleep(1); /* refresh device list */ igt_devices_scan(true); igt_debug("reopen the device\n"); From patchwork Fri Jul 26 08:34:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 13742491 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 71DBDC3DA7F for ; Fri, 26 Jul 2024 08:41:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1899B10E949; Fri, 26 Jul 2024 08:41:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="PN3S0dEa"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2553010E2E2; Fri, 26 Jul 2024 08:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721983257; x=1753519257; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8xWWu+PWqebv8qoXzp8Wljp1LNvMa6pBjufA7QTtDlo=; b=PN3S0dEaz+ZnihzkrdzWoQrOnj7LcELnZ+5YFsSpiK2T8+VHtGHn4SnG 7etN6vqalcjkMM7ZEDrLHlW/ypyRMfCbMpH/pLr105YTe+0HrdV4sKxFH zYIk/gthsKF9SEvRTpLBhWYobfFyv4oXUXNlzw6c0lvtkPZ4V7Rx8QFUw G8WK3dyFE8xN/1zrV+XtxTID/lU8aJDKz0its32XSvC3nCHq/4s+p/Br3 5BlJ1FK7lMsUwFKCq5SqaveMLK5NnP30yeu6CA8rryOBhKBf4sq8S6p2d oAOEiDpg1VxRuK9IaWKZbd5MDu+ISVDF+WbWsPSSnL/iNgQOq64ZQtY19 Q==; X-CSE-ConnectionGUID: 7MsALi2WSDCnjzMFEFhwGw== X-CSE-MsgGUID: sQXwcpXRQvuGB2mFRny+lA== X-IronPort-AV: E=McAfee;i="6700,10204,11144"; a="19951836" X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="19951836" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2024 01:40:57 -0700 X-CSE-ConnectionGUID: Z+i8Aqa7RpyAAXwhziDt+w== X-CSE-MsgGUID: yiT5TwDVTeuKap8S8TDo0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="57477870" Received: from jkrzyszt-mobl2.ger.corp.intel.com (HELO jkrzyszt-mobl2.intranet) ([10.245.246.60]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2024 01:40:55 -0700 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Kamil Konieczny Subject: [PATCH i-g-t 2/2] tests/core_hotunplug: Fix inline comment on missing device nodes Date: Fri, 26 Jul 2024 10:34:57 +0200 Message-ID: <20240726084022.356654-6-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240726084022.356654-4-janusz.krzysztofik@linux.intel.com> References: <20240726084022.356654-4-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The comment incorrectly blames udev for being responsible for delays in re-creation of device nodes after driver rebind. While that could be true many years ago, nowadays that's the role of kernel devtmpfs. Signed-off-by: Janusz Krzysztofik Reviewed-by: Kamil Konieczny --- tests/core_hotunplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c index db7a5c5e84..145fe141ed 100644 --- a/tests/core_hotunplug.c +++ b/tests/core_hotunplug.c @@ -480,7 +480,7 @@ static void node_healthcheck(struct hotunplug *priv, unsigned flags) static bool healthcheck(struct hotunplug *priv, bool recover) { - /* give udev some time to recreate device nodes before we continue */ + /* give devtmpfs some time to recreate device nodes before we continue */ sleep(1); /* device name may have changed, rebuild IGT device list */