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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham 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 3E354C433B4 for ; Wed, 5 May 2021 11:20:01 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B92DD610A7 for ; Wed, 5 May 2021 11:20:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B92DD610A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cm2VwnAnMA9z2V6EZXnFkjwhBcbPuJlbZErmzrC2YLg=; b=jZ+f94uNbAG6x4/tUgrdhba1F kwV17zv0/aQa+3wJz36lQXAPK+81qR9XW1Nso4bTM0RX+LQRhWYmpZ1kxc5lJh62en8h+R3pnjvPp dd/RrRnAVj9XebFvn1uCsa13PHxl+/0BnIjDNdMhrepUZAlEBuKYOYqyBfVjXlcYee9Aay24TVG1/ n+/FLPe8jndl3+3apGELRVTsjKEW2rLYcmYUKsTPCE7VEfJSShY+sZxds57H60/MGAtYhBwr73Ovv iy3CyYxFXywZoSR2ctHL4q7H5iNO0LGO9lJd6WxE7x6A84bfINFkF6AV0y3hO/2NAp0fa5YuBbCbs e9FiPSPSQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leFX9-0014KV-1V; Wed, 05 May 2021 11:17:39 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leFX7-0014KF-7U for linux-arm-kernel@desiato.infradead.org; Wed, 05 May 2021 11:17:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description; bh=d7NxNUbb11MRMNAWPIerQVedZUEzUSibQmA+3R5GpPY=; b=Ut7wSLkdqeMyqetdlnKzJMQiGM QJ0U0NeFNyWN+nRdm3bvf2HcpHky+6U7vKwWT2V12fXKW7yPlyI3hBMzpo7aVJ5Bbr8S6/0xViNKl oR740B118++xLQMDNJNtxOrBNq6yrzT9W6xDB48RCI3R+sa+QxcZY/9Y1rGEk6J4V+j+mna8fQNlH 2SyGWlNUkT9EPezyPubFIVPsr7EPNWBWfmbx0kQeCaTxCUiIUfHFajAFfnoOz6kTpc2bc5SqYOhGD LokM76nJFKqiwXoPS2jhILkA9jvxNT5m3LOhXb/XVtd4ISdmGMZ5ikc7kft8feRF3pXoMVu15ScyS 4o4EGe3Q==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leFX4-004hN2-I3 for linux-arm-kernel@lists.infradead.org; Wed, 05 May 2021 11:17:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57710611AD; Wed, 5 May 2021 11:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620213454; bh=6bWQBkyrtcoK6PbWPlqLcwI7QzrahpA09bOWsUzwsC0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H1skVirY1eMlbe3Cnm8EoDLq0eLg1YRq5YJDGvwUYpXAL51KopxAMqglG2tq0FIoZ wAlADhbbyZoLAuxfrsQV5BXIvTrh3f7tAHPzNrQG8CR5FssNULrb93GkQ99NYr063a WQQ8TpBoZtcz0T6BG3l80gx6Ys3dMoCVvnhZ2zRZ+8Q5D9DUO2tl40VW9zV/1v/R96 3qmAxUPjnyb7bJbBGR5hpeeNXv31oQDil9EVstYYaKyo/tVJjobR73c0sVFO1lsMeA fF962HqWcl1ZEE/SUG3dCYwCEXH7xXSHVTn94IbJ331OkJn8n8RxkkOi/MHA69d8vn PTQhw3ePVwsfQ== Date: Wed, 5 May 2021 13:17:27 +0200 From: Mauro Carvalho Chehab To: Jonathan Cameron Cc: , , Fabio Estevam , Greg Kroah-Hartman , "Mauro Carvalho Chehab" , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Rui Miguel Silva , Sascha Hauer , Shawn Guo , Steve Longerbeam , , , , Subject: Re: [PATCH 02/25] staging: media: imx7-mipi-csis: fix pm_runtime_get_sync() usage count Message-ID: <20210505131727.6c07e3b0@coco.lan> In-Reply-To: <20210505120652.00001236@Huawei.com> References: <793a5806a63b6313606fd1c344b9eec41e61a440.1620207353.git.mchehab+huawei@kernel.org> <20210505120652.00001236@Huawei.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210505_041734_670792_E7175832 X-CRM114-Status: GOOD ( 20.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Wed, 5 May 2021 12:06:52 +0100 Jonathan Cameron escreveu: > On Wed, 5 May 2021 11:41:52 +0200 > Mauro Carvalho Chehab wrote: > > > The pm_runtime_get_sync() internally increments the > > dev->power.usage_count without decrementing it, even on errors. > > Replace it by the new pm_runtime_resume_and_get(), introduced by: > > commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") > > in order to properly decrement the usage counter, avoiding > > a potential PM usage counter leak. > > > > Acked-by: Rui Miguel Silva > > Signed-off-by: Mauro Carvalho Chehab > > Not a fix as far as I can see, just a cleanup - so perhaps not this set? Yeah, will move it to the non-error patch pile and change the comments. > > Jonathan > > > > --- > > drivers/staging/media/imx/imx7-mipi-csis.c | 7 +++---- > > 1 file changed, 3 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c > > index 025fdc488bd6..1dc680d94a46 100644 > > --- a/drivers/staging/media/imx/imx7-mipi-csis.c > > +++ b/drivers/staging/media/imx/imx7-mipi-csis.c > > @@ -695,11 +695,10 @@ static int mipi_csis_s_stream(struct v4l2_subdev *mipi_sd, int enable) > > > > mipi_csis_clear_counters(state); > > > > - ret = pm_runtime_get_sync(&state->pdev->dev); > > - if (ret < 0) { > > - pm_runtime_put_noidle(&state->pdev->dev); > > + ret = pm_runtime_resume_and_get(&state->pdev->dev); > > + if (ret < 0) > > return ret; > > - } > > + > > ret = v4l2_subdev_call(state->src_sd, core, s_power, 1); > > if (ret < 0 && ret != -ENOIOCTLCMD) > > goto done; > Thanks, Mauro _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel