From patchwork Thu Feb 8 11:55:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 198338 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp109774dyd; Thu, 8 Feb 2024 03:57:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWoZ39323GR8DL3eWd+UKTZYJBRZWndfUAqEj8kwjNmsP8ZVtFXvcCCYFEoFg/cYPoYKCo8CHaF7zC5z80b+q3uZzvZMA== X-Google-Smtp-Source: AGHT+IECQkd3Y3MZmIVM8vqDm0edC6ezXWjgWofRvVnLDzhzjJC7eJ1zHtmbUzsIyJq+7BwCvQqG X-Received: by 2002:a17:90b:903:b0:296:833a:b47f with SMTP id bo3-20020a17090b090300b00296833ab47fmr5799516pjb.21.1707393420783; Thu, 08 Feb 2024 03:57:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707393420; cv=pass; d=google.com; s=arc-20160816; b=knfisk9gunP48c4cKR5JOy6pL0vqigz/g0f1VjxLTONY1ZWPPNQpOQdTJj8hijk5Gh 1Ca01NqiPw/bzX4aV5vqmH5Ofwdacr6jD4hJYJfTgha9bl/wYv35ECqlj+Qg5818dyPK qvlmtNphlvF1VM/ju/lCrqp59H0p4QBHDYMvLNeTyPuCSk16P2PxAoM8fMyDsDxHK8ZJ zxjeL22IsT0r7KhUMsgRvx3BpxFQdTEjBfsOFJJjMuwiAy2xPS36cIGwr1OGiRRhzMQd jJoocflnN8O76oLCqXz5jJPZHOXteTREaMObg6AUEoYJE2PityqsttPVwpCbbNadU2v5 64dQ== 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=9FhwDQCBj3oh8KoL6uKp5NAvlIb8dXFVHsz3b0e2ym0=; b=VRrAX67DAW0UKzCeT96JGSoIOq6GJiNGiVlJq9uVnAINm/3s555nJyCwWqQqN9tXkr tRMZewM437eb1utHzkuaiCv4mVsxAGgs2D3X5MB/CwBQLBRSWkl4h06JR6Zv7MemalVr MWcH96NJx7Lojgdj0WlRPLI8QYSqUbIkeKCQoD3Unxg+DBwfSAZPUj4nNd3He5gWAC89 +NxE0MW4plr0r3UuDz3HgzmOpA/b1/126bttQiOm1wbdhcJ0CpCdnaYHiu7MMteR5NjK Np+9b1+RLIPfZquLWQYOANA6AWPBmdPFJ4BNkp9Wopb0+60ZIaB++i2ygnKikaXLX/H3 Jy6w==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57995-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCWPyZChmzjQW2+NURrYrifheg8eygvR44yJTB95FliBhJe6D2xwgGqUli5+uQALgzmqN+ugNUVeefvu9e7cGNXe+wH9/A== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h3-20020a17090aa88300b00296454b0b6fsi1156907pjq.103.2024.02.08.03.57.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:57:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57995-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57995-ouuuleilei=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 7603328BFD2 for ; Thu, 8 Feb 2024 11:57:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9033E73186; Thu, 8 Feb 2024 11:56:15 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790331763074537611 X-GMAIL-MSGID: 1790331763074537611 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");