linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
	Rob Clark <robdclark@chromium.org>,
	Jordan Crouse <jcrouse@codeaurora.org>,
	"Kristian H . Kristensen" <hoegsberg@google.com>,
	Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v4 18/23] drm/msm: Drop struct_mutex from the retire path
Date: Fri, 23 Oct 2020 09:51:19 -0700	[thread overview]
Message-ID: <20201023165136.561680-19-robdclark@gmail.com> (raw)
In-Reply-To: <20201023165136.561680-1-robdclark@gmail.com>

From: Rob Clark <robdclark@chromium.org>

Now that we are not relying on dev->struct_mutex to protect the
ring->submits lists, drop the struct_mutex lock.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
---
 drivers/gpu/drm/msm/msm_gpu.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index d0f625112a97..30ba3beaad0a 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -717,7 +717,7 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
 
 		msm_gem_active_put(&msm_obj->base);
 		msm_gem_unpin_iova(&msm_obj->base, submit->aspace);
-		drm_gem_object_put_locked(&msm_obj->base);
+		drm_gem_object_put(&msm_obj->base);
 	}
 
 	pm_runtime_mark_last_busy(&gpu->pdev->dev);
@@ -732,11 +732,8 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
 
 static void retire_submits(struct msm_gpu *gpu)
 {
-	struct drm_device *dev = gpu->dev;
 	int i;
 
-	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
-
 	/* Retire the commits starting with highest priority */
 	for (i = 0; i < gpu->nr_rings; i++) {
 		struct msm_ringbuffer *ring = gpu->rb[i];
@@ -766,15 +763,12 @@ static void retire_submits(struct msm_gpu *gpu)
 static void retire_worker(struct work_struct *work)
 {
 	struct msm_gpu *gpu = container_of(work, struct msm_gpu, retire_work);
-	struct drm_device *dev = gpu->dev;
 	int i;
 
 	for (i = 0; i < gpu->nr_rings; i++)
 		update_fences(gpu, gpu->rb[i], gpu->rb[i]->memptrs->fence);
 
-	mutex_lock(&dev->struct_mutex);
 	retire_submits(gpu);
-	mutex_unlock(&dev->struct_mutex);
 }
 
 /* call from irq handler to schedule work to retire bo's */
-- 
2.26.2


  parent reply	other threads:[~2020-10-23 16:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 16:51 [PATCH v4 00/23] drm/msm: de-struct_mutex-ification Rob Clark
2020-10-23 16:51 ` [PATCH v4 01/23] drm/msm: Fix a couple incorrect usages of get_vaddr_active() Rob Clark
2020-10-23 16:51 ` [PATCH v4 02/23] drm/msm/gem: Add obj->lock wrappers Rob Clark
2020-10-23 16:51 ` [PATCH v4 03/23] drm/msm/gem: Rename internal get_iova_locked helper Rob Clark
2020-10-23 16:51 ` [PATCH v4 04/23] drm/msm/gem: Move prototypes to msm_gem.h Rob Clark
2020-10-23 16:51 ` [PATCH v4 05/23] drm/msm/gem: Add some _locked() helpers Rob Clark
2020-10-23 16:51 ` [PATCH v4 06/23] drm/msm/gem: Move locking in shrinker path Rob Clark
2020-10-23 16:51 ` [PATCH v4 07/23] drm/msm/submit: Move copy_from_user ahead of locking bos Rob Clark
2020-10-23 16:51 ` [PATCH v4 08/23] drm/msm: Do rpm get sooner in the submit path Rob Clark
2020-10-23 16:51 ` [PATCH v4 09/23] drm/msm/gem: Switch over to obj->resv for locking Rob Clark
2020-10-23 16:51 ` [PATCH v4 10/23] drm/msm: Use correct drm_gem_object_put() in fail case Rob Clark
2020-10-23 16:51 ` [PATCH v4 11/23] drm/msm: Drop chatty trace Rob Clark
2020-10-23 16:51 ` [PATCH v4 12/23] drm/msm: Move update_fences() Rob Clark
2020-10-23 16:51 ` [PATCH v4 13/23] drm/msm: Add priv->mm_lock to protect active/inactive lists Rob Clark
2020-10-23 16:51 ` [PATCH v4 14/23] drm/msm: Document and rename preempt_lock Rob Clark
2020-10-23 16:51 ` [PATCH v4 15/23] drm/msm: Protect ring->submits with it's own lock Rob Clark
2020-10-23 16:51 ` [PATCH v4 16/23] drm/msm: Refcount submits Rob Clark
2020-10-23 16:51 ` [PATCH v4 17/23] drm/msm: Remove obj->gpu Rob Clark
2020-10-23 16:51 ` Rob Clark [this message]
2020-10-23 16:51 ` [PATCH v4 19/23] drm/msm: Drop struct_mutex in free_object() path Rob Clark
2020-10-23 16:51 ` [PATCH v4 20/23] drm/msm: Remove msm_gem_free_work Rob Clark
2020-10-23 16:51 ` [PATCH v4 21/23] drm/msm: Drop struct_mutex in madvise path Rob Clark
2020-10-23 16:51 ` [PATCH v4 22/23] drm/msm: Drop struct_mutex in shrinker path Rob Clark
2020-10-23 16:51 ` [PATCH v4 23/23] drm/msm: Don't implicit-sync if only a single ring Rob Clark
2020-10-23 18:20   ` Lucas Stach
2020-10-24  3:49     ` Rob Clark
2020-10-26  9:34       ` Daniel Vetter
2020-10-29 16:14         ` Daniel Vetter
2020-10-29 16:59           ` Rob Clark
2020-10-29 18:22             ` Daniel Vetter

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=20201023165136.561680-19-robdclark@gmail.com \
    --to=robdclark@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=hoegsberg@google.com \
    --cc=jcrouse@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@chromium.org \
    --cc=sean@poorly.run \
    /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;
as well as URLs for NNTP newsgroup(s).