All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: linux-media@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH 4/4] rcar-csi2: Do not try to recover after transfer error
Date: Thu, 12 Nov 2020 23:51:47 +0100	[thread overview]
Message-ID: <20201112225147.1672622-5-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20201112225147.1672622-1-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>
---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
index 945d2eb8723367f0..a7212ecc46572a3b 100644
--- a/drivers/media/platform/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
@@ -773,21 +773,19 @@ 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_EOS,
+	};
 
-	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);
+	dev_err(priv->dev, "Transfer error detected.\n");
+
+	v4l2_subdev_notify_event(&priv->subdev, &event);
 
 	return IRQ_HANDLED;
 }
-- 
2.29.2


  parent reply	other threads:[~2020-11-12 22:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 22:51 [PATCH 0/4] rcar-csi2: Update handling of transfer error Niklas Söderlund
2020-11-12 22:51 ` [PATCH 1/4] rcar-vin: Do not try to stop stream if not running Niklas Söderlund
2020-11-16 16:28   ` Jacopo Mondi
2021-01-15  0:15     ` Niklas Söderlund
2020-11-12 22:51 ` [PATCH 2/4] rcar-vin: Route events to correct video device Niklas Söderlund
2020-11-16 16:54   ` Jacopo Mondi
2020-11-12 22:51 ` [PATCH 3/4] rcar-vin: Stop stream when subdevice signal EOS Niklas Söderlund
2020-11-16 16:58   ` Jacopo Mondi
2021-01-15  0:17     ` Niklas Söderlund
2020-11-12 22:51 ` Niklas Söderlund [this message]
2020-11-16 17:09   ` [PATCH 4/4] rcar-csi2: Do not try to recover after transfer error Jacopo Mondi
2021-01-15  0:19     ` Niklas Söderlund
2021-11-08 16:02 [PATCH 0/4] media: videobuf2: Add a transfer error event Niklas Söderlund
2021-11-08 16:02 ` [PATCH 4/4] rcar-csi2: Do not try to recover after transfer error Niklas Söderlund

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=20201112225147.1672622-5-niklas.soderlund+renesas@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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.