From patchwork Fri Jan 15 00:21:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 12021125 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A37F0C433E9 for ; Fri, 15 Jan 2021 00:23:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E4AD23AAC for ; Fri, 15 Jan 2021 00:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731272AbhAOAXG (ORCPT ); Thu, 14 Jan 2021 19:23:06 -0500 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:57295 "EHLO bin-mail-out-06.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731271AbhAOAXG (ORCPT ); Thu, 14 Jan 2021 19:23:06 -0500 X-Halon-ID: bdae7d1b-56c7-11eb-b73f-0050569116f7 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de [79.202.36.88]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id bdae7d1b-56c7-11eb-b73f-0050569116f7; Fri, 15 Jan 2021 01:22:25 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH v2 4/4] rcar-csi2: Do not try to recover after transfer error Date: Fri, 15 Jan 2021 01:21:48 +0100 Message-Id: <20210115002148.4079591-5-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115002148.4079591-1-niklas.soderlund+renesas@ragnatech.se> References: <20210115002148.4079591-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org 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 Reviewed-by: Jacopo Mondi --- 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; }