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=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 01230C433E6 for ; Mon, 31 Aug 2020 20:48:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 803162064B for ; Mon, 31 Aug 2020 20:48:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729131AbgHaUsw (ORCPT ); Mon, 31 Aug 2020 16:48:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbgHaUsv (ORCPT ); Mon, 31 Aug 2020 16:48:51 -0400 Received: from hillosipuli.retiisi.org.uk (hillosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::81:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73C1FC061573; Mon, 31 Aug 2020 13:48:51 -0700 (PDT) Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id EB986634C87; Mon, 31 Aug 2020 23:48:33 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1kCqjB-0000zW-QP; Mon, 31 Aug 2020 23:48:33 +0300 Date: Mon, 31 Aug 2020 23:48:33 +0300 From: Sakari Ailus To: Sowjanya Komatineni Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, hverkuil@xs4all.nl, luca@lucaceresoli.net, leonl@leopardimaging.com, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 4/4] media: i2c: imx274: Add IMX274 power on and off sequence Message-ID: <20200831204833.GG844@valkosipuli.retiisi.org.uk> References: <1598903558-9691-1-git-send-email-skomatineni@nvidia.com> <1598903558-9691-5-git-send-email-skomatineni@nvidia.com> <20200831202350.GD844@valkosipuli.retiisi.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 31, 2020 at 01:46:00PM -0700, Sowjanya Komatineni wrote: > > On 8/31/20 1:23 PM, Sakari Ailus wrote: > > > @@ -1968,19 +2087,45 @@ static int imx274_remove(struct i2c_client *client) > > > struct v4l2_subdev *sd = i2c_get_clientdata(client); > > > struct stimx274 *imx274 = to_imx274(sd); > > > + pm_runtime_get_sync(&imx274->client->dev); > > > + > > > /* stop stream */ > > This really shouldn't happen and the driver isn't expected to handle it > > either. > > Do you mean to remove stop stream during remove()? > > Stop stream is not part of this change and as writes to sensor can't happen > when power off, added pm_runtime_get_sync Indeed. But there certainly isn't a need to power the sensor on to stream off, is there? > > > > imx274_write_table(imx274, imx274_stop); > > > v4l2_async_unregister_subdev(sd); > > > v4l2_ctrl_handler_free(&imx274->ctrls.handler); > > > + > > > + pm_runtime_put(&client->dev); > > > + pm_runtime_disable(&client->dev); > > > + pm_runtime_set_suspended(&client->dev); > > > + > > > media_entity_cleanup(&sd->entity); > > > mutex_destroy(&imx274->lock); > > > return 0; > > > } -- Sakari Ailus