The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Erico Nunes <nunes.erico@gmail.com>
To: Qiang Yu <yuq825@gmail.com>,
	dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org
Cc: anarsoul@gmail.com,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	christian.koenig@amd.com, linux-kernel@vger.kernel.org,
	Erico Nunes <nunes.erico@gmail.com>
Subject: [PATCH v1 5/6] drm/lima: remove guilty drm_sched context handling
Date: Wed, 17 Jan 2024 04:12:11 +0100	[thread overview]
Message-ID: <20240117031212.1104034-6-nunes.erico@gmail.com> (raw)
In-Reply-To: <20240117031212.1104034-1-nunes.erico@gmail.com>

Marking the context as guilty currently only makes the application which
hits a single timeout problem to stop its rendering context entirely.
All jobs submitted later are dropped from the guilty context.

Lima runs on fairly underpowered hardware for modern standards and it is
not entirely unreasonable that a rendering job may time out occasionally
due to high system load or too demanding application stack. In this case
it would be generally preferred to report the error but try to keep the
application going.

Other similar embedded GPU drivers don't make use of the guilty context
flag. Now that there are reliability improvements to the lima timeout
recovery handling, drop the guilty contexts to let the application keep
running in this case.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
---
 drivers/gpu/drm/lima/lima_ctx.c   | 2 +-
 drivers/gpu/drm/lima/lima_ctx.h   | 1 -
 drivers/gpu/drm/lima/lima_sched.c | 5 ++---
 drivers/gpu/drm/lima/lima_sched.h | 3 +--
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c
index 8389f2d7d021..0e668fc1e0f9 100644
--- a/drivers/gpu/drm/lima/lima_ctx.c
+++ b/drivers/gpu/drm/lima/lima_ctx.c
@@ -19,7 +19,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
 	kref_init(&ctx->refcnt);
 
 	for (i = 0; i < lima_pipe_num; i++) {
-		err = lima_sched_context_init(dev->pipe + i, ctx->context + i, &ctx->guilty);
+		err = lima_sched_context_init(dev->pipe + i, ctx->context + i);
 		if (err)
 			goto err_out0;
 	}
diff --git a/drivers/gpu/drm/lima/lima_ctx.h b/drivers/gpu/drm/lima/lima_ctx.h
index 74e2be09090f..5b1063ce968b 100644
--- a/drivers/gpu/drm/lima/lima_ctx.h
+++ b/drivers/gpu/drm/lima/lima_ctx.h
@@ -13,7 +13,6 @@ struct lima_ctx {
 	struct kref refcnt;
 	struct lima_device *dev;
 	struct lima_sched_context context[lima_pipe_num];
-	atomic_t guilty;
 
 	/* debug info */
 	char pname[TASK_COMM_LEN];
diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c
index 9449b81bcd5b..496c79713fe8 100644
--- a/drivers/gpu/drm/lima/lima_sched.c
+++ b/drivers/gpu/drm/lima/lima_sched.c
@@ -154,13 +154,12 @@ void lima_sched_task_fini(struct lima_sched_task *task)
 }
 
 int lima_sched_context_init(struct lima_sched_pipe *pipe,
-			    struct lima_sched_context *context,
-			    atomic_t *guilty)
+			    struct lima_sched_context *context)
 {
 	struct drm_gpu_scheduler *sched = &pipe->base;
 
 	return drm_sched_entity_init(&context->base, DRM_SCHED_PRIORITY_NORMAL,
-				     &sched, 1, guilty);
+				     &sched, 1, NULL);
 }
 
 void lima_sched_context_fini(struct lima_sched_pipe *pipe,
diff --git a/drivers/gpu/drm/lima/lima_sched.h b/drivers/gpu/drm/lima/lima_sched.h
index 34050facb110..677e908b53f8 100644
--- a/drivers/gpu/drm/lima/lima_sched.h
+++ b/drivers/gpu/drm/lima/lima_sched.h
@@ -93,8 +93,7 @@ int lima_sched_task_init(struct lima_sched_task *task,
 void lima_sched_task_fini(struct lima_sched_task *task);
 
 int lima_sched_context_init(struct lima_sched_pipe *pipe,
-			    struct lima_sched_context *context,
-			    atomic_t *guilty);
+			    struct lima_sched_context *context);
 void lima_sched_context_fini(struct lima_sched_pipe *pipe,
 			     struct lima_sched_context *context);
 struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task);
-- 
2.43.0


  parent reply	other threads:[~2024-01-17  3:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17  3:12 [PATCH v1 0/6] drm/lima: fixes and improvements to error recovery Erico Nunes
2024-01-17  3:12 ` [PATCH v1 1/6] drm/lima: fix devfreq refcount imbalance for job timeouts Erico Nunes
2024-01-17 18:13   ` Vasily Khoruzhick
2024-01-18  1:36   ` Qiang Yu
2024-01-18 11:14     ` Erico Nunes
2024-01-19  1:50       ` Qiang Yu
2024-01-23 23:19         ` Erico Nunes
2024-01-24  1:03           ` Qiang Yu
2024-01-17  3:12 ` [PATCH v1 2/6] drm/lima: reset async_reset on pp hard reset Erico Nunes
2024-01-17 18:17   ` Vasily Khoruzhick
2024-01-18  1:56   ` Qiang Yu
2024-01-17  3:12 ` [PATCH v1 3/6] drm/lima: set bus_stop bit before " Erico Nunes
2024-01-17 18:23   ` Vasily Khoruzhick
2024-01-18  2:01   ` Qiang Yu
2024-01-18 11:43     ` Erico Nunes
2024-01-17  3:12 ` [PATCH v1 4/6] drm/lima: handle spurious timeouts due to high irq latency Erico Nunes
2024-01-17 18:26   ` Vasily Khoruzhick
2024-01-18  2:46   ` Qiang Yu
2024-01-18 11:38     ` Erico Nunes
2024-01-19  1:43   ` Qiang Yu
2024-01-21  3:04     ` Qiang Yu
2024-01-21  9:56   ` Hillf Danton
2024-01-21 11:20     ` Qiang Yu
2024-01-21 15:11       ` Erico Nunes
2024-01-23  1:18         ` Qiang Yu
2024-01-17  3:12 ` Erico Nunes [this message]
2024-01-17 18:28   ` [PATCH v1 5/6] drm/lima: remove guilty drm_sched context handling Vasily Khoruzhick
2024-01-17  3:12 ` [PATCH v1 6/6] drm/lima: improve some pp debug messages Erico Nunes
2024-01-17 18:29   ` Vasily Khoruzhick
2024-01-17  7:22 ` [PATCH v1 0/6] drm/lima: fixes and improvements to error recovery Christian König

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=20240117031212.1104034-6-nunes.erico@gmail.com \
    --to=nunes.erico@gmail.com \
    --cc=airlied@gmail.com \
    --cc=anarsoul@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lima@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    --cc=yuq825@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