All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: etnaviv@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org,
	Russell King <linux+etnaviv@armlinux.org.uk>,
	Christian Gmeiner <christian.gmeiner@gmail.com>,
	kernel@pengutronix.de, patchwork-lst@pengutronix.de
Subject: [PATCH 5/8] drm/etnaviv: exec and MMU state is lost when resetting the GPU
Date: Fri, 20 Aug 2021 22:18:27 +0200	[thread overview]
Message-ID: <20210820201830.2005563-5-l.stach@pengutronix.de> (raw)
In-Reply-To: <20210820201830.2005563-1-l.stach@pengutronix.de>

When the GPU is reset both the current exec state, as well as all MMU
state is lost. Move the driver side state tracking into the reset function
to keep hardware and software state from diverging.

Cc: stable@vger.kernel.org # 5.4
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Michael Walle <michael@walle.cc>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 973843c35fca..9c710924df6b 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -570,6 +570,8 @@ static int etnaviv_hw_reset(struct etnaviv_gpu *gpu)
 	etnaviv_gpu_update_clock(gpu);
 
 	gpu->fe_running = false;
+	gpu->exec_state = -1;
+	gpu->mmu_context = NULL;
 
 	return 0;
 }
@@ -830,7 +832,6 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
 	/* Now program the hardware */
 	mutex_lock(&gpu->lock);
 	etnaviv_gpu_hw_init(gpu);
-	gpu->exec_state = -1;
 	mutex_unlock(&gpu->lock);
 
 	pm_runtime_mark_last_busy(gpu->dev);
@@ -1055,8 +1056,6 @@ void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu)
 	spin_unlock(&gpu->event_spinlock);
 
 	etnaviv_gpu_hw_init(gpu);
-	gpu->exec_state = -1;
-	gpu->mmu_context = NULL;
 
 	mutex_unlock(&gpu->lock);
 	pm_runtime_mark_last_busy(gpu->dev);
-- 
2.30.2


  parent reply	other threads:[~2021-08-20 20:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20 20:18 [PATCH 1/8] drm/etnaviv: return context from etnaviv_iommu_context_get Lucas Stach
2021-08-20 20:18 ` [PATCH 2/8] drm/etnaviv: put submit prev MMU context when it exists Lucas Stach
2021-08-20 20:18 ` [PATCH 3/8] drm/etnaviv: stop abusing mmu_context as FE running marker Lucas Stach
2021-08-20 20:18 ` [PATCH 4/8] drm/etnaviv: keep MMU context across runtime suspend/resume Lucas Stach
2021-08-20 20:18 ` Lucas Stach [this message]
2021-08-20 20:18 ` [PATCH 6/8] drm/etnaviv: fix MMU context leak on GPU reset Lucas Stach
2021-08-20 20:18 ` [PATCH 7/8] drm/etnaviv: reference MMU context when setting up hardware state Lucas Stach
2021-08-24  7:24   ` Christian Gmeiner
2021-08-24  7:54     ` Lucas Stach
2021-08-24  8:51       ` Christian Gmeiner
2021-08-20 20:18 ` [PATCH 8/8] drm/etnaviv: add missing MMU context put when reaping MMU mapping Lucas Stach
2021-08-26 12:00   ` Christian Gmeiner

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=20210820201830.2005563-5-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=christian.gmeiner@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etnaviv@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=linux+etnaviv@armlinux.org.uk \
    --cc=patchwork-lst@pengutronix.de \
    /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.