Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4306823ioa; Wed, 27 Apr 2022 00:14:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws32nffsouz0OrKAEMCBI4dXdEJSnfz6GnJ+xjcUi4856ae3fE80G8NhXAj/2pbCVzvT8I X-Received: by 2002:a17:907:9686:b0:6f3:a951:781 with SMTP id hd6-20020a170907968600b006f3a9510781mr8083540ejc.249.1651043699012; Wed, 27 Apr 2022 00:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651043699; cv=none; d=google.com; s=arc-20160816; b=OCVay6vFrthHOMtddi8DS3Yd1Oi3nK3fDXrQiffmkiHlzEPj8dZdAbqZpKad6Imw79 Z+hsEMih02Ze3NG4yer9kVJ+YMLZyFYhk7xn541B2QsGCCJvAjefIEXh975kNwL8ZVw5 IvoUnW3rUtMNXUN8miXQVOQ+NyIdifsML6fAhwKjMDulDMwoyZgjOh7OQqPvDdZK2zcN m+vkkGnoNpmUVZkzNyrk7yaLUPWJ/dV2s958B9ewDEbH/EZjDjcLa3ySRLgcQv6XMIxz XWaVRwLRtwLN5idCs1E4rPSoVLq4vCGzbV3pvEKE7UsjYv8NYGhbc1CJ4wouoHhAI9Wp ifEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=fDWOM0e492LWdLB2tSumpSDBF4FbJvRyhuKyqUPzXUg=; b=jYYxReOriLZ79mGbDUt2CK/VArgLwjhFlG98pzn0xKMftvOg4TPhpXSxXPNq5Vk58z 6pB0wqYYc05SbUf1T5M3ibGF8VbYTwr8cbA38ut+7isfB3M/+ZCXBXs/XwX3Xim7tzHN O/q0wpomy9a6xK1RQbY1K7zct8S7eGjgku1ZX1lDJi6R9BeOt5obKjI+mrGxlalpllP/ DmCyIGyvXx7LVcCQQNRxWvmtTMgouLn6R1sxajABx0QQyZOPF48jk/TAINhdlZTEve+e f2xjgcDG38tJ3NdC/bABEVaJtrPiSoIh8iVAOzaXjA+9AWedW8WFwoZ/X4iWc/s8BgyQ i7NA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a50f1c9000000b0041d9466e2ccsi768890edl.158.2022.04.27.00.14.34; Wed, 27 Apr 2022 00:14:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352396AbiDZPnq (ORCPT + 99 others); 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 X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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; >