public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 27/27] drm/i915: Drop struct_mutex from around GEM initialisation
Date: Wed, 25 Sep 2019 13:56:04 +0100	[thread overview]
Message-ID: <bd7db40c-1545-0193-ddde-8686888c8128@linux.intel.com> (raw)
In-Reply-To: <20190925100137.17956-28-chris@chris-wilson.co.uk>


On 25/09/2019 11:01, Chris Wilson wrote:
> We no longer need to placate lockdep by holding struct_mutex for our
> initialisation, so don't.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/gem/i915_gem_pm.c           | 2 --
>   drivers/gpu/drm/i915/i915_gem.c                  | 9 ---------
>   drivers/gpu/drm/i915/selftests/mock_gem_device.c | 7 -------
>   3 files changed, 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_pm.c
> index e04e4ff7b52e..d1ff854ee7ff 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_pm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_pm.c
> @@ -174,7 +174,6 @@ void i915_gem_resume(struct drm_i915_private *i915)
>   {
>   	GEM_TRACE("\n");
>   
> -	mutex_lock(&i915->drm.struct_mutex);
>   	intel_uncore_forcewake_get(&i915->uncore, FORCEWAKE_ALL);
>   
>   	if (intel_gt_init_hw(&i915->gt))
> @@ -198,7 +197,6 @@ void i915_gem_resume(struct drm_i915_private *i915)
>   
>   out_unlock:
>   	intel_uncore_forcewake_put(&i915->uncore, FORCEWAKE_ALL);
> -	mutex_unlock(&i915->drm.struct_mutex);
>   	return;
>   
>   err_wedged:
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 8814db7023db..a5ef25b5b577 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1246,7 +1246,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
>   	 * we hold the forcewake during initialisation these problems
>   	 * just magically go away.
>   	 */
> -	mutex_lock(&dev_priv->drm.struct_mutex);
>   	intel_uncore_forcewake_get(&dev_priv->uncore, FORCEWAKE_ALL);
>   
>   	ret = i915_init_ggtt(dev_priv);
> @@ -1316,7 +1315,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
>   		goto err_gt;
>   
>   	intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);
> -	mutex_unlock(&dev_priv->drm.struct_mutex);
>   
>   	return 0;
>   
> @@ -1327,15 +1325,11 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
>   	 * driver doesn't explode during runtime.
>   	 */
>   err_gt:
> -	mutex_unlock(&dev_priv->drm.struct_mutex);
> -
>   	intel_gt_set_wedged(&dev_priv->gt);
>   	i915_gem_suspend(dev_priv);
>   	i915_gem_suspend_late(dev_priv);
>   
>   	i915_gem_drain_workqueue(dev_priv);
> -
> -	mutex_lock(&dev_priv->drm.struct_mutex);
>   err_init_hw:
>   	intel_uc_fini_hw(&dev_priv->gt.uc);
>   err_uc_init:
> @@ -1350,7 +1344,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
>   	intel_gt_driver_release(&dev_priv->gt);
>   err_unlock:
>   	intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);
> -	mutex_unlock(&dev_priv->drm.struct_mutex);
>   
>   	if (ret != -EIO) {
>   		intel_uc_cleanup_firmwares(&dev_priv->gt.uc);
> @@ -1403,10 +1396,8 @@ void i915_gem_driver_remove(struct drm_i915_private *dev_priv)
>   	/* Flush any outstanding unpin_work. */
>   	i915_gem_drain_workqueue(dev_priv);
>   
> -	mutex_lock(&dev_priv->drm.struct_mutex);
>   	intel_uc_fini_hw(&dev_priv->gt.uc);
>   	intel_uc_fini(&dev_priv->gt.uc);
> -	mutex_unlock(&dev_priv->drm.struct_mutex);
>   
>   	i915_gem_drain_freed_objects(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 0ed21a7b8682..7950eb9825ed 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> @@ -68,10 +68,7 @@ static void mock_device_release(struct drm_device *dev)
>   	drain_workqueue(i915->wq);
>   	i915_gem_drain_freed_objects(i915);
>   
> -	mutex_lock(&i915->drm.struct_mutex);
>   	mock_fini_ggtt(&i915->ggtt);
> -	mutex_unlock(&i915->drm.struct_mutex);
> -
>   	destroy_workqueue(i915->wq);
>   
>   	i915_gemfs_fini(i915);
> @@ -180,8 +177,6 @@ struct drm_i915_private *mock_gem_device(void)
>   
>   	intel_timelines_init(i915);
>   
> -	mutex_lock(&i915->drm.struct_mutex);
> -
>   	mock_init_ggtt(i915, &i915->ggtt);
>   
>   	mkwrite_device_info(i915)->engine_mask = BIT(0);
> @@ -198,7 +193,6 @@ struct drm_i915_private *mock_gem_device(void)
>   		goto err_context;
>   
>   	intel_engines_driver_register(i915);
> -	mutex_unlock(&i915->drm.struct_mutex);
>   
>   	WARN_ON(i915_gemfs_init(i915));
>   
> @@ -209,7 +203,6 @@ struct drm_i915_private *mock_gem_device(void)
>   err_engine:
>   	mock_engine_free(i915->engine[RCS0]);
>   err_unlock:
> -	mutex_unlock(&i915->drm.struct_mutex);
>   	intel_timelines_fini(i915);
>   	destroy_workqueue(i915->wq);
>   err_drv:
> 

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

  reply	other threads:[~2019-09-25 12:56 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 10:01 struct_mutex is over the hill and far away Chris Wilson
2019-09-25 10:01 ` [PATCH 01/27] dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling) Chris Wilson
2019-09-25 10:01 ` [PATCH 02/27] drm/mm: Pack allocated/scanned boolean into a bitfield Chris Wilson
2019-09-25 10:01 ` [PATCH 03/27] drm/i915: Only track bound elements of the GTT Chris Wilson
2019-09-25 10:01 ` [PATCH 04/27] drm/i915: Mark up address spaces that may need to allocate Chris Wilson
2019-09-25 10:01 ` [PATCH 05/27] drm/i915: Pull i915_vma_pin under the vm->mutex Chris Wilson
2019-09-27  8:47   ` Tvrtko Ursulin
2019-09-27 11:06     ` Chris Wilson
2019-09-25 10:01 ` [PATCH 06/27] drm/i915: Push the i915_active.retire into a worker Chris Wilson
2019-09-25 10:01 ` [PATCH 07/27] drm/i915: Coordinate i915_active with its own mutex Chris Wilson
2019-09-27 11:10   ` Tvrtko Ursulin
2019-09-27 11:25     ` Chris Wilson
2019-09-27 12:08       ` Tvrtko Ursulin
2019-09-27 12:16         ` Chris Wilson
2019-09-27 12:25           ` Tvrtko Ursulin
2019-09-27 12:32             ` Chris Wilson
2019-09-27 13:58               ` Tvrtko Ursulin
2019-09-27 14:10                 ` Chris Wilson
2019-09-25 10:01 ` [PATCH 08/27] drm/i915: Move idle barrier cleanup into engine-pm Chris Wilson
2019-09-25 10:01 ` [PATCH 09/27] drm/i915: Drop struct_mutex from around i915_retire_requests() Chris Wilson
2019-09-25 10:01 ` [PATCH 10/27] drm/i915: Remove the GEM idle worker Chris Wilson
2019-09-25 10:01 ` [PATCH 11/27] drm/i915: Merge wait_for_timelines with retire_request Chris Wilson
2019-09-25 10:47   ` Tvrtko Ursulin
2019-09-25 10:54     ` Chris Wilson
2019-09-25 10:01 ` [PATCH 12/27] drm/i915: Move request runtime management onto gt Chris Wilson
2019-09-25 10:57   ` Tvrtko Ursulin
2019-09-25 11:17     ` Chris Wilson
2019-09-25 11:24       ` Chris Wilson
2019-09-25 11:29         ` Chris Wilson
2019-09-25 11:33           ` Chris Wilson
2019-09-25 15:17             ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 13/27] drm/i915: Move global activity tracking from GEM to GT Chris Wilson
2019-09-25 10:01 ` [PATCH 14/27] drm/i915: Expose engine properties via sysfs Chris Wilson
2019-09-27 20:48   ` Rodrigo Vivi
2019-09-25 10:01 ` [PATCH 15/27] drm/i915/execlists: Force preemption Chris Wilson
2019-09-25 10:01 ` [PATCH 16/27] drm/i915: Mark up "sentinel" requests Chris Wilson
2019-09-25 10:01 ` [PATCH 17/27] drm/i915/execlists: Cancel banned contexts on schedule-out Chris Wilson
2019-09-25 10:01 ` [PATCH 18/27] drm/i915: Cancel non-persistent contexts on close Chris Wilson
2019-09-25 10:01 ` [PATCH 19/27] drm/i915: Replace hangcheck by heartbeats Chris Wilson
2019-09-27  8:26   ` Joonas Lahtinen
2019-09-27  9:18     ` Chris Wilson
2019-09-25 10:01 ` [PATCH 20/27] drm/i915: Remove logical HW ID Chris Wilson
2019-09-25 12:41   ` Tvrtko Ursulin
2019-09-25 12:51     ` Chris Wilson
2019-09-25 14:38       ` Tvrtko Ursulin
2019-09-25 17:59     ` Daniele Ceraolo Spurio
2019-09-25 18:23       ` Matthew Brost
2019-09-25 10:01 ` [PATCH 21/27] drm/i915: Move context management under GEM Chris Wilson
2019-09-26 13:57   ` Tvrtko Ursulin
2019-10-02 16:09     ` Tvrtko Ursulin
2019-10-03  7:35     ` Chris Wilson
2019-09-25 10:01 ` [PATCH 22/27] drm/i915/overlay: Drop struct_mutex guard Chris Wilson
2019-09-25 12:43   ` Tvrtko Ursulin
2019-09-25 12:53     ` Chris Wilson
2019-09-25 13:01       ` Tvrtko Ursulin
2019-09-25 13:11         ` Chris Wilson
2019-09-25 10:01 ` [PATCH 23/27] drm/i915: Drop struct_mutex guard from debugfs/framebuffer_info Chris Wilson
2019-09-25 12:45   ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 24/27] drm/i915: Remove struct_mutex guard for debugfs/opregion Chris Wilson
2019-09-25 12:51   ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 25/27] drm/i915: Drop struct_mutex from suspend state save/restore Chris Wilson
2019-09-25 12:52   ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 26/27] drm/i915/selftests: Drop vestigal struct_mutex guards Chris Wilson
2019-09-25 12:55   ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 27/27] drm/i915: Drop struct_mutex from around GEM initialisation Chris Wilson
2019-09-25 12:56   ` Tvrtko Ursulin [this message]
2019-09-25 10:21 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/27] dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling) Patchwork
2019-09-25 10:34 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-09-25 10:51 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-26  0:56 ` ✗ Fi.CI.IGT: failure " 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=bd7db40c-1545-0193-ddde-8686888c8128@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.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