Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp461971pxb; Thu, 5 Nov 2020 04:59:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMjYYx7TZ5qJl3t+Hp7N9ez/KCiBfT7WLRMeaTtcA4+A36B4QF3OUfxnPWyoCIyv5MLS+K X-Received: by 2002:a17:906:519e:: with SMTP id y30mr2103001ejk.186.1604581148056; Thu, 05 Nov 2020 04:59:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604581148; cv=none; d=google.com; s=arc-20160816; b=tjKhORo5xrHvdY3SIxsT3PRFEJJSqVMftRehmOtvF+GGYXzvmPOKm7WLMGdQCuCSv0 jhWhXgtLoCb29y5si1qa9bzfO5SeBr7e8r05y4CBSuFaOdtHOVslN/HUGziLPayaQB4K mtutxQVbKBAyBdV1VwgxnilYJ/bdAPmH4zT35nJzOWPM/I3rStkvy7DTHkLEl183h0on zCkD6wF/w9hK2qNxXdWBeWzm6SdACPsayWTJEAAYiAotQnteLdDMZGFq8w/CXhaXYr+7 hjBULFppYY36vu2RCDI5SaIs5I4DzjS18LME1mb78Hnp9rVrrcmyPeekVVMOrR6hTRr6 a0zA== 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=E/kYQzHkKfVI+JZmXRxn65ZV64pjQsVI39jJfcPcZhw=; b=OZ6wr7khcXM0mBJBBWVLg4px/0+ymQ4Lfi2ygiT/sRirXbV+EbLClyWMYDTNMnaHbY fvMeQHzmkX58TDqW9n/xNmKzmLJxwXV6lYFWTVGWQLVSfvaWvAvU+OkdqzZPyfxlJP0p rKJPnJ1oSNPdTaNCBsyIgIAcAn2NYL9oLUywyiq8D8/osQovw3LuWmtTZpGtjMoKuiBD ay54k5iO2V+G+k0S+r4dt0FL14Cjmkai4q0Uaa1fWBC3w/qhuxQzAPBJjq9SsBwsk7ki 0qXX5yLFqTm3z11esVeqtn5QQInIiFN65n9uW5XOkcP4FezLgdj2yYzYIeq5enZJlfQL IzPQ== 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 qt13si1023502ejb.358.2020.11.05.04.58.44; Thu, 05 Nov 2020 04:59:08 -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 S1730897AbgKEM5A (ORCPT + 99 others); Thu, 5 Nov 2020 07:57:00 -0500 Received: from foss.arm.com ([217.140.110.172]:60050 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730826AbgKEM4w (ORCPT ); Thu, 5 Nov 2020 07:56:52 -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 67B5D142F; Thu, 5 Nov 2020 04:56:52 -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 333D33F719; Thu, 5 Nov 2020 04:56:51 -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 7/8] cppc_cpufreq: expose information on frequency domains Date: Thu, 5 Nov 2020 12:55:23 +0000 Message-Id: <20201105125524.4409-8-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 Use the existing sysfs attribute "freqdomain_cpus" to expose information to userspace about CPUs in the same frequency domain. Signed-off-by: Ionela Voinescu Cc: Rafael J. Wysocki Cc: Viresh Kumar --- Documentation/ABI/testing/sysfs-devices-system-cpu | 3 ++- drivers/cpufreq/cppc_cpufreq.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu index 1a04ca8162ad..0eee30b27ab6 100644 --- a/Documentation/ABI/testing/sysfs-devices-system-cpu +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu @@ -264,7 +264,8 @@ Description: Discover CPUs in the same CPU frequency coordination domain attribute is useful for user space DVFS controllers to get better power/performance results for platforms using acpi-cpufreq. - This file is only present if the acpi-cpufreq driver is in use. + This file is only present if the acpi-cpufreq or the cppc-cpufreq + drivers are in use. What: /sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1} diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 60ac7f8049b5..b4edeeb57d04 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -483,6 +483,19 @@ static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state) return 0; } +static ssize_t show_freqdomain_cpus(struct cpufreq_policy *policy, char *buf) +{ + struct cppc_cpudata *cpu_data = policy->driver_data; + + return cpufreq_show_cpus(cpu_data->domain->shared_cpu_map, buf); +} +cpufreq_freq_attr_ro(freqdomain_cpus); + +static struct freq_attr *cppc_cpufreq_attr[] = { + &freqdomain_cpus, + NULL, +}; + static struct cpufreq_driver cppc_cpufreq_driver = { .flags = CPUFREQ_CONST_LOOPS, .verify = cppc_verify_policy, @@ -491,6 +504,7 @@ static struct cpufreq_driver cppc_cpufreq_driver = { .init = cppc_cpufreq_cpu_init, .stop_cpu = cppc_cpufreq_stop_cpu, .set_boost = cppc_cpufreq_set_boost, + .attr = cppc_cpufreq_attr, .name = "cppc_cpufreq", }; -- 2.17.1