Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp735009pxy; Wed, 5 May 2021 12:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyobC0dW6VY9IMBhSvWIyCuqHYx4o/GsclWXsInxxOX91d+wfLxL0M+jsga17MwpgwEd0Hg X-Received: by 2002:a17:906:c1c5:: with SMTP id bw5mr362855ejb.510.1620243008026; Wed, 05 May 2021 12:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620243008; cv=none; d=google.com; s=arc-20160816; b=cq9S45XbPhgC1ME7mYqvbAbRggH2ovUS866wVX2BCvCv2/OMSHhYn468y2uWIk69Yj 6Grm/rjR0GGOYAqTmYMMcHmJBElN0RdQXVJ6Nw2YWCzCJeaxpzHk9tr5TOV8FBZvULGC FkpCLxfMP7IVrLe1fM3aOmvI4ssGg5CapP0b46j2flcPU2JV6CGo+PfvfJ6Rm0v6VVKp fG1CNgAfigR2oQIUqnY52fImYjwy0vUbTSMYVAd0VjOsOYZhSg+5/Gphjofi7APb0Nuu vJy5DLN7arD39N/Os3cOh03nkg1LuOjnxUx/Je+QjMc0fklP5ZRbOG+lj1AZTo1YWDj8 dZ0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=hQSozH2DgEDq3VPoCPAxY8pBxwM0VEwwPf5qNfsB96o=; b=rmIi0d0cQtVJ2eAMbpvFHQ/u+ojJXZOFVKYWdpplYI6KUB3DF2324uGKUbIrc4ce0J M7y5MLZhiRue1+FkBIhr9pcNeV0S5EgLMc2iqbxwvNlelTDG1tAMxZWyYWTb+f/gh7Mr BKAPHdpxHvHajm6TDcGchq2Hi3/heOkGWKVHO458ya+HJQtouySRWTEHG885J84BG/R6 8U5bVboLYSNaoktUcdR+BPlrI+R1If16nLnEkaXRuYg8PvdW1RlZzs9BpDCDyjVcGHc0 JUdxgLm0mdZNs4epmcyAv3XGM+78Z91e9DSwzvoWdipz4wE19pNH6gPSVms0osJ4UdS7 WRGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eR+gstgG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si235010ejd.204.2021.05.05.12.29.43; Wed, 05 May 2021 12:30:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eR+gstgG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232858AbhEEOYc (ORCPT + 99 others); Wed, 5 May 2021 10:24:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:42118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232283AbhEEOYb (ORCPT ); Wed, 5 May 2021 10:24:31 -0400 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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