All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH i-g-t] tests/core_hotunplug: Show device PCI bus address on errors
Date: Thu, 18 Nov 2021 09:41:40 +0100	[thread overview]
Message-ID: <20211118084140.120777-1-janusz.krzysztofik@linux.intel.com> (raw)

Strange -ENODEV responses from the kernel to i915 driver rebind attempts
have been sporadically observed.  After successfully unbinding the driver
from a device by writing a string representing its PCI bus address to
/sys/bus/pci/driver/i915/unbind, the test then fails while writing the
same device PCI bus address string to /sys/bus/pci/drivers/i915/bind.  It
is unlikely that the device disappears from the bus when this happens --
the test would attempt to rescan the bus in such cases while it doesn't.

To shed more light on what may be going on, extend error messages emitted
by the test with the device PCI bus address string it uses also printed.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 tests/core_hotunplug.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index b36616688..2f2fb7ac1 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -174,11 +174,11 @@ static void driver_unbind(struct hotunplug *priv, const char *prefix,
 	igt_set_timeout(timeout, "Driver unbind timeout!");
 	igt_assert_f(igt_sysfs_set(priv->fd.sysfs_drv, "unbind",
 				   priv->dev_bus_addr),
-		     "Driver unbind failure!\n");
+		     "Driver unbind failure (%s)!\n", priv->dev_bus_addr);
 	igt_reset_timeout();
 
 	igt_assert_f(faccessat(priv->fd.sysfs_drv, priv->dev_bus_addr, F_OK, 0),
-		     "Unbound device still present\n");
+		     "Unbound device still present (%s)\n", priv->dev_bus_addr);
 }
 
 /* Re-bind the driver to the device */
@@ -190,12 +190,12 @@ static void driver_bind(struct hotunplug *priv, int timeout)
 	igt_set_timeout(timeout, "Driver re-bind timeout!");
 	igt_assert_f(igt_sysfs_set(priv->fd.sysfs_drv, "bind",
 				   priv->dev_bus_addr),
-		     "Driver re-bind failure\n!");
+		     "Driver re-bind failure (%s)!\n", priv->dev_bus_addr);
 	igt_reset_timeout();
 
 	igt_fail_on_f(faccessat(priv->fd.sysfs_drv, priv->dev_bus_addr,
 				F_OK, 0),
-		      "Rebound device not present!\n");
+		      "Rebound device not present (%s)!\n", priv->dev_bus_addr);
 
 	if (priv->snd_unload)
 		igt_kmod_load("snd_hda_intel", NULL);
@@ -223,7 +223,7 @@ static void device_unplug(struct hotunplug *priv, const char *prefix,
 	igt_assert_eq(priv->fd.sysfs_dev, -1);
 
 	igt_assert_f(faccessat(priv->fd.sysfs_bus, priv->dev_bus_addr, F_OK, 0),
-		     "Unplugged device still present\n");
+		     "Unplugged device still present (%s)\n", priv->dev_bus_addr);
 }
 
 /* Re-discover the device by rescanning its bus */
@@ -239,7 +239,7 @@ static void bus_rescan(struct hotunplug *priv, int timeout)
 
 	igt_fail_on_f(faccessat(priv->fd.sysfs_bus, priv->dev_bus_addr,
 				F_OK, 0),
-		      "Fakely unplugged device not rediscovered!\n");
+		      "Fakely unplugged device not rediscovered (%s)!\n", priv->dev_bus_addr);
 }
 
 static void cleanup(struct hotunplug *priv)
-- 
2.25.1


             reply	other threads:[~2021-11-18  8:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18  8:41 Janusz Krzysztofik [this message]
2021-11-18 10:34 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/core_hotunplug: Show device PCI bus address on errors Patchwork
2021-11-18 17:50 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-11-19  8:46   ` Janusz Krzysztofik
2021-11-19 17:26     ` Vudum, Lakshminarayana
2021-11-19 16:51 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2021-11-26  8:00 ` [Intel-gfx] [PATCH i-g-t] " Bernatowicz, Marcin
2021-11-26  8:00   ` [igt-dev] " Bernatowicz, Marcin
2021-11-26  9:24   ` Janusz Krzysztofik
2021-11-26  9:24     ` [igt-dev] " Janusz Krzysztofik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211118084140.120777-1-janusz.krzysztofik@linux.intel.com \
    --to=janusz.krzysztofik@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.