linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erico Nunes <nunes.erico@gmail.com>
To: Qiang Yu <yuq825@gmail.com>,
	anarsoul@gmail.com, christian.koenig@amd.com,
	dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org
Cc: 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>,
	linux-kernel@vger.kernel.org, Erico Nunes <nunes.erico@gmail.com>
Subject: [PATCH v2 2/8] drm/lima: reset async_reset on gp hard reset
Date: Wed, 24 Jan 2024 03:59:41 +0100	[thread overview]
Message-ID: <20240124025947.2110659-3-nunes.erico@gmail.com> (raw)
In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com>

Lima gp jobs use an async reset to avoid having to wait for the soft
reset right after a job. The soft reset is done at the end of a job and
a reset_complete flag is expected to be set at the next job.
However, in case the user runs into a job timeout from any application,
a hard reset is issued to the hardware. This hard reset clears the
reset_complete flag, which causes an error message to show up before the
next job.
This is probably harmless for the execution but can be very confusing to
debug, as it blames a reset timeout on the next application to submit a
job.
Reset the async_reset flag when doing the hard reset so that we don't
get that message.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
---
 drivers/gpu/drm/lima/lima_gp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/lima/lima_gp.c b/drivers/gpu/drm/lima/lima_gp.c
index 8dd501b7a3d0..b9a06e701a33 100644
--- a/drivers/gpu/drm/lima/lima_gp.c
+++ b/drivers/gpu/drm/lima/lima_gp.c
@@ -189,6 +189,13 @@ static int lima_gp_hard_reset(struct lima_ip *ip)
 	gp_write(LIMA_GP_PERF_CNT_0_LIMIT, 0);
 	gp_write(LIMA_GP_INT_CLEAR, LIMA_GP_IRQ_MASK_ALL);
 	gp_write(LIMA_GP_INT_MASK, LIMA_GP_IRQ_MASK_USED);
+
+	/*
+	 * if there was an async soft reset queued,
+	 * don't wait for it in the next job
+	 */
+	ip->data.async_reset = false;
+
 	return 0;
 }
 
-- 
2.43.0


  parent reply	other threads:[~2024-01-24  3:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24  2:59 [PATCH v2 0/8] drm/lima: fixes and improvements to error recovery Erico Nunes
2024-01-24  2:59 ` [PATCH v2 1/8] drm/lima: reset async_reset on pp hard reset Erico Nunes
2024-01-24  2:59 ` Erico Nunes [this message]
2024-01-24  2:59 ` [PATCH v2 3/8] drm/lima: set pp bus_stop bit before " Erico Nunes
2024-01-24  2:59 ` [PATCH v2 4/8] drm/lima: set gp " Erico Nunes
2024-01-24  2:59 ` [PATCH v2 5/8] drm/lima: handle spurious timeouts due to high irq latency Erico Nunes
2024-01-24 12:38   ` Qiang Yu
2024-01-29 22:55     ` Erico Nunes
2024-01-30  1:05       ` Qiang Yu
2024-01-24  2:59 ` [PATCH v2 6/8] drm/lima: remove guilty drm_sched context handling Erico Nunes
2024-01-24  2:59 ` [PATCH v2 7/8] drm/lima: increase default job timeout to 10s Erico Nunes
2024-01-24  2:59 ` [PATCH v2 8/8] drm/lima: standardize debug messages by ip name Erico Nunes
2024-01-30  1:07 ` [PATCH v2 0/8] drm/lima: fixes and improvements to error recovery Qiang Yu
2024-02-12  8:40   ` Qiang Yu

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=20240124025947.2110659-3-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;
as well as URLs for NNTP newsgroup(s).