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,
	"Michał Winiarski" <michal.winiarski@intel.com>
Subject: [Intel-gfx] [RFC PATH i-g-t 10/15] tests/core_hotunplug: Skip selectively on sysfs close errors
Date: Mon, 20 Jul 2020 14:19:03 +0200	[thread overview]
Message-ID: <20200720121908.28124-11-janusz.krzysztofik@linux.intel.com> (raw)
In-Reply-To: <20200720121908.28124-1-janusz.krzysztofik@linux.intel.com>

Since we no longer open a device DRM sysfs node, only a PCI one, driver
unbind operations are no longer affected by missed or unsuccessful
sysfs file close attempts.  Skip only affected subtests if that
happens.

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

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index daf0bf745..71da8f2a1 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -82,8 +82,8 @@ static void prepare(struct hotunplug *priv)
 	igt_assert_fd(priv->fd.sysfs_bus);
 
 	priv->fd.sysfs_dev = local_close(priv->fd.sysfs_dev);
-	igt_assert_f(priv->fd.sysfs_dev == -1,
-		     "Device sysfs node close failed\n");
+	igt_warn_on_f(priv->fd.sysfs_dev != -1,
+		      "Device sysfs node close failed\n");
 }
 
 /* Unbind the driver from the device */
@@ -113,6 +113,9 @@ static void driver_bind(struct hotunplug *priv)
 /* Remove (virtually unplug) the device from its bus */
 static void device_unplug(struct hotunplug *priv, const char *prefix)
 {
+	igt_require_f(priv->fd.sysfs_dev == -1,
+		      "Device sysfs node not closed properly\n");
+
 	priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
 				    O_DIRECTORY);
 	igt_assert_fd(priv->fd.sysfs_dev);
@@ -171,8 +174,6 @@ static void post_healthckeck(struct hotunplug *priv)
 	igt_abort_on_f(priv->failure, "%s\n", priv->failure);
 
 	igt_require_f(priv->fd.drm == -1, "Device not closed properly\n");
-	igt_require_f(priv->fd.sysfs_dev == -1,
-		      "Device sysfs node not closed properly\n");
 }
 
 static void set_filter_from_device(int fd)
-- 
2.21.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org,
	"Michał Winiarski" <michal.winiarski@intel.com>
Subject: [igt-dev] [RFC PATH i-g-t 10/15] tests/core_hotunplug: Skip selectively on sysfs close errors
Date: Mon, 20 Jul 2020 14:19:03 +0200	[thread overview]
Message-ID: <20200720121908.28124-11-janusz.krzysztofik@linux.intel.com> (raw)
In-Reply-To: <20200720121908.28124-1-janusz.krzysztofik@linux.intel.com>

Since we no longer open a device DRM sysfs node, only a PCI one, driver
unbind operations are no longer affected by missed or unsuccessful
sysfs file close attempts.  Skip only affected subtests if that
happens.

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

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index daf0bf745..71da8f2a1 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -82,8 +82,8 @@ static void prepare(struct hotunplug *priv)
 	igt_assert_fd(priv->fd.sysfs_bus);
 
 	priv->fd.sysfs_dev = local_close(priv->fd.sysfs_dev);
-	igt_assert_f(priv->fd.sysfs_dev == -1,
-		     "Device sysfs node close failed\n");
+	igt_warn_on_f(priv->fd.sysfs_dev != -1,
+		      "Device sysfs node close failed\n");
 }
 
 /* Unbind the driver from the device */
@@ -113,6 +113,9 @@ static void driver_bind(struct hotunplug *priv)
 /* Remove (virtually unplug) the device from its bus */
 static void device_unplug(struct hotunplug *priv, const char *prefix)
 {
+	igt_require_f(priv->fd.sysfs_dev == -1,
+		      "Device sysfs node not closed properly\n");
+
 	priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
 				    O_DIRECTORY);
 	igt_assert_fd(priv->fd.sysfs_dev);
@@ -171,8 +174,6 @@ static void post_healthckeck(struct hotunplug *priv)
 	igt_abort_on_f(priv->failure, "%s\n", priv->failure);
 
 	igt_require_f(priv->fd.drm == -1, "Device not closed properly\n");
-	igt_require_f(priv->fd.sysfs_dev == -1,
-		      "Device sysfs node not closed properly\n");
 }
 
 static void set_filter_from_device(int fd)
-- 
2.21.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2020-07-20 12:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 12:18 [Intel-gfx] [RFC PATH i-g-t 00/15] tests/core_hotunplug: Fixes and enhancements Janusz Krzysztofik
2020-07-20 12:18 ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:18 ` [Intel-gfx] [RFC PATH i-g-t 01/15] tests/core_hotunplug: Use igt_assert_fd() Janusz Krzysztofik
2020-07-20 12:18   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:18 ` [Intel-gfx] [RFC PATH i-g-t 02/15] tests/core_hotunplug: Constify dev_bus_addr string Janusz Krzysztofik
2020-07-20 12:18   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:18 ` [Intel-gfx] [RFC PATH i-g-t 03/15] tests/core_hotunplug: Consolidate duplicated debug messages Janusz Krzysztofik
2020-07-20 12:18 ` [Intel-gfx] [RFC PATH i-g-t 04/15] tests/core_hotunplug: Assert successful device filter application Janusz Krzysztofik
2020-07-20 12:18   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:18 ` [Intel-gfx] [RFC PATH i-g-t 05/15] tests/core_hotunplug: Fix missing newline Janusz Krzysztofik
2020-07-20 12:18   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:18 ` [Intel-gfx] [RFC PATH i-g-t 06/15] tests/core_hotunplug: Maintain a single data structure instance Janusz Krzysztofik
2020-07-20 12:18   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:19 ` [Intel-gfx] [RFC PATH i-g-t 07/15] tests/core_hotunplug: Pass errors via a data structure field Janusz Krzysztofik
2020-07-20 12:19 ` [Intel-gfx] [RFC PATH i-g-t 08/15] tests/core_hotunplug: Handle device close errors Janusz Krzysztofik
2020-07-20 12:19   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:19 ` [Intel-gfx] [RFC PATH i-g-t 09/15] tests/core_hotunplug: Prepare invariant data once per test run Janusz Krzysztofik
2020-07-20 12:19   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:19 ` Janusz Krzysztofik [this message]
2020-07-20 12:19   ` [igt-dev] [RFC PATH i-g-t 10/15] tests/core_hotunplug: Skip selectively on sysfs close errors Janusz Krzysztofik
2020-07-20 12:19 ` [Intel-gfx] [RFC PATH i-g-t 11/15] tests/core_hotunplug: Follow failed subtests with health checks Janusz Krzysztofik
2020-07-20 12:19   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:19 ` [Intel-gfx] [RFC PATH i-g-t 12/15] tests/core_hotunplug: Fail subtests on device close errors Janusz Krzysztofik
2020-07-20 12:19   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:19 ` [Intel-gfx] [RFC PATH i-g-t 13/15] tests/core_hotunplug: Process return values of sysfs operations Janusz Krzysztofik
2020-07-20 12:19   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:19 ` [Intel-gfx] [RFC PATH i-g-t 14/15] tests/core_hotunplug: Assert expected device presence/absence Janusz Krzysztofik
2020-07-20 12:19   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 12:19 ` [Intel-gfx] [RFC PATH i-g-t 15/15] tests/core_hotunplug: Explicitly ignore unused return values Janusz Krzysztofik
2020-07-20 12:19   ` [igt-dev] " Janusz Krzysztofik
2020-07-20 13:00 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/core_hotunplug: Fixes and enhancements Patchwork
2020-07-20 16:31 ` [igt-dev] ✗ Fi.CI.IGT: " Patchwork
2020-07-22 16:47 ` [Intel-gfx] [RFC PATH i-g-t 00/15] " Michał Winiarski
2020-07-22 16:47   ` [igt-dev] " Michał Winiarski

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=20200720121908.28124-11-janusz.krzysztofik@linux.intel.com \
    --to=janusz.krzysztofik@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michal.winiarski@intel.com \
    /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.