Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp406210rwi; Thu, 27 Oct 2022 02:59:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Vuy+HS8CsjE/CvXuc8O60yr7YuYmRkcDmCkjS7TpldLwhkWxT2wp7w/WdeOciDOzxbNOk X-Received: by 2002:aa7:cd13:0:b0:461:f8ad:46f4 with SMTP id b19-20020aa7cd13000000b00461f8ad46f4mr15203302edw.421.1666864798939; Thu, 27 Oct 2022 02:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666864798; cv=none; d=google.com; s=arc-20160816; b=Gy+l7w7zANLKlFr2/HuuH6UgL/ABZJ32AZPDwHPUSdi1PKZrSl9EqOGEpp3i3MFqh6 /ODGVbW7IOYo+cTlAsQO+iwNyQ1mmV0M1i9rb0b93HN9syy2fkmzfsPzymF+5pGt3oaU HPaT+M1Ip5R5bQbw6Iblt2f+6xpuKjgyt1ftG77CCDdATiuzpuvmW6OsVUQa1Fiu5Zqs 6GKAshWknmQLAXEXh60WVi1Y0BMnwS+j16SVc49vE34LJnNH/A0rZh3zNsf0k4ahqdvP 48nKolq87lwUeY8j3ReDhVZtcYkeWjMIOfyaFGW/RifLnFWU5B+VIn9DnErjUGTnxKCS FV2g== 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=IWPyJZW5AVoC+nrDVVz16Q/2YNSTwOB7weYuST5UkDM=; b=NBlN5KFaYaTtv45CGO80z4qd4T/aLYxeWrJSPssHWsEFmB1Sm9dTkzKPLT9p2pxIUX Ia8yWtwoEKpWWj5u6vS0mRQJ+/fUBQmB9k9UoXUcYJgxVZq5v5D8/WROcajKjt+3m+jF dloBIHWv/SonfhigaZbusofkeCH+2aZsSFbPKarKC4prKX+nD79Ay6vRVn02ZOXUpPCL BFX/LcFXA42dT8fA3QgDArsstslbSrjItei0RX8u1FicQqzp6yvz1c7Oid59f5ef0/fu mloYmeLb89L7+2LBWPcklq28Fs8AMPjfowh/4bI7KG1c1D8IuLVawFJVmeb28ObIhytv WqxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jDWhFlSO; 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 l19-20020a170906795300b0078d3b452573si1179537ejo.968.2022.10.27.02.59.30; Thu, 27 Oct 2022 02:59:58 -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=jDWhFlSO; 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 S234892AbiJ0JtW (ORCPT + 99 others); Thu, 27 Oct 2022 05:49:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234810AbiJ0JtU (ORCPT ); Thu, 27 Oct 2022 05:49:20 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A65A96396; Thu, 27 Oct 2022 02:49:19 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id a67so1706336edf.12; Thu, 27 Oct 2022 02:49:19 -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=IWPyJZW5AVoC+nrDVVz16Q/2YNSTwOB7weYuST5UkDM=; b=jDWhFlSODS1EWcJZZeGu65cVUR9mHawB/5m7LVZcG1/shMrHhfwkLWzJ9qiJlehoR/ WoD2GU6tA1YkVAB5uX6meQVb2pkppteLdaU+N4F/LHK2ujAUkKLHtgNpqewbR8HdfeOR NPDqf6vccVGlvfM77hnmobflfGQ1TFycN1HdfyWbBTczYXJ29RLojyk9JmfqSFUGaeay KmzBRb1KzC2YS7pYl+JQRBwOKBqC3IteefHZy8KY0LdBh4E9cuBuUfIFikzbB/GqN1RZ B3IE2uVwYM4EhHKDqUtHio8mqPTlc34G0or/HSsw2FHYSBrazekliDIwZk/AXpMgUWrc ukZA== 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=IWPyJZW5AVoC+nrDVVz16Q/2YNSTwOB7weYuST5UkDM=; b=CorCta9FF3TdyiAzUIIEkg4G7RGqxTnImPRWaI89C1Zd0D824zfB/MD/mpb6edGMM0 hc8BIuAXmCv19Al9KiCwIWR27JMNKkkdHWCXdy6fmrBueWVa9Va8tq3weW25/rJVx9DF 24ZqyOaitmiOHGUIR55elXLgzTaqpFUwzx06t5VSNkejejzbQrzKmUXhjEO4X/u6zEo+ +3sfRNGpVArR9rff3exj4gJbwATkvffd6ZlJZafuvzIMUGhkJf58pQd9H2KwO9d708te pGnfcMebx6wGyL0TIYy0oyAQmH5I9IhQO4pGssrZTA99i5Gyz6+AuOKk+iYsCeexE9TE 9L+Q== X-Gm-Message-State: ACrzQf3IZC4oe+QT/1n25m5qLh3S0oljWCQlNmQZRm9b6f5pMcqz/eoJ w0N+JAofIF5mON3V3JODsmakE9EqtcxWC3HqCZY= X-Received: by 2002:a05:6402:26cf:b0:45d:48d7:928e with SMTP id x15-20020a05640226cf00b0045d48d7928emr43252923edd.275.1666864158072; Thu, 27 Oct 2022 02:49:18 -0700 (PDT) MIME-Version: 1.0 References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221026130658.45601-7-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Thu, 27 Oct 2022 10:48:51 +0100 Message-ID: Subject: Re: [PATCH v3 6/9] media: i2c: ov5645: Use runtime PM To: Sakari Ailus Cc: 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 , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Biju Das , Lad Prabhakar 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 Sakari, On Thu, Oct 27, 2022 at 10:22 AM Sakari Ailus wrote: > > Hi Prabhakar, > > Thanks for the update. > > On Wed, Oct 26, 2022 at 02:06:55PM +0100, Prabhakar wrote: > > From: Lad Prabhakar > > > > Switch to using runtime PM for power management. > > > > Signed-off-by: Lad Prabhakar > > Reviewed-by: Laurent Pinchart > > --- > > v2->v3 > > * Jumped to err_pm_runtime label in case of sd register failure > > * Now calling pm_runtime_mark_last_busy() before pm_runtime_put_autosuspend() > > call > > * Now calling pm_runtime_put_sync() in case s_stream(1) fails > > * In s_stream(0) no calling pm_runtime_mark_last_busy() and > > pm_runtime_put_autosuspend() > > * Included RB tag from Laurent. > > > > v1->v2 > > * Moved pm_runtime_*_autosuspend() calls after registering the subdev. > > --- > > drivers/media/i2c/Kconfig | 2 +- > > drivers/media/i2c/ov5645.c | 141 +++++++++++++++++++------------------ > > 2 files changed, 73 insertions(+), 70 deletions(-) > > > > diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig > > index 7806d4b81716..c0edd1017fe8 100644 > > --- a/drivers/media/i2c/Kconfig > > +++ b/drivers/media/i2c/Kconfig > > @@ -459,7 +459,7 @@ config VIDEO_OV5640 > > config VIDEO_OV5645 > > tristate "OmniVision OV5645 sensor support" > > depends on OF > > - depends on I2C && VIDEO_DEV > > + depends on I2C && PM && VIDEO_DEV > > I think you can drop the PM dependency --- the driver will work fine > without CONFIG_PM. > Agreed, I'll send a new version dropping this and fixing the comments on patch #5 and patch #8. > Although one could question why do we have CONFIG_PM. Some systems won't > boot without it and who would want to consume more power than necessary? > > Could this be removed altogether? Or perhaps we could add CONFIG_PM > dependency to V4L2 and DVB? :-) > Or rather this option should be selected by the platform itself rather than subsystem? Cheers, Prabhakar