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 07AE9606A31A for ; Wed, 2 Dec 2026 13:28:09 +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=Zc7bdwDe Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A949D1121D2; Wed, 2 Dec 2026 13:28:03 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id D4F911121D2 for ; Wed, 2 Dec 2026 13:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796218022; x=1827754022; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=sMkfG4RNxeRftJT/6O8JKuukJnTIpEcQptdUwD6gkZM=; b=Zc7bdwDegXsDsmsZ15HNvidQglvbfaqJ3LjJhp2E9M5yrNxVYeMAdnCh Cib+FW2KtGhUKhavSCnAkP3R1J9eS/08Ezy6vMYVrPwwkWyWa1srOZGS9 gK78cgOvoqVdJjphouzNV1ML6odMfoU9YzURoi0uocxPaq1k3Kb09rM5w nrs1rwMzf9cmveOjsxzB3/+bMftIDGsLO/ayNYxi2PRhKQ2mMNHVzr/6y BR/3imKH8jQCOmtfyr20/YA9uxnwunSO7WIE6dSNXcIVGc/6Baz2J99Rl 9jS1yOiOZM8Rt98CCrS+3k67iCbI/DdEq23u9LfIWF2hEyyWN7tKvrFfL g==; X-CSE-ConnectionGUID: qAv+JoYdQeWF+NvbBzU4sQ== X-CSE-MsgGUID: ujAN2UrmSiWNptHZWdMqbQ== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5214350" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5214350" Received: from fmviesa011.fm.intel.com ([10.60.135.151]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 05:27:02 -0800 X-CSE-ConnectionGUID: vC8AV2X0QOuJCGXb+heI/g== X-CSE-MsgGUID: kYPmvvixSIyIR2XxW6Xlcw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="15286348" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa011.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 05:27:00 -0800 Date: Wed, 2 Dec 2026 14:26:56 +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: <20261202115748.775971-2-sk.anirban@intel.com> 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=-15.8 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 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. Raag > + 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 >