diff mbox series

[i-g-t,4/4] tests/core_hotunplug: Select health checks for initially detected chipset

Message ID 20220913120441.146757-5-janusz.krzysztofik@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series tests/core_hotunplug: A couple of fixes and enhancements | expand

Commit Message

Janusz Krzysztofik Sept. 13, 2022, 12:04 p.m. UTC
As soon as we first time open a drm device to be exercised, we identify
its chipset, store that information, and perform some basic device
specific checks.  We also store a filter that matches the device bus
address to make sure we will exercise still one and the same device after
each driver unbind-rebind / device unplug-rediscover operation.

However, each time before we select device specific health checks, whether
before or after a driver unbind-rebind / device unplug-rediscover
operation, we identify the device chipset again.  Besides being more
expensive, that approach could also result in using different set of
health checks should device filters not work as expected.

Always use the stored chipset type instead of identifying it now and
again.

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

Comments

Mauro Carvalho Chehab Sept. 20, 2022, 5:10 a.m. UTC | #1
On Tue, 13 Sep 2022 14:04:41 +0200
Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> wrote:

> As soon as we first time open a drm device to be exercised, we identify
> its chipset, store that information, and perform some basic device
> specific checks.  We also store a filter that matches the device bus
> address to make sure we will exercise still one and the same device after
> each driver unbind-rebind / device unplug-rediscover operation.
> 
> However, each time before we select device specific health checks, whether
> before or after a driver unbind-rebind / device unplug-rediscover
> operation, we identify the device chipset again.  Besides being more
> expensive, that approach could also result in using different set of
> health checks should device filters not work as expected.
> 
> Always use the stored chipset type instead of identifying it now and
> again.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>

Makes sense to me, once we have patch 3/4 applied. So,

Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>

> ---
>  tests/core_hotunplug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
> index 29cb26ab12..7c7ed09e63 100644
> --- a/tests/core_hotunplug.c
> +++ b/tests/core_hotunplug.c
> @@ -400,7 +400,7 @@ static void node_healthcheck(struct hotunplug *priv, unsigned flags)
>  	if (closed)	/* store fd for cleanup if not dirty */
>  		priv->fd.drm_hc = fd_drm;
>  
> -	if (is_i915_device(fd_drm)) {
> +	if (priv->chipset == DRIVER_INTEL) {
>  		/* don't report library failed asserts as healthcheck failure */
>  		priv->failure = "Unrecoverable test failure";
>  		if (local_i915_healthcheck(fd_drm, "") &&
diff mbox series

Patch

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 29cb26ab12..7c7ed09e63 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -400,7 +400,7 @@  static void node_healthcheck(struct hotunplug *priv, unsigned flags)
 	if (closed)	/* store fd for cleanup if not dirty */
 		priv->fd.drm_hc = fd_drm;
 
-	if (is_i915_device(fd_drm)) {
+	if (priv->chipset == DRIVER_INTEL) {
 		/* don't report library failed asserts as healthcheck failure */
 		priv->failure = "Unrecoverable test failure";
 		if (local_i915_healthcheck(fd_drm, "") &&