Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp209462rdb; Thu, 8 Feb 2024 03:56:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXST9NYKWbksCBmBpiY4DC9UVgHkO5TCR4f7F7dWFt6UjPLjX6oRFjhrPLtISLaPGsbaK6C8R/Njaxn7xGO0v+XAjYBeVKH+mOXrd9fUw== X-Google-Smtp-Source: AGHT+IFCZ10/dKlA8lkO9ZMFZ3LYrzRMHrI10wMtgcS3gtTg+Ffr5Fi/aXKC1Sn6Mc2qCILlkWBt X-Received: by 2002:ac8:51c2:0:b0:42c:a4e:e266 with SMTP id d2-20020ac851c2000000b0042c0a4ee266mr8501516qtn.21.1707393408952; Thu, 08 Feb 2024 03:56:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707393408; cv=pass; d=google.com; s=arc-20160816; b=BaYZsbKZm0YaqRPmJq9Yhd3XmhUAkx+8YADdF8aFFDziqjBvW5miwt0Zf9xOpfMv7I GtAaXMCCFluYIC8JZ9K3C4hr38uZSBag9Jhep4l4m+bZbNScJGT8ExgJD//efj93sJpj iuYjZvF4UHIOmO2Wd1tDbkDwb0PJwCVPMdD1c0CASJ0EF1i7NLFYDDhDmjjSJTZnW8CV q3AY4mxFLOispLj96aEcWt4a9A6KQFQIvBCqp6Z5HQdEIKxG2TlVSpOtj5uhoa5G7hym +7xI4Cr5ApoJWjKU2uXm81SmgL3TI8vvmlT4LD83n/OVLQUh34293u58Mwbwru7zQAJz gNLg== 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=j4+bu/ALg14Uvo5pcLwX6E+FH3oM5QGapbjXo8US690=; fh=ilF+707ka4aj83OC7l04BS5RcGB/gtg6YKs9EtrAE3A=; b=lgYKAuuxscKvMTRLFu9bF7ojr59HvTFUELZzbPed9qQ/i29x3u9lQxHP0+YjsuL+rz UdEiiuJw8NkkpXgjCxIVKcjpFlWBY+vLRNBs8GYLYRKhqlq0+8PRDTb0hSP4se4qHQWw tuyn97rR9Ty/eJyuaWpFFSaPRR2dH/poYT1clQSNA4YgXMTvTMZWSqJ9iXbvlI4cd9YW SXiQ1zEV7z2bV/e9AY2jR5IQ1IVdXAPtWogFyjmc5d57OmZTaOun6Ya6zreRal/ciUEj an8ZWpybI4/RJeH/pSLZMWHT6YAgZj4+2V6OBfcxf7WZnaTKHUQjIYjLO0ResCYaiy0H sHRQ==; dara=google.com 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-57995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCWQ7kZJmqueYFclstzu1J8RiM5b0s5q7/+AjALCx1CVdtk6504FNgNgBXuvnbwXz86UK55rxAxGEjvAH/ZEM/15Y3wnoPKGa+At1XCpXA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x11-20020ac85f0b000000b0042a4e7a9b47si3105068qta.464.2024.02.08.03.56.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:56:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-57995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57995-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 607F21C2488D for ; Thu, 8 Feb 2024 11:56:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CBD56F095; Thu, 8 Feb 2024 11:56:14 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 097146F539; Thu, 8 Feb 2024 11:56:11 +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=1707393374; cv=none; b=buPSAkS4IWGv/Va7gUoj5EVww2HuYSoD740uREPxqCDeSMENlHYTranK+7jeu2hZvI0BfiHuo2tYm1Lj/FGKygi1vRSN1blRGE0tdjesY+AltgfwENNUxfZ3Z5tAp61QuCmbn5eYM6ieVDeP518L5hkIxhs4R4yQxkcBdV6hRWo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707393374; c=relaxed/simple; bh=3JyBDbzGvfBhPotIs1tob8kBWsx0vCf+QiqaU2yqhXI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QCDOTfLlwkCoo7z7JqreCrMP5TaHHlIOsESR85/btC5G1LnJhaVw8eLY2DXHVCCYRqLJHaG1y5/VptsocjbTub/mD7gnr2/LOuIDIeQ8fXn22Zq3CDZhdXoV4cmg7MTTBN8R2sRfQ8uF0RqXzY+RyD90F8bK+GMYlGk1QfE3aNo= 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 BEA411515; Thu, 8 Feb 2024 03:56:53 -0800 (PST) Received: from e129166.arm.com (unknown [10.57.8.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BA42B3F5A1; Thu, 8 Feb 2024 03:56:08 -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, Hongyan Xia Subject: [PATCH v8 02/23] PM: EM: Extend em_cpufreq_update_efficiencies() argument list Date: Thu, 8 Feb 2024 11:55:36 +0000 Message-Id: <20240208115557.1273962-3-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240208115557.1273962-1-lukasz.luba@arm.com> References: <20240208115557.1273962-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. Reviewed-by: Hongyan Xia Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Signed-off-by: Lukasz Luba --- kernel/power/energy_model.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c index 8b9dd4a39f63..8c373b151875 100644 --- a/kernel/power/energy_model.c +++ b/kernel/power/energy_model.c @@ -237,15 +237,15 @@ 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; - if (!_is_cpu_device(dev) || !pd) + if (!_is_cpu_device(dev)) return; policy = cpufreq_cpu_get(cpumask_first(em_span_cpus(pd))); @@ -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