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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 AEBA9C433B4 for ; Fri, 30 Apr 2021 16:52:05 +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 6B01161459 for ; Fri, 30 Apr 2021 16:52:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B01161459 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=Huawei.com 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=L9qjPCeVNDiCA9M9EgnK0hqPP7Jm8PQtCQm+iQAO0LQ=; b=fn1741CGrHOqEr2O9Dw422GSm 23fFhyoEKTCZR1+Vd5+S91Net6RpJh0JG8rqL/+VAnvzotCljyWa4giX3Bqaou0hJlrPDTpyFgfHe /MEiANNXltLBfnu430PT7Xa3rjSYuD9QwUP2eR9afZ7qCE3qwhiX76zlzWR47asnSC20SprtbCFif EdxcLDLFCm3dGU7CAng2i7Gj/z7CxKv5ldr0OIV7aVc5diNX/OAT2tKba8zIU8BTwDJo10Bk8inRE cBLeEv8dbvgjiopUn44Crl4QC8IDrGX26GzQD7KKd5dXDyECY+/OCs70JOnCsMw4qTWq39M42CfAU iDnzXkFFg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lcWLO-008EPO-JI; Fri, 30 Apr 2021 16:50:22 +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 1lcWLK-008EOY-DH for linux-arm-kernel@desiato.infradead.org; Fri, 30 Apr 2021 16:50:18 +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=dlMx6RUL5reRC9F46rW1kYjFcDH91krRHC/lLwjkGIM=; b=St1Yzb8cmebabfrR6i0FfKvJvX eOeajECgx2RvFKqB4Eqhei0U5/rhhodmcrG4uVGu8srsMm+g4pUqCTJ9ttRWvYp77sLNThRA3Dqvi 0ogIGabPFTxw/hKWl8ndJSIELrzfn9W2QoFequ3OS8lFnVoTvPw+9Z7G/Y0dfrjwWWjNBu5MrqsN/ zzw6G/n2fPDoQ5MMjkJbPdSFV/C0UhILRvmlToDCXeYoH5SCvPJa+srODry48A9XIcNEHrA1t0ySm iPzOY8lAQ/hfevJxXOwltE7YBqvMorXLYpAr9FTwCDFa+MpZAaoOn3Mbi5fsjTGnYSjFbyTXjOxyF RsbyLNPw==; Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lcWLH-001X7d-T4 for linux-arm-kernel@lists.infradead.org; Fri, 30 Apr 2021 16:50:17 +0000 Received: from fraeml736-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4FWyrd0QdSz688vR; Sat, 1 May 2021 00:44:33 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml736-chm.china.huawei.com (10.206.15.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 30 Apr 2021 18:50:14 +0200 Received: from localhost (10.52.125.96) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 30 Apr 2021 17:50:13 +0100 Date: Fri, 30 Apr 2021 17:48:38 +0100 From: Jonathan Cameron To: Mauro Carvalho Chehab CC: , , Chen-Yu Tsai , Jernej Skrabec , "Mauro Carvalho Chehab" , Maxime Ripard , , , Subject: Re: [PATCH v4 19/79] media: sunxi: fix pm_runtime_get_sync() usage count Message-ID: <20210430174838.00000412@Huawei.com> In-Reply-To: <17cf60c9e5190ff83de40284bb858581bb0ec4a6.1619621413.git.mchehab+huawei@kernel.org> References: <17cf60c9e5190ff83de40284bb858581bb0ec4a6.1619621413.git.mchehab+huawei@kernel.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.52.125.96] X-ClientProxiedBy: lhreml721-chm.china.huawei.com (10.201.108.72) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210430_095016_116496_BFFD2648 X-CRM114-Status: GOOD ( 15.99 ) 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 On Wed, 28 Apr 2021 16:51:40 +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 and avoid memory > leaks. > > Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron > --- > drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c > index 3f81dd17755c..fbcca59a0517 100644 > --- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c > +++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c > @@ -494,7 +494,7 @@ static int rotate_start_streaming(struct vb2_queue *vq, unsigned int count) > struct device *dev = ctx->dev->dev; > int ret; > > - ret = pm_runtime_get_sync(dev); > + ret = pm_runtime_resume_and_get(dev); > if (ret < 0) { > dev_err(dev, "Failed to enable module\n"); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel