Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp290777rdb; Wed, 17 Jan 2024 01:56:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDqdwezwAcf/60gHhhQdQrXMk8etojWm27vK/TdgUYIU70O1bQXzJiLEibKKDVsq6nQ0u2 X-Received: by 2002:a05:6359:2f05:b0:175:b72a:e431 with SMTP id rq5-20020a0563592f0500b00175b72ae431mr6833180rwb.46.1705485399514; Wed, 17 Jan 2024 01:56:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705485399; cv=pass; d=google.com; s=arc-20160816; b=msFwB86bCXB2XepNl000B3iy8GOH/T0CV/PZT2etzCZdopClMuHxCk6XS5AlNEPxHh bX9XSwYNsbrPtIrnCq97ySDQMKXdzFYb0JFrOMspqjdMVoX6SnXg1zU+t9dqUIZ02Qjt REmyL+kXihkneFUuiryMHYeIA9fLKPZyjQRZ0+pf4NTAAuGTcJSdJEbQi20sqR8WcUwC iRaMAfIyCIQ7V7lFEhRgxIngidsy5FtkaFrniywJGIdGKn5VDlEK3AIkc94ZtNbzJysN 9LiAhWq3ROcVlLzMMxOJ3JSqvv+kWlwyz2YKZUQvYIMTQwsDq6XvCbokHps701ZdSHcf 0Spg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=uGhco7J5TgdBe4HVHErzn104yzI0XoRDssU6JxBLmLw=; fh=dnwF3PGywHXrL+zB51aLYhCKaTICdBffwESxtAIta2U=; b=pnOxLGopAD8RdE4anXuuUtiQPRk1RG2StE/rfS8M0Fd36cBDw5xwQ25yLkUhobw5ss kaydVdulvzYZZEJHpipCu6ZVJZKC4UZnIfqlevuFwpgSgmS7WlUlP4ius2a5JE1s6Umy v8lLculdODayoy9nGJ8s9098ycZuWhCpXngnEpLo6F2IdjQx81I3XAj6fsz+pIfOlbxU Dj1NLxc9sGjQv4BZJpkY56YzCXMVpHhIGvC3UudLKCa1D0yBoRN2v54Yt8IQQF1wAkgK YtYuZTrvd/yVm5b2y7izNQ3DiFuila4wIHkKvPwaJzuePYTcKaudh0KcsGSwNT08w4vC tvow== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-28772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28772-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y185-20020a638ac2000000b005c65eb2bc63si12456161pgd.608.2024.01.17.01.56.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 01:56:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-28772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28772-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1B6ED286F66 for ; Wed, 17 Jan 2024 09:56:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E37FE1BDFD; Wed, 17 Jan 2024 09:56:05 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E19515EA2; Wed, 17 Jan 2024 09:56:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705485365; cv=none; b=gpCkuS5KTbmn3UYZKmuQ5mzxOH94xAbMwcnPopHTGu4OlXlEvSbgI+7+YoVaPSre+Ex0wtZcpKkrNU9K7B1ItECClFtN4zy7UDRXJGrvhk+pRhUmfKfGxYXYxS0occaYsO8UPkWDOuhC44pxZZQwm8ILQ3FjwVvxODB1fFiNxVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705485365; c=relaxed/simple; bh=6Wi5CZcTdePdWR3CmLK/lfq50M9LGiUfZZMfj9IusOE=; h=Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; b=J9p9oGQezd1cWKTWcdgr2KrlVu55cLqHpp9REG38CcxarpYtjqw6BsK1HIg3AqmR8WD2l4nYUhe93R/4BJarNfvDRNj7MfC6tHSpmpHTxXtjF8RPSp+nzk4v2D51UUgtw55ljZbNJL0KCe7nUV1yVQmHGkEBXvEn6QgCBEHfp6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 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 1C211DA7; Wed, 17 Jan 2024 01:56:49 -0800 (PST) Received: from e129166.arm.com (unknown [10.57.90.139]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 372AE3F5A1; Wed, 17 Jan 2024 01:56:00 -0800 (PST) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org Cc: lukasz.luba@arm.com, 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, xuewen.yan94@gmail.com Subject: [PATCH v7 02/23] PM: EM: Extend em_cpufreq_update_efficiencies() argument list Date: Wed, 17 Jan 2024 09:56:53 +0000 Message-Id: <20240117095714.1524808-3-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240117095714.1524808-1-lukasz.luba@arm.com> References: <20240117095714.1524808-1-lukasz.luba@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In order to prepare the code for the modifiable EM perf_state table, 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. 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"); -- 2.25.1