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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 E1030C433E0 for ; Mon, 25 May 2020 11:52:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCE6A2071A for ; Mon, 25 May 2020 11:52:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="J7zkISA9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390270AbgEYLwc (ORCPT ); Mon, 25 May 2020 07:52:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390208AbgEYLwb (ORCPT ); Mon, 25 May 2020 07:52:31 -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 07118C061A0E for ; Mon, 25 May 2020 04:52:29 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id bs4so14795474edb.6 for ; Mon, 25 May 2020 04:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P/cWAJl3Z7M7phJWdZ1viutRbSoAqLOTBAKufEZLlQs=; b=J7zkISA9IACBaVZfIy7JcdxpE2ftuH3PzvgPxwCPTVvWLm94b33+EPTzq46DDaYm2H tCRXLAp5upCjONBGcvqexKg7AU8Ka8ylT2X4YZPrLOUyQsXkiPls4zRxhVigqskhJ8Qc R2JRs8LOj+hBFPv1FWpfNKziFvgfyUK87dOXA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P/cWAJl3Z7M7phJWdZ1viutRbSoAqLOTBAKufEZLlQs=; b=eWGPWKRX6cMGGhDInJYzB208D3JOn8/vSENANVAluhA8FsXKV6Z8jqQHSyi6iMgVPq I0N0Cl/2vXjQVjn5OjlS84IVZhm6r5YGpergx3DMh4MD9nMnxVm4ZlUqvlEXigeIacsN 2Oxto8w8hPSiEz5+AgGPA7gZGCoeZj1j/2LLBXBkxxcB1FhNQwW0dnR1K+TQejgph1jt fX0YCzit14zxxrgVgNEV5zHPowEKX9hPFHYOPj/ceVyj3yl78FX0eR1IHrGaMfoz9GjM YZDX9Xr+xKI0vmlmrSZJllP4SMlcIX+Wfza2mpcNy9jLU8SEFTxvAIOh1BPK7EYW4xKr sawA== X-Gm-Message-State: AOAM531BZNFGqWdZmwOFKg8mS4Xpb5UdGnAt1cOVAp7We7IN4AvcXKM+ N689jwncB+pFelrFxuUeCakTnHc4997BDQ== X-Google-Smtp-Source: ABdhPJwqMfFiSytTInTziIW2InU3iQdNG/oiD33rTvTL94s8ITE76NmbWdgrZRQbC5E5cNrRjkw62w== X-Received: by 2002:aa7:d999:: with SMTP id u25mr15156266eds.339.1590407547170; Mon, 25 May 2020 04:52:27 -0700 (PDT) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com. [209.85.221.54]) by smtp.gmail.com with ESMTPSA id 93sm16056929edy.49.2020.05.25.04.52.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 May 2020 04:52:26 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id i15so16780133wrx.10 for ; Mon, 25 May 2020 04:52:26 -0700 (PDT) X-Received: by 2002:adf:e543:: with SMTP id z3mr14316481wrm.385.1590407120295; Mon, 25 May 2020 04:45:20 -0700 (PDT) MIME-Version: 1.0 References: <20200518132731.20855-1-dongchun.zhu@mediatek.com> <20200518132731.20855-3-dongchun.zhu@mediatek.com> <20200521195113.GC14214@chromium.org> <1590139561.8804.390.camel@mhfsdcap03> In-Reply-To: <1590139561.8804.390.camel@mhfsdcap03> From: Tomasz Figa Date: Mon, 25 May 2020 13:45:07 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [V6, 2/2] media: i2c: dw9768: Add DW9768 VCM driver To: Dongchun Zhu Cc: Linus Walleij , Bartosz Golaszewski , Mauro Carvalho Chehab , Andy Shevchenko , Rob Herring , Mark Rutland , Sakari Ailus , 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 , =?UTF-8?B?U2hlbmduYW4gV2FuZyAo546L5Zyj55S3KQ==?= Content-Type: text/plain; charset="UTF-8" Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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. Best regards, Tomasz