From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pmu: Keep a reference to module while active
Date: Fri, 1 May 2020 09:14:44 +0100 [thread overview]
Message-ID: <0faabfb0-25f2-ce38-f454-afcd68c039f9@linux.intel.com> (raw)
In-Reply-To: <20200430183324.23984-1-chris@chris-wilson.co.uk>
On 30/04/2020 19:33, Chris Wilson wrote:
> While a perf event is open, keep a reference to the module so we don't
> remove the driver internals mid-sampling.
>
> Testcase: igt/perf_pmu/module-unload
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: stable@vger.kernel.org
> ---
> drivers/gpu/drm/i915/i915_pmu.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> index 83c6a8ccd2cb..e991a707bdb7 100644
> --- a/drivers/gpu/drm/i915/i915_pmu.c
> +++ b/drivers/gpu/drm/i915/i915_pmu.c
> @@ -442,6 +442,7 @@ static u64 count_interrupts(struct drm_i915_private *i915)
> static void i915_pmu_event_destroy(struct perf_event *event)
> {
> WARN_ON(event->parent);
> + module_put(THIS_MODULE);
> }
>
> static int
> @@ -533,8 +534,10 @@ static int i915_pmu_event_init(struct perf_event *event)
> if (ret)
> return ret;
>
> - if (!event->parent)
> + if (!event->parent) {
> + __module_get(THIS_MODULE);
> event->destroy = i915_pmu_event_destroy;
> + }
>
> return 0;
> }
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2020-05-01 8:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 18:33 [Intel-gfx] [PATCH] drm/i915/pmu: Keep a reference to module while active Chris Wilson
2020-04-30 19:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-05-01 2:01 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-05-01 8:14 ` Tvrtko Ursulin [this message]
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=0faabfb0-25f2-ce38-f454-afcd68c039f9@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox