From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Matthew Auld <matthew.auld@intel.com>
Subject: Re: [PATCH] drm/i915: Drain the device workqueue on unload
Date: Thu, 29 Jun 2017 12:07:04 +0300 [thread overview]
Message-ID: <878tkbb1s7.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170628153909.22493-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Workers on the i915->wq may rearm themselves so for completeness we need
> to replace our flush_workqueue() with a call to drain_workqueue() before
> unloading the device.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=101627
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 2 +-
> drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9167a73f3c69..3f998d7102f7 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -592,7 +592,7 @@ static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
>
> static void i915_gem_fini(struct drm_i915_private *dev_priv)
> {
> - flush_workqueue(dev_priv->wq);
> + drain_workqueue(dev_priv->wq);
There will be superfluous drain_workqueue in driver_unload.
Also the destroy will drain byitself but in here we want
to drain before taking mutex?
-Mika
>
> mutex_lock(&dev_priv->drm.struct_mutex);
> intel_uc_fini_hw(dev_priv);
> diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> index 47613d20bba8..4beed89b51e6 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> @@ -57,7 +57,7 @@ static void mock_device_release(struct drm_device *dev)
>
> cancel_delayed_work_sync(&i915->gt.retire_work);
> cancel_delayed_work_sync(&i915->gt.idle_work);
> - flush_workqueue(i915->wq);
> + drain_workqueue(i915->wq);
>
> mutex_lock(&i915->drm.struct_mutex);
> for_each_engine(engine, i915, id)
> --
> 2.13.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-06-29 9:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 15:39 [PATCH] drm/i915: Drain the device workqueue on unload Chris Wilson
2017-06-28 16:03 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-06-29 9:07 ` Mika Kuoppala [this message]
2017-06-29 9:49 ` [PATCH] " Chris Wilson
2017-07-18 13:41 ` [PATCH v2] " Chris Wilson
2017-07-19 11:18 ` Mika Kuoppala
2017-07-19 11:30 ` Chris Wilson
2017-07-19 11:51 ` Mika Kuoppala
2017-07-19 12:23 ` Chris Wilson
2017-07-18 13:58 ` ✓ Fi.CI.BAT: success for drm/i915: Drain the device workqueue on unload (rev2) 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=878tkbb1s7.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@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 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.