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,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: [Intel-gfx] [PATCH i-g-t 3/4] tests/core_hotunplug: Don't apply i915 workarounds on other platforms
Date: Tue, 13 Sep 2022 14:04:40 +0200	[thread overview]
Message-ID: <20220913120441.146757-4-janusz.krzysztofik@linux.intel.com> (raw)
In-Reply-To: <20220913120441.146757-1-janusz.krzysztofik@linux.intel.com>

Starting from commit 0edabd8a4a08 ("core_hotunplug: fix audio unbind
logic") audio modules are unloaded unconditionally before graphics driver
unbind.  This is required for i915 to be unbound cleanly from a graphics
device.  However, we have no indications that non-Intel platforms require
the same.

Since we care for other platforms using this test and contributing to it,
not developing their own, keep i915 workarounds limited to i915 devices.

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

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index c3756889c2..29cb26ab12 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -55,6 +55,7 @@ struct hotunplug {
 	bool need_healthcheck;
 	bool has_intel_perf;
  	char *snd_driver;
+	int chipset;
 };
 
 /* Helpers */
@@ -140,19 +141,20 @@ static void prepare(struct hotunplug *priv)
 static void driver_unbind(struct hotunplug *priv, const char *prefix,
 			  int timeout)
 {
-	/*
-	 * FIXME: on some devices, the audio driver (snd_hda_intel)
-	 * binds into the i915 driver. On such hardware, kernel warnings
-	 * and errors may happen if i915 is unbind/removed before removing
-	 * first the audio driver.
-	 * So, add a logic that unloads the audio driver before trying to
-	 * unbind i915 driver, reloading it when binding again.
-	 */
-	if (igt_audio_driver_unload(&priv->snd_driver)) {
-		igt_skip("Audio driver %s in use, skipping test\n",
-			 priv->snd_driver);
-	} else if (priv->snd_driver) {
-		igt_info("Unloaded audio driver %s\n", priv->snd_driver);
+	if (priv->chipset == DRIVER_INTEL) {
+		/*
+		 * FIXME: on some devices, the audio driver (snd_hda_intel)
+		 * binds into the i915 driver. On such hardware, kernel warnings
+		 * and errors may happen if i915 is unbind/removed before removing
+		 * first the audio driver.
+		 * So, add a logic that unloads the audio driver before trying to
+		 * unbind i915 driver, reloading it when binding again.
+		 */
+		if (igt_audio_driver_unload(&priv->snd_driver))
+			igt_skip("Audio driver %s in use, skipping test\n",
+				 priv->snd_driver);
+		else if (priv->snd_driver)
+			igt_info("Unloaded audio driver %s\n", priv->snd_driver);
 	}
 
 	local_debug("%sunbinding the driver from the device\n", prefix);
@@ -198,19 +200,20 @@ static void device_unplug(struct hotunplug *priv, const char *prefix,
 {
 	igt_require(priv->fd.sysfs_dev == -1);
 
-	/*
-	 * FIXME: on some devices, the audio driver (snd_hda_intel)
-	 * binds into the i915 driver. On such hardware, kernel warnings
-	 * and errors may happen if i915 is unbind/removed before removing
-	 * first the audio driver.
-	 * So, add a logic that unloads the audio driver before trying to
-	 * unbind i915 driver, reloading it when binding again.
-	 */
-	if (igt_audio_driver_unload(&priv->snd_driver)) {
-		igt_skip("Audio driver %s in use, skipping test\n",
-			 priv->snd_driver);
-	} else if (priv->snd_driver) {
-		igt_info("Unloaded audio driver %s\n", priv->snd_driver);
+	if (priv->chipset == DRIVER_INTEL) {
+		/*
+		 * FIXME: on some devices, the audio driver (snd_hda_intel)
+		 * binds into the i915 driver. On such hardware, kernel warnings
+		 * and errors may happen if i915 is unbind/removed before removing
+		 * first the audio driver.
+		 * So, add a logic that unloads the audio driver before trying to
+		 * unbind i915 driver, reloading it when binding again.
+		 */
+		if (igt_audio_driver_unload(&priv->snd_driver))
+			igt_skip("Audio driver %s in use, skipping test\n",
+				 priv->snd_driver);
+		else if (priv->snd_driver)
+			igt_info("Unloaded audio driver %s\n", priv->snd_driver);
 	}
 
 	priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
@@ -625,6 +628,7 @@ igt_main
 		.need_healthcheck = true,
 		.has_intel_perf = false,
 		.snd_driver	= NULL,
+		.chipset	= DRIVER_ANY,
 	};
 
 	igt_fixture {
@@ -634,6 +638,8 @@ igt_main
 		igt_skip_on_f(fd_drm < 0, "No known DRM device found\n");
 
 		if (is_i915_device(fd_drm)) {
+			priv.chipset = DRIVER_INTEL;
+
 			gem_quiescent_gpu(fd_drm);
 			igt_require_gem(fd_drm);
 
-- 
2.25.1


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, Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t 3/4] tests/core_hotunplug: Don't apply i915 workarounds on other platforms
Date: Tue, 13 Sep 2022 14:04:40 +0200	[thread overview]
Message-ID: <20220913120441.146757-4-janusz.krzysztofik@linux.intel.com> (raw)
In-Reply-To: <20220913120441.146757-1-janusz.krzysztofik@linux.intel.com>

Starting from commit 0edabd8a4a08 ("core_hotunplug: fix audio unbind
logic") audio modules are unloaded unconditionally before graphics driver
unbind.  This is required for i915 to be unbound cleanly from a graphics
device.  However, we have no indications that non-Intel platforms require
the same.

Since we care for other platforms using this test and contributing to it,
not developing their own, keep i915 workarounds limited to i915 devices.

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

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index c3756889c2..29cb26ab12 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -55,6 +55,7 @@ struct hotunplug {
 	bool need_healthcheck;
 	bool has_intel_perf;
  	char *snd_driver;
+	int chipset;
 };
 
 /* Helpers */
@@ -140,19 +141,20 @@ static void prepare(struct hotunplug *priv)
 static void driver_unbind(struct hotunplug *priv, const char *prefix,
 			  int timeout)
 {
-	/*
-	 * FIXME: on some devices, the audio driver (snd_hda_intel)
-	 * binds into the i915 driver. On such hardware, kernel warnings
-	 * and errors may happen if i915 is unbind/removed before removing
-	 * first the audio driver.
-	 * So, add a logic that unloads the audio driver before trying to
-	 * unbind i915 driver, reloading it when binding again.
-	 */
-	if (igt_audio_driver_unload(&priv->snd_driver)) {
-		igt_skip("Audio driver %s in use, skipping test\n",
-			 priv->snd_driver);
-	} else if (priv->snd_driver) {
-		igt_info("Unloaded audio driver %s\n", priv->snd_driver);
+	if (priv->chipset == DRIVER_INTEL) {
+		/*
+		 * FIXME: on some devices, the audio driver (snd_hda_intel)
+		 * binds into the i915 driver. On such hardware, kernel warnings
+		 * and errors may happen if i915 is unbind/removed before removing
+		 * first the audio driver.
+		 * So, add a logic that unloads the audio driver before trying to
+		 * unbind i915 driver, reloading it when binding again.
+		 */
+		if (igt_audio_driver_unload(&priv->snd_driver))
+			igt_skip("Audio driver %s in use, skipping test\n",
+				 priv->snd_driver);
+		else if (priv->snd_driver)
+			igt_info("Unloaded audio driver %s\n", priv->snd_driver);
 	}
 
 	local_debug("%sunbinding the driver from the device\n", prefix);
@@ -198,19 +200,20 @@ static void device_unplug(struct hotunplug *priv, const char *prefix,
 {
 	igt_require(priv->fd.sysfs_dev == -1);
 
-	/*
-	 * FIXME: on some devices, the audio driver (snd_hda_intel)
-	 * binds into the i915 driver. On such hardware, kernel warnings
-	 * and errors may happen if i915 is unbind/removed before removing
-	 * first the audio driver.
-	 * So, add a logic that unloads the audio driver before trying to
-	 * unbind i915 driver, reloading it when binding again.
-	 */
-	if (igt_audio_driver_unload(&priv->snd_driver)) {
-		igt_skip("Audio driver %s in use, skipping test\n",
-			 priv->snd_driver);
-	} else if (priv->snd_driver) {
-		igt_info("Unloaded audio driver %s\n", priv->snd_driver);
+	if (priv->chipset == DRIVER_INTEL) {
+		/*
+		 * FIXME: on some devices, the audio driver (snd_hda_intel)
+		 * binds into the i915 driver. On such hardware, kernel warnings
+		 * and errors may happen if i915 is unbind/removed before removing
+		 * first the audio driver.
+		 * So, add a logic that unloads the audio driver before trying to
+		 * unbind i915 driver, reloading it when binding again.
+		 */
+		if (igt_audio_driver_unload(&priv->snd_driver))
+			igt_skip("Audio driver %s in use, skipping test\n",
+				 priv->snd_driver);
+		else if (priv->snd_driver)
+			igt_info("Unloaded audio driver %s\n", priv->snd_driver);
 	}
 
 	priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
@@ -625,6 +628,7 @@ igt_main
 		.need_healthcheck = true,
 		.has_intel_perf = false,
 		.snd_driver	= NULL,
+		.chipset	= DRIVER_ANY,
 	};
 
 	igt_fixture {
@@ -634,6 +638,8 @@ igt_main
 		igt_skip_on_f(fd_drm < 0, "No known DRM device found\n");
 
 		if (is_i915_device(fd_drm)) {
+			priv.chipset = DRIVER_INTEL;
+
 			gem_quiescent_gpu(fd_drm);
 			igt_require_gem(fd_drm);
 
-- 
2.25.1

  parent reply	other threads:[~2022-09-13 12:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 12:04 [Intel-gfx] [PATCH i-g-t 0/4] tests/core_hotunplug: A couple of fixes and enhancements Janusz Krzysztofik
2022-09-13 12:04 ` [igt-dev] " Janusz Krzysztofik
2022-09-13 12:04 ` [Intel-gfx] [PATCH i-g-t 1/4] tests/core_hotunplug: Free mem allocated by igt_audio_driver_unload Janusz Krzysztofik
2022-09-13 12:04   ` [igt-dev] " Janusz Krzysztofik
2022-09-20  5:04   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-09-20  5:04     ` Mauro Carvalho Chehab
2022-09-13 12:04 ` [Intel-gfx] [PATCH i-g-t 2/4] tests/core_hotunplug: Also unload audio before device unplug Janusz Krzysztofik
2022-09-13 12:04   ` [igt-dev] " Janusz Krzysztofik
2022-09-20  5:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-09-20  5:06     ` Mauro Carvalho Chehab
2022-09-13 12:04 ` Janusz Krzysztofik [this message]
2022-09-13 12:04   ` [igt-dev] [PATCH i-g-t 3/4] tests/core_hotunplug: Don't apply i915 workarounds on other platforms Janusz Krzysztofik
2022-09-20  5:23   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-09-20  5:23     ` Mauro Carvalho Chehab
2022-09-13 12:04 ` [Intel-gfx] [PATCH i-g-t 4/4] tests/core_hotunplug: Select health checks for initially detected chipset Janusz Krzysztofik
2022-09-13 12:04   ` [igt-dev] " Janusz Krzysztofik
2022-09-20  5:10   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-09-20  5:10     ` Mauro Carvalho Chehab
2022-09-13 14:41 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/core_hotunplug: A couple of fixes and enhancements Patchwork
2022-09-14  2:17 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-14 15:25 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

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=20220913120441.146757-4-janusz.krzysztofik@linux.intel.com \
    --to=janusz.krzysztofik@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mchehab@kernel.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.