Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <andrzej.hajda@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v1 6/7] tests/core_hotunplug: Fix device close
Date: Wed, 12 Jun 2024 09:17:04 +0200	[thread overview]
Message-ID: <7a34f347-04ae-400e-82f4-3701a7e78c47@intel.com> (raw)
In-Reply-To: <20240607153629.52596-7-kamil.konieczny@linux.intel.com>



On 07.06.2024 17:36, Kamil Konieczny wrote:
> Use __drm_device_close for closing a drm device, as for Xe driver
> it needs to call additional function.
>
> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
>   tests/core_hotunplug.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
> index ddf11bb00..3b0135fc8 100644
> --- a/tests/core_hotunplug.c
> +++ b/tests/core_hotunplug.c
> @@ -146,7 +146,11 @@ static int close_device(int fd_drm, const char *when, const char *which)
>   		return fd_drm;
>   
>   	local_debug("%sclosing %sdevice instance\n", when, which);
> -	return local_close(fd_drm, "Device close failed");
> +	errno = 0;
> +	if (igt_warn_on_f(__drm_close_driver(fd_drm), "Device close failed\n"))
> +		return -errno;	/* (never -1) */
> +
> +	return -1;	/* success */

We have:
local_close
close_device
__drm_close_driver
drm_close_driver

Why do not put the code above into some of these and call here just:
         return proper_close_variant()

Up to you, could be separate patch.

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej

>   }
>   
>   static int close_sysfs(int fd_sysfs_dev)


  reply	other threads:[~2024-06-12  7:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07 15:36 [PATCH i-g-t v1 0/7] tests/core_hotunplug: Make it fail in subtests Kamil Konieczny
2024-06-07 15:36 ` [PATCH i-g-t v1 1/7] lib/drmtest: add function for retriving chipset Kamil Konieczny
2024-06-12  7:02   ` Andrzej Hajda
2024-06-07 15:36 ` [PATCH i-g-t v1 2/7] tests/core_hotunplug: set known chipset before tests Kamil Konieczny
2024-06-12  7:03   ` Andrzej Hajda
2024-06-07 15:36 ` [PATCH i-g-t v1 3/7] tests/core_hotplug: Add checks to subtests Kamil Konieczny
2024-06-12  7:02   ` Andrzej Hajda
2024-06-07 15:36 ` [PATCH i-g-t v1 4/7] lib/drmtest: Allow to get drm device name Kamil Konieczny
2024-06-12  7:06   ` Andrzej Hajda
2024-06-07 15:36 ` [PATCH i-g-t v1 5/7] tests/core_hotunplug: Open the same driver Kamil Konieczny
2024-06-12  7:07   ` Andrzej Hajda
2024-06-07 15:36 ` [PATCH i-g-t v1 6/7] tests/core_hotunplug: Fix device close Kamil Konieczny
2024-06-12  7:17   ` Andrzej Hajda [this message]
2024-06-07 15:36 ` [PATCH i-g-t v1 7/7] tests/core_hotunplug: Skip if no render available Kamil Konieczny
2024-06-12  7:18   ` Andrzej Hajda
2024-06-07 22:43 ` ✓ Fi.CI.BAT: success for tests/core_hotunplug: Make it fail in subtests Patchwork
2024-06-07 23:13 ` ✓ CI.xeBAT: " Patchwork
2024-06-08 14:02 ` ✗ CI.xeFULL: failure " Patchwork
2024-06-11 15:32   ` Kamil Konieczny
2024-06-08 14:06 ` ✗ Fi.CI.IGT: " Patchwork
2024-06-11 15:35   ` Kamil Konieczny

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=7a34f347-04ae-400e-82f4-3701a7e78c47@intel.com \
    --to=andrzej.hajda@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox