From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F3FF606A330 for ; Fri, 4 Dec 2026 12:58:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=EL4oi/Qu Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBC7010E7F2; Fri, 4 Dec 2026 12:58:23 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3C7410E7F2 for ; Fri, 4 Dec 2026 12:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796389035; x=1827925035; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=cly8DttTp7T/f/VojefPWOZjjc/h4Z7Sfy8OVgsq7xM=; b=EL4oi/Qu/XXXuyrYCDn0N7wNdlimSK5A8d1FjFnPRiEjjPjd/XjzsaZf bVC5uYdD/OA8L+tq22GRREQvgIETKE7YRKqOzj3nm3d4ItAWYjAeacpyP l4zA6WiiEGIcJUKLbZTtMEUoyGSHFZEZXkn9Hk1Bz1O2KfBOaHWCuT551 5oYuCrFQdwTMDQUaamv8aO27/uezHxktrG7DMQeX1dSaiaqgT0rXXm20D FuTOddiWjXQkUKgM2I8zq9WlANEnIF8A1UmOy1sER7qPzBF9a8sLCE7eZ TGw5s7prgDWWYkgeaCIJcT52ltspE/XbLqur6UVVR4T12/qo0+Ytq+VKV w==; X-CSE-ConnectionGUID: MVlPH1fOS5qHJ2NJksX8qw== X-CSE-MsgGUID: L82Qnz+ZSzStYaf0JKwDQQ== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5307029" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5307029" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 04:57:15 -0800 X-CSE-ConnectionGUID: h4zu3Ym2TRurE2Z3/qDpIQ== X-CSE-MsgGUID: E/n03VV8SFe6WVzbqlS0eA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="14386996" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 04:57:13 -0800 Date: Fri, 4 Dec 2026 13:57:09 +0100 From: Raag Jadav To: Sk Anirban Cc: igt-dev@lists.freedesktop.org, anshuman.gupta@intel.com, badal.nilawar@intel.com, riana.tauro@intel.com, karthik.poosa@intel.com, soham.purkait@intel.com, mallesh.koujalagi@intel.com, hiresh.kumar.yadav@intel.com Subject: Re: [PATCH] tests/intel/xe_wedged: Fix DEVPATH check for cold-reset wedge Message-ID: References: <20261202115748.775971-2-sk.anirban@intel.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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-Archive: List-Post: List-Help: List-Subscribe: , Sender: "igt-dev" X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Wed, Dec 02, 2026 at 02:26:56PM +0100, Raag Jadav wrote: > On Wed, Dec 02, 2026 at 05:27:49PM +0530, Sk Anirban wrote: > > The cold-reset-wedged subtest validated the uevent DEVPATH by > > looking for the device's PCI BDF in it. > > > > Recent kernel RAS changes moved probe-time error processing to an > > earlier point in device initialization. A cold-reset wedge is now > > declared before the DRM device is registered, so the uevent > > DEVPATH no longer contains the PCI hierarchy. It holds only the > > card node, e.g. "DEVPATH=/card0". > > > > Drop the BDF match and compare the last DEVPATH component with > > the card name predicted before rebind. > > > > Signed-off-by: Sk Anirban > > --- > > tests/intel/xe_wedged.c | 39 ++++++++++++++++++++++++++++++++------- > > 1 file changed, 32 insertions(+), 7 deletions(-) > > > > diff --git a/tests/intel/xe_wedged.c b/tests/intel/xe_wedged.c > > index c67a4dda5..07e04927b 100644 > > --- a/tests/intel/xe_wedged.c > > +++ b/tests/intel/xe_wedged.c > > @@ -93,7 +93,27 @@ static void force_wedged(int fd) > > sleep(1); > > } > > > > -static void wait_for_wedged_uevent(struct udev_monitor *mon) > > +/* > > + * The card index may change across rebind and the bound device is wedged, so > > + * predict it: DRM reuses the lowest minor that is not held by another device. > > + */ > > +static void predict_card_name_after_rebind(char *card, size_t len) > > +{ > > + char path[PATH_MAX], real[PATH_MAX]; > > + unsigned int idx; > > + > > + for (idx = 0; idx < 64; idx++) { > > Curious, why 64? > > > + snprintf(path, sizeof(path), "/sys/class/drm/card%u", idx); > > + > > + /* Free slot, or our own card which gets released by the unbind */ > > + if (!realpath(path, real) || strstr(real, pci_slot)) > > This may seem to work but looks a bit fragile. Let me think of something. Let's revisit this as a follow up. For now, Reviewed-by: Raag Jadav > > + break; > > + } > > + > > + snprintf(card, len, "card%u", idx); > > +} > > + > > +static void wait_for_wedged_uevent(struct udev_monitor *mon, const char *card) > > { > > struct udev_device *dev; > > const char *prop_val; > > @@ -118,9 +138,10 @@ static void wait_for_wedged_uevent(struct udev_monitor *mon) > > > > if (prop_val && !strcmp(prop_val, "cold-reset")) { > > event_received = true; > > - igt_assert_f(dev_path && strstr(dev_path, pci_slot), > > - "Expected bus address '%s' to be part of DEVPATH '%s'", > > - pci_slot, dev_path); > > + igt_assert_f(dev_path && > > + !strcmp(strrchr(dev_path, '/') + 1, card), > > + "Expected '%s' in DEVPATH '%s'", > > + card, dev_path); > > udev_device_unref(dev); > > break; > > } > > @@ -415,6 +436,7 @@ int igt_main() > > > > igt_subtest_f("cold-reset-wedged") { > > struct udev_monitor *mon; > > + char card[NAME_MAX]; > > > > errno = 0; > > igt_skip_on_f(!IS_CRESCENTISLAND(intel_get_drm_devid(fd)), > > @@ -430,15 +452,18 @@ int igt_main() > > ignore_wedged_in_dmesg(); > > mon = igt_watch_uevents(); > > > > + predict_card_name_after_rebind(card, sizeof(card)); > > + > > drm_close_driver(fd); > > igt_kmod_rebind("xe", pci_slot); > > - wait_for_wedged_uevent(mon); > > + wait_for_wedged_uevent(mon, card); > > /* > > - * Rebind to restore device operation. The first wedge decrements > > + * Bind again to restore device operation. The first wedge decrements > > * times to zero, disabling further fault injection even though > > * probability remains at 100. > > */ > > - igt_kmod_rebind("xe", pci_slot); > > + igt_kmod_bind("xe", pci_slot); > > + > > fd = drm_open_driver(DRIVER_XE); > > test_spinner_after_recovery(fd); > > } > > -- > > 2.43.0 > >