Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1000607rdd; Wed, 10 Jan 2024 06:01:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5I6BW0SzRbghIAeZfrnmHoSf3uMhppzHRSb90CGL3NJRTaWlz6vG3CVmYGTIsgOK1daOF X-Received: by 2002:a05:6e02:18cc:b0:360:7828:c65c with SMTP id s12-20020a056e0218cc00b003607828c65cmr1688745ilu.30.1704895283915; Wed, 10 Jan 2024 06:01:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704895283; cv=none; d=google.com; s=arc-20160816; b=rbwpu3e1rHVrW0qi25NUHXVW2DuL3U65x5iyUN/37suouH4aKp4TQrm/bt1MSOF+ei FJTeM+f2sBOAHkxmchBF0ifTlyImE6kimWI9vcMx9o1OHFT7xQ0uNTg3G8CEOLvyKjlj g7NqOwAvXaUcDomiwjI95PPrYOOaAEnHTlvI9VVmHg23oc3Ixt2J91ataFedtYYvbali Xdg/d0VAbgcsDFkbpCcXqynJXJ6I69gvNgfTYSjh3nJmHgRuZFNdhqWa9HTUIMY3GSha PbXzGjYLv3YogaTqIOKC/PF+PskSFK0opAtDhx3LBOOK8Qmo9JLHELoftgoWrbZmwJIP E6Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=hFl6QqhDHgDvBvrs4OzM68HKz8rWyBg9mQgdrjTCktQ=; fh=Sntd+G0CthFoKfHeh5KAtcEJMuc35jsG6LFomUCRudQ=; b=SgiNF7/SQpDOyMhPzpBLj6plUZl8Q3vaSATDY/7eaZwCRMO2j8BIUvvWXBz01oq4DZ ZCQgBezC6AexpZYhXeqU0cHhtIG7nV9uFkt1An+cZ6bWtT2mQujgUtR1tiuOqTZJ57sQ D/AiGxLmK0e8Uj3SbpRajhtgQ/4LMbzmk7aJraTIXW2OE4fbQ9dRyGltomUbyKG8sk4Z Mt/9ovynx35tsXvsf2+bSw4uKNQYRMhro48rKW0vLR4u9IFxpk5Bjrk6zgYlAvNjt2OX ojKeRJQFwhqCIKC6uQmB2Uz4sINIVS6XY1chp/bvEWLKH8XCDpi4cGtrycM0vQnoc5e1 R7Pg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22285-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n5-20020a634005000000b005cdfbb3a766si3562257pga.296.2024.01.10.06.01.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 06:01:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22285-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22285-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 17644B222A8 for ; Wed, 10 Jan 2024 13:55:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C649B495C9; Wed, 10 Jan 2024 13:55:25 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66FC448CC7; Wed, 10 Jan 2024 13:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 593492F4; Wed, 10 Jan 2024 05:56:08 -0800 (PST) Received: from [10.57.87.179] (unknown [10.57.87.179]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 54EC03F5A1; Wed, 10 Jan 2024 05:55:20 -0800 (PST) Message-ID: <453d5cf0-9b74-43ff-bcd4-a6fdd7796056@arm.com> Date: Wed, 10 Jan 2024 13:56:42 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 02/23] PM: EM: Refactor em_cpufreq_update_efficiencies() arguments Content-Language: en-US To: "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dietmar.eggemann@arm.com, rui.zhang@intel.com, amit.kucheria@verdurent.com, amit.kachhap@gmail.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, len.brown@intel.com, pavel@ucw.cz, mhiramat@kernel.org, qyousef@layalina.io, wvw@google.com References: <20240104171553.2080674-1-lukasz.luba@arm.com> <20240104171553.2080674-3-lukasz.luba@arm.com> From: Lukasz Luba In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Rafael, On 1/4/24 19:07, Rafael J. Wysocki wrote: > The word "refactor" appears to be quite loaded in your patch > descriptions, but it is not always the best one to use IMV. Fair enough, I'll change those patches according to your comments. > > For instance, this patch simply extends the argument list of > em_cpufreq_update_efficiencies(), so I would say just that in the > subject: "Extend em_cpufreq_update_efficiencies() argument list" > > On Thu, Jan 4, 2024 at 6:14 PM Lukasz Luba wrote: >> >> In order to prepare the code for the modifiable EM perf_state table, >> refactor existing function em_cpufreq_update_efficiencies(). > > "make em_cpufreq_update_efficiencies() take a pointer to the EM table > as its second argument and modify it to use that new argument instead > of the "table" member of dev->em_pd" > > or something like this. I think I got the point, will change it. > >> The function now takes the ptr to the EM table as its argument. >> >> No functional impact. >> >> Signed-off-by: Lukasz Luba >> --- >> kernel/power/energy_model.c | 8 +++----- >> 1 file changed, 3 insertions(+), 5 deletions(-) >> >> diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c >> index 8b9dd4a39f63..42486674b834 100644 >> --- a/kernel/power/energy_model.c >> +++ b/kernel/power/energy_model.c >> @@ -237,10 +237,10 @@ static int em_create_pd(struct device *dev, int nr_states, >> return 0; >> } >> >> -static void em_cpufreq_update_efficiencies(struct device *dev) >> +static void >> +em_cpufreq_update_efficiencies(struct device *dev, struct em_perf_state *table) >> { >> struct em_perf_domain *pd = dev->em_pd; >> - struct em_perf_state *table; >> struct cpufreq_policy *policy; >> int found = 0; >> int i; >> @@ -254,8 +254,6 @@ static void em_cpufreq_update_efficiencies(struct device *dev) >> return; >> } >> >> - table = pd->table; >> - >> for (i = 0; i < pd->nr_perf_states; i++) { >> if (!(table[i].flags & EM_PERF_STATE_INEFFICIENT)) >> continue; >> @@ -397,7 +395,7 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states, >> >> dev->em_pd->flags |= flags; >> >> - em_cpufreq_update_efficiencies(dev); >> + em_cpufreq_update_efficiencies(dev, dev->em_pd->table); >> >> em_debug_create_pd(dev); >> dev_info(dev, "EM: created perf domain\n"); >> -- > > The code change itself LGTM. Thanks