Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1147336rwi; Wed, 26 Oct 2022 11:18:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5vVgbyYQ79Bw9Sme8RpJ0SbP106KEk8KQD7b1zDDusOt8KRRKrodfadeqxDlvTAK2CeXBr X-Received: by 2002:a17:90b:33cd:b0:20d:9da6:56e3 with SMTP id lk13-20020a17090b33cd00b0020d9da656e3mr5588442pjb.143.1666808324934; Wed, 26 Oct 2022 11:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666808324; cv=none; d=google.com; s=arc-20160816; b=UGLg0r/LboGy3UGguvJ+br9Q3if71gW/J1fkN9FRnhWXgE/ZE5jh80F7yM+dXuqVpk ia7uPnL530YunviQgv+5SCr7d+my4fCToxABDMz3j1M9eHztI9qGEtAh+wOptI1yozjP e/4w34/t2ARyjT4Cq+DCZ0IK0uQVJq9HKgwI8DpPd6nT4Lxjrn1BoFDpX8S5bEdYLFm2 gfcrXiKq8Tt9mP7EGpwSPFOLzjAMf9cakxJb8ecs4yw+rJ9sueEnBl0wn35GVS81VvHa FL1N3WBxhVDvvG82Ty6njWhWxAr1D+OLOi+fEe4e4f/yd7gqoHtbHn+53/ZXghr9eDno n9GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YT9dZTW1IcvIzEw+/TA0JI+18vP7bQFANMlj5OcRlS0=; b=EeX9XEkG1vdmX9mdLNYhbno5fZQg/lPwOkv2SABd1JTZM+/zK79XMr3VifLQJFs+ZQ li4CV4OIQcXyvA9tC2xG8MVU5hMYqv8vwZTkZw3tvQa7mebEPMTMbhMGxxfNVTX92zKC aeKKmTSAhjncwNu+m8TgtkvOuA3sbm2Whbjd9LGOmpkzrX+T0ZphfNIbjC15nSp4EbPt /XXwtxiYmtj8EZdfHQ4hkGhJGUwKxWafPAOYV28DIfZFVE+yJcrJk6N1jfAT9YomoheS 2+r42M1i653QcohqNYoZF8oal6Z3CoEeOLzUWu2/HOQiqI0Jv2hNDCP2iXWxKHS76Xkx dVYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JqiaRixr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o137-20020a62cd8f000000b00563764cecb3si6938325pfg.279.2022.10.26.11.18.28; Wed, 26 Oct 2022 11:18:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JqiaRixr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233343AbiJZR1U (ORCPT + 99 others); Wed, 26 Oct 2022 13:27:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233721AbiJZR1T (ORCPT ); Wed, 26 Oct 2022 13:27:19 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22C11FE91C; Wed, 26 Oct 2022 10:27:18 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id a67so42685309edf.12; Wed, 26 Oct 2022 10:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YT9dZTW1IcvIzEw+/TA0JI+18vP7bQFANMlj5OcRlS0=; b=JqiaRixrE6P83gh5A98tk32sYSCxaspmzZxsQ88zMlY3nS+AKcyK5zmhwfRfPf/cRb /sgLqcFiec6hDHwog9PItF12obB7ZatkR5sdEV9UNKSyYWpELvwICcHjogvwQIrS0XqS nOT+MqkERNa4x5pYbYEXDos/imjy5P9HYKPZXlOHO3hAF3z8yv/LOh9jnT2pFd21AY6V W8CncXWNY3GjB7IS5uWFw47leUf+r3LEBqgspybj3ZZVQ2LKG+oepXxo4kn6ZUWrL2vb z06GL/HDOtwlsQGZ4PCqUbSYDInjH6W/eNuIVjESTNeNk2UQN4r30Vpvxw2WBrvm4riV CcHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YT9dZTW1IcvIzEw+/TA0JI+18vP7bQFANMlj5OcRlS0=; b=h6uqM1AJX07gOtfkKmwck8LqnnR8UOvCHNE2N5ibT8j2IUCD9plPJHgbb5zpHaxDN+ OYJPXU1xwyOXjBDgmF4jEKIURjmdXOoznm7961S1XZFpXU9nQql4Ed0dggDNCmi8fyU6 30NOl5ZBsAbLlgRZDufS6rl35WLmoTdinKOERwsi4mz7l5ujua7q6y+Lu5c99/SQtHD3 MQwIiobHc/q58uvziW9lutkThp39ZSocvPlMr+gzYZmf9EDf2jc2RKVjZjWsD9th9T9Q x1hJlEVp629+JoHFgpjOsWcu4zgeENaF+nEkyAG/TOKOA+Xo1EKEBPbB3t+JmpNrWbD/ GRKg== X-Gm-Message-State: ACrzQf0E8SpJxMud/zzzdgkBBZULxDqnQIrgyNuyb5NNSObPHjYDFk6q OIYKZbp/RCM5j0YAo5zCUAIe6hu8/9pMMCq9ZWM= X-Received: by 2002:a05:6402:26cf:b0:45d:48d7:928e with SMTP id x15-20020a05640226cf00b0045d48d7928emr40535848edd.275.1666805236670; Wed, 26 Oct 2022 10:27:16 -0700 (PDT) MIME-Version: 1.0 References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221026130658.45601-9-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221026171721.4nfvhamguwnrw6zf@pengutronix.de> In-Reply-To: <20221026171721.4nfvhamguwnrw6zf@pengutronix.de> From: "Lad, Prabhakar" Date: Wed, 26 Oct 2022 18:26:49 +0100 Message-ID: Subject: Re: [PATCH v3 8/9] media: i2c: ov5645: Don't return early on failures for s_stream(0) To: Marco Felsch Cc: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil , Shawn Tu , devicetree@vger.kernel.org, Jacopo Mondi , linux-kernel@vger.kernel.org, Lad Prabhakar , linux-renesas-soc@vger.kernel.org, Biju Das , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marco, Thank you for the review. On Wed, Oct 26, 2022 at 6:17 PM Marco Felsch wrote: > > Hi Prabhakar, > > thanks for the patch, please see below my comments. > > On 22-10-26, Prabhakar wrote: > > From: Lad Prabhakar > > > > Make sure we dont stop the code flow in case of errors while stopping > > the stream and return the error code of the first error case if any. > > > > v4l2-core takes care of warning the user so no need to add a warning > > message in the driver. > > > > Suggested-by: Sakari Ailus > > Signed-off-by: Lad Prabhakar > > --- > > v2->v3 > > * Now propagating the first error code in case of failure. > > > > v1->v2 > > * New patch > > --- > > drivers/media/i2c/ov5645.c | 11 ++++++++--- > > 1 file changed, 8 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c > > index eea3067ddc8b..5702a55607fc 100644 > > --- a/drivers/media/i2c/ov5645.c > > +++ b/drivers/media/i2c/ov5645.c > > @@ -996,17 +996,22 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) > > if (ret < 0) > > goto err_rpm_put; > > } else { > > + int stream_off_ret = 0; > > + > > ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40); > > If this write failed.. > > > if (ret < 0) > > - return ret; > > + stream_off_ret = ret; > > > > ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, > > OV5645_SYSTEM_CTRL0_STOP); > > why should this write be successful? > Indeed that will fail unless I have a lucky day ;-) But it seemed to be an overkill for adding an additional check to see if the previous write succeeded. Do you think this will create an issue? Cheers, Prabhakar