Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp461873pxb; Thu, 5 Nov 2020 04:58:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNcXW/nQOOeNycPQtsLECGsX1MW0Nh6qzXbu9VqALCr/rjAX3C+9hY9/3BMcOuzKHUG5LO X-Received: by 2002:a17:906:a0c2:: with SMTP id bh2mr2150812ejb.212.1604581136637; Thu, 05 Nov 2020 04:58:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604581136; cv=none; d=google.com; s=arc-20160816; b=07DzqZHeBPV5RgM+LrU4dzpZuarXOHBf0LC/HSn06GoD6t4WiF+nV4rXncfe7YRkV1 2cjvGQBHJg76FIQFFjB2QqKwd2Ci0cdxmhc/d4ZRlTSxsP08WvADHUNMDMgCIsKEDCNQ xzCKGKZvYkQbS53C6BxFuBPa6vkLfglGnN3zRuAQkBxKf/mKZBlYQLGSdAcrtEL5s/do ONlJ9d8Kkp2HJgG8qpLmkvJj9skKJojblO72tkVIJsy4DhDJ5WPwnhIcEPfvz0I9/FCH ezThAOJBCPUF8tLtsH/w/kqnMHtPMyOjzA1RGloMy0Z54Gt5O0K3M25Kc2P3TaogNhx/ TYZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=cIE++3H6mhbN22ClBde6V6AN3R2EHjeNi5UjxF5SfQY=; b=IgD0llBmgzVJC0/swNDlnUfAkMqsRu4Aml0EZFQf93/GerVoC4K+59YEloMJ2wxVUu ipta+dybgQP7SBPsOPOmLZQIAcQYoWomga70+d+bLkQg9q0fjZvELoO4xhq2eQRJpoR6 PfX87slWIk5M6H+eNzU7PM2eL6Ke3Mqd8wvXyjy1+X6Lqz0YCNyFmQKmA2ew5yW4vIOe gz/ygECDs9Dm7hV+s/lXQNuPhmElE+PnwZjb4FFwRf4UaaYpYoQmfyTueZNpY+iBUImo CBHwTFYj+0rCNA3s8dAkWA3LcQu4KcTCAf6OCYpVmft1loYFHeLTQ6p1FI5tz1e+Apvn KT2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb9si843221ejc.725.2020.11.05.04.58.33; Thu, 05 Nov 2020 04:58:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730589AbgKEM4v (ORCPT + 99 others); Thu, 5 Nov 2020 07:56:51 -0500 Received: from foss.arm.com ([217.140.110.172]:60024 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730784AbgKEM4t (ORCPT ); Thu, 5 Nov 2020 07:56:49 -0500 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 6F2E914BF; Thu, 5 Nov 2020 04:56:48 -0800 (PST) Received: from e108754-lin.cambridge.arm.com (e108754-lin.cambridge.arm.com [10.1.198.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3A8CA3F719; Thu, 5 Nov 2020 04:56:47 -0800 (PST) From: Ionela Voinescu To: rjw@rjwysocki.net, viresh.kumar@linaro.org, lenb@kernel.org, sudeep.holla@arm.com Cc: morten.rasmussen@arm.com, jeremy.linton@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, ionela.voinescu@arm.com Subject: [PATCH 5/8] cppc_cpufreq: use policy->cpu as driver of frequency setting Date: Thu, 5 Nov 2020 12:55:21 +0000 Message-Id: <20201105125524.4409-6-ionela.voinescu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201105125524.4409-1-ionela.voinescu@arm.com> References: <20201105125524.4409-1-ionela.voinescu@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Considering only the currently supported coordination types (ANY, HW, NONE), this change only makes a difference for the ANY type, when policy->cpu is hotplugged out. In that case the new policy->cpu will be different from ((struct cppc_cpudata *)policy->driver_data)->cpu. While in this case the controls of *ANY* CPU could be used to drive frequency changes, it's more consistent to use policy->cpu as the leading CPU, as used in all other cppc_cpufreq functions. Additionally, the debug prints in cppc_set_perf() would no longer create confusion when referring to a CPU that is hotplugged out. Signed-off-by: Ionela Voinescu Cc: Rafael J. Wysocki Cc: Viresh Kumar --- drivers/cpufreq/cppc_cpufreq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index ac95b4424a2e..fd2daeb59b49 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -150,6 +150,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy, { struct cppc_cpudata *cpu_data = policy->driver_data; + unsigned int cpu = policy->cpu; struct cpufreq_freqs freqs; u32 desired_perf; int ret = 0; @@ -164,12 +165,12 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy, freqs.new = target_freq; cpufreq_freq_transition_begin(policy, &freqs); - ret = cppc_set_perf(cpu_data->cpu, &cpu_data->perf_ctrls); + ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls); cpufreq_freq_transition_end(policy, &freqs, ret != 0); if (ret) pr_debug("Failed to set target on CPU:%d. ret:%d\n", - cpu_data->cpu, ret); + cpu, ret); return ret; } -- 2.17.1