From: Herve Codina <herve.codina@bootlin.com>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: dri-devel@lists.freedesktop.org,
Andrzej Hajda <andrzej.hajda@intel.com>,
David Airlie <airlied@gmail.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Jonas Karlman <jonas@kwiboo.se>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>, Simona Vetter <simona@ffwll.ch>,
Thomas Zimmermann <tzimmermann@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/bridge: ti-sn65dsi83: Improve error reporting and handling
Date: Tue, 24 Jun 2025 14:03:45 +0200 [thread overview]
Message-ID: <20250624140345.77e8780d@bootlin.com> (raw)
In-Reply-To: <20250624114630.303058-1-mike.looijmans@topic.nl>
Hi Mike,
On Tue, 24 Jun 2025 13:45:15 +0200
Mike Looijmans <mike.looijmans@topic.nl> wrote:
> The datasheet advises to wait 5ms after starting the video stream before
> resetting the error registers. The driver only waits 1ms. Change the
> sequence to match the datasheet:
> - Turn on the DSI
> - Wait 5ms
> - Write 0xFF to CSR 0xE5 to clear the error registers
>
> Don't read the error register (which may fail), just write 0xff as the
> datasheet suggests.
>
> The driver creates a timer or IRQ handler that reads the error register,
> which implements the "wait some time and read the register" part.
>
> When using a timer to poll the status register, the timer did not stop
> when the error handler triggers a reset. This has been observed to cause
> a series of multiple resets. Let handle_errors return a bool indicating
> whether all is fine, and only extend the time when it returns true. That
> also allows the IRQ disable call to move to the interrupt routine.
>
> When the error handler does trigger, log a message that explains the
> reset cause.
>
> Fixes: ad5c6ecef27e ("drm: bridge: ti-sn65dsi83: Add error recovery mechanism")
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
> ---
>
> drivers/gpu/drm/bridge/ti-sn65dsi83.c | 50 +++++++++++++++------------
> 1 file changed, 28 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
...
> @@ -929,7 +926,16 @@ static irqreturn_t sn65dsi83_irq(int irq, void *data)
> {
> struct sn65dsi83 *ctx = data;
>
> - sn65dsi83_handle_errors(ctx);
> + if (!sn65dsi83_handle_errors(ctx)) {
> + /*
> + * IRQ acknowledged is not always possible (the bridge can be in
> + * a state where it doesn't answer anymore). To prevent an
> + * interrupt storm, disable interrupt. The interrupt will be
> + * after the reset.
I think I have missed a verb in the last sentence when I previously wrote
the comment.
"The interrupt will be re-enabled after the reset."
^^^^^^^^^^
Can you fix it ?
Other than that,
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Thanks,
Hervé
prev parent reply other threads:[~2025-06-24 12:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.213ecd1f-6e92-42df-b45b-58dd7ea05682@emailsignatures365.codetwo.com>
2025-06-24 11:45 ` Mike Looijmans
2025-06-24 12:03 ` Herve Codina [this message]
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=20250624140345.77e8780d@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mike.looijmans@topic.nl \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®