From: Yue Hu <zbestahu@gmail.com>
To: rjw@rjwysocki.net, viresh.kumar@linaro.org, rafael.j.wysocki@intel.com
Cc: linux-pm@vger.kernel.org, huyue2@yulong.com
Subject: [PATCH] cpufreq: Expose real_cpus out to userspace
Date: Fri, 19 Apr 2019 14:27:59 +0800 [thread overview]
Message-ID: <20190419062759.8524-2-zbestahu@gmail.com> (raw)
In-Reply-To: <20190419062759.8524-1-zbestahu@gmail.com>
From: Yue Hu <huyue2@yulong.com>
Currently, there are 3 CPU masks, let's expose real_cpus just like the
others if user want to know related CPUs that are actually present.
Signed-off-by: Yue Hu <huyue2@yulong.com>
---
drivers/cpufreq/cpufreq.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index c6187f1..0322cce 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -824,6 +824,11 @@ static ssize_t show_affected_cpus(struct cpufreq_policy *policy, char *buf)
return cpufreq_show_cpus(policy->cpus, buf);
}
+static ssize_t show_real_cpus(struct cpufreq_policy *policy, char *buf)
+{
+ return cpufreq_show_cpus(policy->real_cpus, buf);
+}
+
static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
const char *buf, size_t count)
{
@@ -873,6 +878,7 @@ static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf)
cpufreq_freq_attr_ro(bios_limit);
cpufreq_freq_attr_ro(related_cpus);
cpufreq_freq_attr_ro(affected_cpus);
+cpufreq_freq_attr_ro(real_cpus);
cpufreq_freq_attr_rw(scaling_min_freq);
cpufreq_freq_attr_rw(scaling_max_freq);
cpufreq_freq_attr_rw(scaling_governor);
@@ -886,6 +892,7 @@ static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf)
&scaling_max_freq.attr,
&affected_cpus.attr,
&related_cpus.attr,
+ &real_cpus.attr,
&scaling_governor.attr,
&scaling_driver.attr,
&scaling_available_governors.attr,
--
1.9.1
next prev parent reply other threads:[~2019-04-19 19:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-19 6:27 [PATCH] cpufreq: Move ->get callback check outside of __cpufreq_get() Yue Hu
2019-04-19 6:27 ` Yue Hu [this message]
2019-04-22 8:23 ` [PATCH] cpufreq: Expose real_cpus out to userspace Viresh Kumar
2019-04-22 8:19 ` [PATCH] cpufreq: Move ->get callback check outside of __cpufreq_get() Viresh Kumar
2019-05-01 10:39 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190419062759.8524-2-zbestahu@gmail.com \
--to=zbestahu@gmail.com \
--cc=huyue2@yulong.com \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox