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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20375C433F5 for ; Tue, 26 Apr 2022 15:40:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352457AbiDZPnq (ORCPT ); Tue, 26 Apr 2022 11:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348522AbiDZPnp (ORCPT ); Tue, 26 Apr 2022 11:43:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BBA9624BCA; Tue, 26 Apr 2022 08:40:36 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8543B23A; Tue, 26 Apr 2022 08:40:36 -0700 (PDT) Received: from [10.57.41.198] (unknown [10.57.41.198]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B20153F73B; Tue, 26 Apr 2022 08:40:34 -0700 (PDT) Message-ID: <8ee5dfd0-558b-5ad6-63d2-b142550f04a3@arm.com> Date: Tue, 26 Apr 2022 16:40:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v1] PM: EM: Decrement policy counter Content-Language: en-US To: Pierre Gondois , linux-kernel@vger.kernel.org Cc: cristian.marussi@arm.com, Ionela.Voinescu@arm.com, Dietmar.Eggemann@arm.com, "Rafael J. Wysocki" , Pavel Machek , Len Brown , Viresh Kumar , linux-pm@vger.kernel.org References: <20220426144448.43682-1-pierre.gondois@arm.com> From: Vincent Donnefort In-Reply-To: <20220426144448.43682-1-pierre.gondois@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/04/2022 15:44, Pierre Gondois wrote: > From: Pierre Gondois > > Fixes: e458716a92b57 ("PM: EM: Mark inefficiencies in CPUFreq") > In the above commit, cpufreq_cpu_get() is called without > a cpufreq_cpu_put(), permanently increasing the reference counts > of the policy struct. > Decrement the reference count once the policy struct is not used > anymore. Not sure if the tag there will be caught properly. Usually it goes on top of the Signed-off-by. While at it: Reviewed-by: Vincent Donnefort Thanks for fixing this. > > Tested-by: Cristian Marussi > Signed-off-by: Pierre Gondois > --- > kernel/power/energy_model.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c > index 0153b0ca7b23..6219aaa454b5 100644 > --- a/kernel/power/energy_model.c > +++ b/kernel/power/energy_model.c > @@ -259,6 +259,8 @@ static void em_cpufreq_update_efficiencies(struct device *dev) > found++; > } > > + cpufreq_cpu_put(policy); > + > if (!found) > return; >