From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 BEA15C433E0 for ; Thu, 4 Jun 2020 08:10:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7802206C3 for ; Thu, 4 Jun 2020 08:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbgFDIKm (ORCPT ); Thu, 4 Jun 2020 04:10:42 -0400 Received: from mga02.intel.com ([134.134.136.20]:22184 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbgFDIKm (ORCPT ); Thu, 4 Jun 2020 04:10:42 -0400 IronPort-SDR: k2PffX4gI4onnC2BwLanvyM4Ds9H/j71SzOyGLlu/2QUZWL0jcTDkNYu99ywLTs7TD24WXHA13 pmgNmi9O39XA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 01:10:39 -0700 IronPort-SDR: CbG8SA9IhTmLTH3EL+wOoj7Z+e/tx6p7eh+kvesL/bCsdRHwoUHbG9MoFKrrpylBG1+ENZXDTC ZYuSLrwBrVXA== X-IronPort-AV: E=Sophos;i="5.73,471,1583222400"; d="scan'208";a="294250715" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 01:10:34 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id D771F20859; Thu, 4 Jun 2020 11:10:32 +0300 (EEST) Date: Thu, 4 Jun 2020 11:10:32 +0300 From: Sakari Ailus To: Dongchun Zhu Cc: Tomasz Figa , Linus Walleij , Bartosz Golaszewski , Mauro Carvalho Chehab , Andy Shevchenko , Rob Herring , Mark Rutland , Nicolas Boichat , Matthias Brugger , Cao Bing Bu , srv_heupstream , "moderated list:ARM/Mediatek SoC support" , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Sj Huang , Linux Media Mailing List , linux-devicetree , Louis Kuo , Shengnan Wang =?utf-8?B?KOeOi+Wco+eUtyk=?= Subject: Re: [V6, 2/2] media: i2c: dw9768: Add DW9768 VCM driver Message-ID: <20200604081032.GG16711@paasikivi.fi.intel.com> References: <20200518132731.20855-1-dongchun.zhu@mediatek.com> <20200518132731.20855-3-dongchun.zhu@mediatek.com> <20200521195113.GC14214@chromium.org> <1590139561.8804.390.camel@mhfsdcap03> <1590570089.8804.453.camel@mhfsdcap03> <1591238018.8804.555.camel@mhfsdcap03> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1591238018.8804.555.camel@mhfsdcap03> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Thu, Jun 04, 2020 at 10:33:38AM +0800, Dongchun Zhu wrote: > Hi Tomasz, > > On Mon, 2020-06-01 at 20:47 +0200, Tomasz Figa wrote: > > On Wed, May 27, 2020 at 11:03 AM Dongchun Zhu wrote: > > > > > > Hi Tomasz, > > > > > > On Mon, 2020-05-25 at 13:45 +0200, Tomasz Figa wrote: > > > > On Fri, May 22, 2020 at 11:27 AM Dongchun Zhu wrote: > > > > > > > > > > Hi Tomasz, > > > > > > > > > > Thanks for the review. My replies are as below. > > > > > > > > > > On Thu, 2020-05-21 at 19:51 +0000, Tomasz Figa wrote: > > > > > > Hi Dongchun, Sakari, > > > > > > > > > > > > On Mon, May 18, 2020 at 09:27:31PM +0800, Dongchun Zhu wrote: > > > > [snip] > > > > > > > + pm_runtime_enable(dev); > > > > > > > + if (!pm_runtime_enabled(dev)) { > > > > > > > + ret = dw9768_runtime_resume(dev); > > > > > > > + if (ret < 0) { > > > > > > > + dev_err(dev, "failed to power on: %d\n", ret); > > > > > > > + goto entity_cleanup; > > > > > > > + } > > > > > > > + } > > > > > > > + > > > > > > > + ret = v4l2_async_register_subdev(&dw9768->sd); > > > > > > > + if (ret < 0) > > > > > > > + goto entity_cleanup; > > > > > > > + > > > > > > > + return 0; > > > > > > > + > > > > > > > +entity_cleanup: > > > > > > > > > > > > Need to power off if the code above powered on. > > > > > > > > > > > > > > > > Thanks for the reminder. > > > > > If there is something wrong with runtime PM, actuator is to be powered > > > > > on via dw9768_runtime_resume() API. > > > > > When actuator sub-device is powered on completely and async registered > > > > > successfully, we shall power off it afterwards. > > > > > > > > > > > > > The code above calls dw9768_runtime_resume() if > > > > !pm_runtime_enabled(dev), but the clean-up code below the > > > > entity_cleanup label doesn't have the corresponding > > > > dw9768_runtime_suspend() call. > > > > > > > > > > Did you mean the 'entity_cleanup' after v4l2_async_register_subdev()? > > > > Yes. > > > > > Actually I made some changes for OV02A V9, according to this comment. > > > Could you help review that change? Thanks. > > > > Sure, I will take a look. > > > > Thanks. > Sorry, I just wanna make sure the change is okay for next release. > May we use the check like OV02A V9 did? > ret = v4l2_async_register_subdev(&dw9768->sd); > if (ret < 0) { > if (!pm_runtime_enabled(dev)) > dw9768_runtime_suspend(dev); Please do this part where you're jumping to, if possible. > goto entity_cleanup; > } > -- Sakari Ailus