Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Gupta, Anshuman" <anshuman.gupta@intel.com>
To: "Tauro, Riana" <riana.tauro@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t 1/3] lib/drmtest : add function to call exit handler to unload i915 module
Date: Mon, 28 Mar 2022 05:42:46 +0000	[thread overview]
Message-ID: <042e7fc1bea04c4789c2a2a2d0d948b4@intel.com> (raw)
In-Reply-To: <20220328051727.119142-2-riana.tauro@intel.com>



> -----Original Message-----
> From: Tauro, Riana <riana.tauro@intel.com>
> Sent: Monday, March 28, 2022 10:47 AM
> To: igt-dev@lists.freedesktop.org
> Cc: Tauro, Riana <riana.tauro@intel.com>; Gupta, Anshuman
> <anshuman.gupta@intel.com>; Ewins, Jon <jon.ewins@intel.com>; Dixit,
> Ashutosh <ashutosh.dixit@intel.com>
> Subject: [PATCH i-g-t 1/3] lib/drmtest : add function to call exit handler to
> unload i915 module
> 
> From: "Tauro, Riana" <riana.tauro@intel.com>
> 
> Unload of i915 module needs closing of  at_exit_drm_fd.
> Add a function that calls the exit handler of at_exit_drm_fd to unload module
We are not calling the exit handler directly, may be need to rephrase the commit log ?
> successfully
> 
> Signed-off-by: Tauro, Riana <riana.tauro@intel.com>
> ---
>  lib/drmtest.c | 17 +++++++++++++++++
>  lib/drmtest.h |  1 +
>  2 files changed, 18 insertions(+)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c index 09a9a229..e84e0360 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -588,6 +588,23 @@ int drm_open_driver(int chipset)
>  	return fd;
>  }
> 
> +/**
> + * drm_cancel_work_at_exit:
How about drmtest_cancel_work_prior_unload_i915  ?
> + *
> + * calls __cancel_work_at_exit and closes
> + * at_exit_drm_fd to allow unloading of the module.
> + */
> +void drm_cancel_work_at_exit(void)
> +{
> +	if (at_exit_drm_fd < 0)
> +		return;
> +
> +	__cancel_work_at_exit(at_exit_drm_fd);
> +
> +	close(at_exit_drm_fd);
> +	at_exit_drm_fd = -1;
> +}
> +
>  /**
>   * drm_open_driver_master:
>   * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL diff --git
> a/lib/drmtest.h b/lib/drmtest.h index b5debd44..df551873 100644
> --- a/lib/drmtest.h
> +++ b/lib/drmtest.h
> @@ -88,6 +88,7 @@ void __set_forced_driver(const char *name);
>   */
>  #define ALIGN_DOWN(x, a)	ALIGN((x) - ((a) - 1), (a))
> 
> +void drm_cancel_work_at_exit(void);
>  void drm_load_module(unsigned int chipset);  int drm_open_driver(int chipset);
> int drm_open_driver_master(int chipset);
> --
> 2.25.1

  reply	other threads:[~2022-03-28  5:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  5:17 [igt-dev] [PATCH i-g-t 0/3] Basic Suspend/Resume with i915 unload Riana Tauro
2022-03-28  5:17 ` [igt-dev] [PATCH i-g-t 1/3] lib/drmtest : add function to call exit handler to unload i915 module Riana Tauro
2022-03-28  5:42   ` Gupta, Anshuman [this message]
2022-03-28  5:17 ` [igt-dev] [PATCH i-g-t 2/3] tests/i915/i915_suspend: Add system-suspend-without-i915 subtest Riana Tauro
2022-03-28  5:51   ` Gupta, Anshuman
2022-03-28  5:53     ` Gupta, Anshuman
2022-03-28  5:17 ` [igt-dev] [PATCH i-g-t 3/3] tests/intel-ci/fast-feedback: Add system-suspend-without-i915 into fast-feedback list Riana Tauro
2022-03-28  5:52   ` Gupta, Anshuman
2022-03-28  5:50 ` [igt-dev] ✓ Fi.CI.BAT: success for Basic Suspend/Resume with i915 unload (rev2) Patchwork
2022-03-28  6:41 ` [igt-dev] ✓ Fi.CI.IGT: " 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=042e7fc1bea04c4789c2a2a2d0d948b4@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=riana.tauro@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