From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A314B72 for ; Wed, 5 May 2021 14:23:35 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 22F9361029; Wed, 5 May 2021 14:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620224614; bh=fHzvZb04EncTIhKLD9UpQo/lk3yj1BkGTtkLC0Aet3s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eR+gstgGSeKG+jWCsGQlOUU36DMvvYokFuDdQ8fWjhCk8SwIcIUeRsqMiy1w9JzOQ olgBZoyo/vuZ3T6yhYdZkzp76Wt/WHpTuyt6rusu8cCI7MhauTYQIlJLD8bUCeiWKQ a8vnBbb2ISRqNebLFV1/Qpud/P7sJDlJyy17vcNNHi+790hKOJcHxjTwbi70yt7LMR klp08xMRp1mXYk928MshmGC8Li2JXImIuvuLGPT9amHX95fyA2jXKdqWJFBKZISGve 1+5qAtjO7WDzl5NYuFt+9rMdMyUZLBaQRFrpP3sbObpd/8xvzDoDey3oACapIaVrIc 08Zz5Gi6x+aPQ== Date: Wed, 5 May 2021 16:23:28 +0200 From: Mauro Carvalho Chehab To: "Rui Miguel Silva" Cc: "Jonathan Cameron" , , , "Fabio Estevam" , "Greg Kroah-Hartman" , "Mauro Carvalho Chehab" , "NXP Linux Team" , "Pengutronix Kernel Team" , "Philipp Zabel" , "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: <20210505162328.1e5fff80@coco.lan> In-Reply-To: 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) X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Em Wed, 05 May 2021 14:56:40 +0100 "Rui Miguel Silva" escreveu: > Hi, > On Wed May 5, 2021 at 12:06 PM WEST, Jonathan Cameron wrote: > > > 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? > > yes, the original changelog of this patch, that I acked, made it > clear it was a cleanup: > > " > Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to > deal with usage counter") > added pm_runtime_resume_and_get() in order to automatically handle > dev->power.usage_count decrement on errors. > > Use the new API, in order to cleanup the error check logic. > " > > This one above is new, but I saw Mauro is going change it. Yes, I'll change the subject/description to the "use pm_runtime_resume_and_get()" one on this patch, as there's no issue to be fixed here, just a cleanup ;-) Sorry for the mess. I did lots of rebase on ~80 patch series over the last couple of days, based on the reviews (and my own internal reviews)... See, the current patchset has ~80 patches with ~30% contained fixes. It shows that writing a balanced PM runtime code is not so trivial ;-) Thanks, Mauro 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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,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 3837FC433B4 for ; Wed, 5 May 2021 14:26:08 +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 99B5E61057 for ; Wed, 5 May 2021 14:26:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99B5E61057 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=TBuRIg1ujhrGR36E4fkHXx5jHtiTOmIMriwzEmOkn5c=; b=hJP5SOitKXpFKslfxzP+LmHNQ crP+ppDcEsuHW537YjdlK38rapmHFEoCEbNOM8gZrQFeLlx45mCzhI01RlpIWhzBhDl0slbGPDM+n xUtpuIEdmbfp1DyVx9K4CXrnbxSPvbHF87FuBa5A7bIU7asZUwqzyZLFGra/I7wnzMFKve9y9IrBE wg8x+Amay6gn1kDAy7oQAqezZ6QpimiHskrNx1RA2kS3F/HUuXicJdJ5fT69EGwI6ii/yuSGNT18C jmdTuIHaryuHg54+9A1Rj8R/yVSCaBhhkvrEijW9AJ83qxOYraoPj1XpY/ckLjJMqBXnF/OVtVN22 SEP9yHBaA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leIRH-001PyU-1x; Wed, 05 May 2021 14:23:47 +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 1leIR7-001Py7-Uh for linux-arm-kernel@desiato.infradead.org; Wed, 05 May 2021 14:23:38 +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=hQSozH2DgEDq3VPoCPAxY8pBxwM0VEwwPf5qNfsB96o=; b=BTZYOer5xae9PYC0iSlXH9L0PE u6yiiE1sAwjjoN0AXxQtmXQWxGMQDK4AUGbT9HpLGDSXu2zNJgroXu5VLLG9PKLwreTn9LG+nC35q z/DJ0Pp8PePsGFqxp/fR3U3R3kJkoMPMsfm87cYBrIgqwumdUpNhfee2K8MSeUy1vO8YLDHk8gBCP ueT6ecKLndSbMi+uKUlRqgv3/NLv2VAAEdNMFqHT2p7A2oN1sw6Y5gxBbLVDPCg/WU/NaaeFzFrNi nQqxaWx64UBQkpF2u96WzsPS8e+SGIgTtu6bN8h6qXZUNGU3Bxu2vvp2vrgGQkEXzr2wS4Z4bCJnM fG1P9AXQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leIR5-004p4c-FI for linux-arm-kernel@lists.infradead.org; Wed, 05 May 2021 14:23:36 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 22F9361029; Wed, 5 May 2021 14:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620224614; bh=fHzvZb04EncTIhKLD9UpQo/lk3yj1BkGTtkLC0Aet3s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eR+gstgGSeKG+jWCsGQlOUU36DMvvYokFuDdQ8fWjhCk8SwIcIUeRsqMiy1w9JzOQ olgBZoyo/vuZ3T6yhYdZkzp76Wt/WHpTuyt6rusu8cCI7MhauTYQIlJLD8bUCeiWKQ a8vnBbb2ISRqNebLFV1/Qpud/P7sJDlJyy17vcNNHi+790hKOJcHxjTwbi70yt7LMR klp08xMRp1mXYk928MshmGC8Li2JXImIuvuLGPT9amHX95fyA2jXKdqWJFBKZISGve 1+5qAtjO7WDzl5NYuFt+9rMdMyUZLBaQRFrpP3sbObpd/8xvzDoDey3oACapIaVrIc 08Zz5Gi6x+aPQ== Date: Wed, 5 May 2021 16:23:28 +0200 From: Mauro Carvalho Chehab To: "Rui Miguel Silva" Cc: "Jonathan Cameron" , , , "Fabio Estevam" , "Greg Kroah-Hartman" , "Mauro Carvalho Chehab" , "NXP Linux Team" , "Pengutronix Kernel Team" , "Philipp Zabel" , "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: <20210505162328.1e5fff80@coco.lan> In-Reply-To: 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_072335_587155_058109E0 X-CRM114-Status: GOOD ( 20.40 ) 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, 05 May 2021 14:56:40 +0100 "Rui Miguel Silva" escreveu: > Hi, > On Wed May 5, 2021 at 12:06 PM WEST, Jonathan Cameron wrote: > > > 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? > > yes, the original changelog of this patch, that I acked, made it > clear it was a cleanup: > > " > Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to > deal with usage counter") > added pm_runtime_resume_and_get() in order to automatically handle > dev->power.usage_count decrement on errors. > > Use the new API, in order to cleanup the error check logic. > " > > This one above is new, but I saw Mauro is going change it. Yes, I'll change the subject/description to the "use pm_runtime_resume_and_get()" one on this patch, as there's no issue to be fixed here, just a cleanup ;-) Sorry for the mess. I did lots of rebase on ~80 patch series over the last couple of days, based on the reviews (and my own internal reviews)... See, the current patchset has ~80 patches with ~30% contained fixes. It shows that writing a balanced PM runtime code is not so trivial ;-) Thanks, Mauro _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel