Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1109789rwi; Wed, 26 Oct 2022 10:53:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6O68sxG1NORfTsFf58mmEw7arZmtgUX4L5VAKqjR5thrNn5rKAZdelCVv8X4OUJqZOE7b7 X-Received: by 2002:a63:c5d:0:b0:460:17cc:73a6 with SMTP id 29-20020a630c5d000000b0046017cc73a6mr38204228pgm.332.1666806783367; Wed, 26 Oct 2022 10:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666806783; cv=none; d=google.com; s=arc-20160816; b=vdXPbCYHZZZcXKGS4xpu0UEEBQ5GdEQWyQgrfPt86R0UnNXsYHrMstyNRokt0PxGmj MFq+3DrpPPmZrtOLOM60z08M0n1wb8/N8tMKrQlwmwVC/cqqro/MgPIBz+BE3DDMWV2A 6gCG+EmXvwy6aPf20Sv+ZWy7zPf2v8yPK2Mh+vcD6kJPerxjlkEvmLCZYnJTkQ+Rq1bl lLAGnqFWxoM7efmOJq+2KMf8L9y2393Hs+dmv5S8/Noe9rh+kXfFUSbJDueOn8KTJWWB 7WelekLsgypNV+E9qXD5rWW6vq836wEwAxHrVGWvKXxUphZgRzUf5x2Csm4h/Kn/gaK/ uetg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=M+gTI6E5G13ZWQ1sOKyrkRFmkRt95JRJrFWHWwAoW2U=; b=NE8FzuN3HJp3TT6od6g2ZXjAq0pPVHCs699ZD9ibpEeeXbbWXYtBki5M4kCOGobOZt GU/xJfP8hifcHJDyJeOR4hZ7JkrlwFj3nRFZRaOGu34Oq824WTic37S6Mntfi7vqGsd/ 89gW4zA4Y6gBdhhIE8MQWPnRPLcSZJgnbjb8kjFutT5SIqes7A0lKnpC7PAPIhNqXCA+ v4q97XQl70B4k7JI6kYkwXiutTEUoU3XKVgQNdwQpDUcZM7Mvds0JiO98oW6zJ853xRR rD19OSYJu92BaWf8AcB53ptNUx9spuMErxIwY5zoGhMUNA6ECxkX7d1J7tOUlekqyFwN UQNA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q196-20020a632acd000000b0046ecbfda04csi6741325pgq.823.2022.10.26.10.52.50; Wed, 26 Oct 2022 10:53:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233925AbiJZRfx (ORCPT + 99 others); Wed, 26 Oct 2022 13:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233859AbiJZRfv (ORCPT ); Wed, 26 Oct 2022 13:35:51 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0067A2ABC for ; Wed, 26 Oct 2022 10:35:49 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onkJG-0005YF-1O; Wed, 26 Oct 2022 19:35:22 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1onkJD-00060f-7f; Wed, 26 Oct 2022 19:35:19 +0200 Date: Wed, 26 Oct 2022 19:35:19 +0200 From: Marco Felsch To: "Lad, Prabhakar" 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 Subject: Re: [PATCH v3 8/9] media: i2c: ov5645: Don't return early on failures for s_stream(0) Message-ID: <20221026173519.bm22im7uov6b4nnp@pengutronix.de> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On 22-10-26, Lad, Prabhakar wrote: > 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? Why not just say? ret = ov5645_write_reg(); if (ret < 0) goto out; ... out: dev_pm_xxx(); return ret; Regards, Marco