Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3011653pxb; Sun, 8 Nov 2020 23:11:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRClscFYvvXlYtPBR6V7nIZvdyG02hKJtuA+r5/31BMpK6SiNNhtjVQOT+oA8nt6aELNF/ X-Received: by 2002:a50:d784:: with SMTP id w4mr14155459edi.201.1604905895008; Sun, 08 Nov 2020 23:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604905894; cv=none; d=google.com; s=arc-20160816; b=R/rxi+Qn1HUlT80wyFWQ/Ng7zWWDUki/0oiPzRWp3tNuubYPzBvULXoprVdPcAd1Y5 R6bI5rAYBKhX3n5j4cJpJzUDoCcSAwrWed2IVulobI9ZVWW41LSXI3MzBPaTWYVPx8Ho 87dhcmQLpOu0isl43xBXPswl4x2XTyiuY6rAe1w6pXWcwFQexECnB683FSasyP+3BSFn lf62MyhqXIEt8mMUAHTa6wb+che7xChQw16G7/SGt7L++sXZGSYTCZp8qp8xXhzdafvq g0tdrdSrSDWtzDcTxnkPboN3SKOCkIkY48oyIPtgn35s4nOTa0xfWdKMnnRIP4/y7HGW TBoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/FaU29Y4JMgTHlOU8rTa94tuMXWoPpfGji5be75b2rU=; b=jhgbekAtPnzto3ykk1RCyU+v3hZY9PTDloZ3b5zlIpfzSiEUITBLwcQJgc00TvXtdH 9c83dyVaxPl6PcIXYEuoeVKM09cm3T0npVi8UbLuAVD/RjJD8lTZSRC+u0I7ym7z93Ov y7JVYOsFbX9Eqg+KFG8l0ndy+Hd8VI7jiwUuRjPe2JUK0Y74wOqDA1Y8YN0cgzDciCHl 5dXrbex/rLCLPc4NBEAdHrgzb3wVAHY7YbhxQJNcIlCrVLzoQuukNlCs9c9vEN8V1dxp O1K4uj/CZ20s46h1OX1vbteUC4Jrv/BkHl0ylT8GBzSzrxbOo+3g2QylOJbl/dx+e7Uq bhSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rLcblK+B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si2053733ejn.209.2020.11.08.23.11.12; Sun, 08 Nov 2020 23:11:34 -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; dkim=pass header.i=@linaro.org header.s=google header.b=rLcblK+B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729671AbgKIHJ3 (ORCPT + 99 others); Mon, 9 Nov 2020 02:09:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728038AbgKIHJ1 (ORCPT ); Mon, 9 Nov 2020 02:09:27 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E53AC0613D3 for ; Sun, 8 Nov 2020 23:09:27 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id x13so6345771pgp.7 for ; Sun, 08 Nov 2020 23:09:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/FaU29Y4JMgTHlOU8rTa94tuMXWoPpfGji5be75b2rU=; b=rLcblK+BzZkRhrZxn4EP3AT262nanGmzzXc6E/2nKdNmHuzVWUzVbHEaPXoOX4Qm4H /Zbr2fh+qToihwPlC4AyxBRUMCjaUK8NBBeWp7R78QOMy9/BAkoj9FANA3o4CP1C23M1 i4sYs+dAJ1OQ1qus/ttZqstmgjrGBoRFF8JTJt9ujsXH5QpBKssu5SzM5MKVtC0sMRKF uPOPjLL1ZNkJF+JCctLX+aOKyVnc0iI5otQJf0eFRpkL2sTX7hGfu8BckDLzDtvzbpwI IXA49jnMccGgjTmxreO/OHRARVU79oRFygk7m2K1oOrm0odAipLKyfymPx0D6uLdWYAn +z2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/FaU29Y4JMgTHlOU8rTa94tuMXWoPpfGji5be75b2rU=; b=FIq9+DvgZYKvK+pFIUpZ9csLNdVtiT/yrBs/kBwrc/fPosaBpcELDO/2xUgWFxjRcJ ilKBPnb7o9z3vuV7nPvqMpc8MvGbXvWCGERo9xRyjScJwkcQCIn62GtLk1nkTzzt5VVO AuZzkwszrN/ToVT4KNTtN6yZ4/6AQgPuEfsI1H9sKb3W0wV+zDcsYU6Eg7TLMDMaKixm yVcTXMCDToO7zZsUGLN7Rjbe2sd+c6fTt0EtAzNoiMN468OMK0A/Xwq5qq1RfvoAwDhJ j9ZK8kHmrOkZgUIV/LSwBhx7ziaqIjuZxl0MBmQkhY79RB0XUC3X3HVZbpkqHvqmkOlw DfyQ== X-Gm-Message-State: AOAM533awmYSXIjT2+gXTKcJYKmvnrmKwDzvZk708KsdWBFb6rIe7UwK y548/0UkhIFWexv7+37gFrsk0ZLTeTvngg== X-Received: by 2002:a17:90a:fd8d:: with SMTP id cx13mr11754034pjb.138.1604905766984; Sun, 08 Nov 2020 23:09:26 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id v16sm9163875pgk.26.2020.11.08.23.09.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2020 23:09:26 -0800 (PST) Date: Mon, 9 Nov 2020 12:39:24 +0530 From: Viresh Kumar To: Ionela Voinescu Cc: rjw@rjwysocki.net, lenb@kernel.org, sudeep.holla@arm.com, morten.rasmussen@arm.com, jeremy.linton@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 7/8] cppc_cpufreq: expose information on frequency domains Message-ID: <20201109070924.d47rohgumvdial3b@vireshk-i7> References: <20201105125524.4409-1-ionela.voinescu@arm.com> <20201105125524.4409-8-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201105125524.4409-8-ionela.voinescu@arm.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05-11-20, 12:55, Ionela Voinescu wrote: > 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", > }; Acked-by: Viresh Kumar -- viresh