Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Akhil P Oommen <akhilpo@codeaurora.org>
To: freedreno@lists.freedesktop.org
Cc: dri-devel@freedesktop.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, jcrouse@codeaurora.org,
	mka@chromium.org, jonathan@marek.ca, robdclark@gmail.com,
	dianders@chromium.org
Subject: [PATCH v2 2/2] drm/msm: Leave inuse count intact on map failure
Date: Tue, 22 Sep 2020 20:25:27 +0530	[thread overview]
Message-ID: <1600786527-7343-2-git-send-email-akhilpo@codeaurora.org> (raw)
In-Reply-To: <1600786527-7343-1-git-send-email-akhilpo@codeaurora.org>

Leave the inuse count intact on map failure to keep the accounting
accurate.

Signed-off-by: Akhil P Oommen <akhilpo@codeaurora.org>
---
 drivers/gpu/drm/msm/msm_gem_vma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c
index 80a8a26..f914ddb 100644
--- a/drivers/gpu/drm/msm/msm_gem_vma.c
+++ b/drivers/gpu/drm/msm/msm_gem_vma.c
@@ -88,8 +88,10 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace,
 		ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt,
 				size, prot);
 
-	if (ret)
+	if (ret) {
 		vma->mapped = false;
+		vma->inuse--;
+	}
 
 	return ret;
 }
-- 
2.7.4


  reply	other threads:[~2020-09-22 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 14:55 [PATCH v2 1/2] drm/msm: Fix premature purging of BO Akhil P Oommen
2020-09-22 14:55 ` Akhil P Oommen [this message]
2020-09-23 14:51   ` [PATCH v2 2/2] drm/msm: Leave inuse count intact on map failure Jordan Crouse
2020-09-23 14:50 ` [PATCH v2 1/2] drm/msm: Fix premature purging of BO Jordan Crouse
2020-09-23 18:28   ` Akhil P Oommen
2020-09-24  2:29     ` Rob Clark

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=1600786527-7343-2-git-send-email-akhilpo@codeaurora.org \
    --to=akhilpo@codeaurora.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jcrouse@codeaurora.org \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=robdclark@gmail.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