From: Michael Rodin <mrodin@de.adit-jv.com>
To: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org
Cc: "Michael Rodin" <mrodin@de.adit-jv.com>,
michael@rodin.online, erosca@de.adit-jv.com,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH 2/3] rcar-csi2: Do not try to recover after transfer error
Date: Thu, 19 May 2022 20:00:08 +0200 [thread overview]
Message-ID: <1652983210-1194-3-git-send-email-mrodin@de.adit-jv.com> (raw)
In-Reply-To: <1652983210-1194-1-git-send-email-mrodin@de.adit-jv.com>
From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Instead of restarting the R-Car CSI-2 receiver if a transmission error
is detected, inform the R-Car VIN driver of the error so it can stop the
whole pipeline and inform user-space. This is done to reflect a updated
usage recommendation in later versions of the datasheet.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
drivers/media/platform/renesas/rcar-vin/rcar-csi2.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
index fea8f00..5a64941 100644
--- a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
@@ -943,21 +943,22 @@ static irqreturn_t rcsi2_irq(int irq, void *data)
rcsi2_write(priv, INTERRSTATE_REG, err_status);
- dev_info(priv->dev, "Transfer error, restarting CSI-2 receiver\n");
-
return IRQ_WAKE_THREAD;
}
static irqreturn_t rcsi2_irq_thread(int irq, void *data)
{
struct rcar_csi2 *priv = data;
+ struct v4l2_event event = {
+ .type = V4L2_EVENT_XFER_ERROR,
+ };
- mutex_lock(&priv->lock);
- rcsi2_stop(priv);
- usleep_range(1000, 2000);
- if (rcsi2_start(priv))
- dev_warn(priv->dev, "Failed to restart CSI-2 receiver\n");
- mutex_unlock(&priv->lock);
+ /* Disable further interrupts to not spam the transfer error event. */
+ rcsi2_write(priv, INTEN_REG, 0);
+
+ dev_err(priv->dev, "Transfer error detected.\n");
+
+ v4l2_subdev_notify_event(&priv->subdev, &event);
return IRQ_HANDLED;
}
--
2.7.4
next prev parent reply other threads:[~2022-05-19 18:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-19 18:00 Improve error handling in the rcar-vin driver Michael Rodin
2022-05-19 18:00 ` [PATCH 1/3] media: videobuf2: Add a transfer error event Michael Rodin
2022-05-19 18:00 ` Michael Rodin [this message]
2022-05-19 18:00 ` [PATCH 3/3] rcar-vin: handle transfer errors from subdevices and stop streaming if required Michael Rodin
2022-05-19 21:00 ` Niklas Söderlund
2022-05-20 19:50 ` Michael Rodin
2022-06-08 21:04 ` Niklas Söderlund
2022-06-28 18:00 ` [PATCH v2 0/3] Improve error handling in the rcar-vin driver Michael Rodin
2022-06-28 18:00 ` [PATCH 1/3] media: videobuf2: Add a transfer error event Michael Rodin
2022-07-04 15:59 ` Nicolas Dufresne
2022-07-15 16:15 ` Michael Rodin
2022-08-02 9:32 ` Hans Verkuil
2022-08-08 17:03 ` Michael Rodin
2022-08-09 7:12 ` Hans Verkuil
2022-06-28 18:00 ` [PATCH 2/3] rcar-csi2: Do not try to recover after transfer error Michael Rodin
2022-06-28 18:00 ` [PATCH 3/3] media: rcar-vin: Allow userspace to subscribe to V4L2_EVENT_XFER_ERROR Michael Rodin
2022-07-05 9:46 ` [PATCH v2 0/3] Improve error handling in the rcar-vin driver Niklas Söderlund
2022-07-15 13:42 ` Michael Rodin
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=1652983210-1194-3-git-send-email-mrodin@de.adit-jv.com \
--to=mrodin@de.adit-jv.com \
--cc=erosca@de.adit-jv.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=michael@rodin.online \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=niklas.soderlund@ragnatech.se \
/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