* [PATCH 0/2] acpi-cpufreq: introduce base_frequency @ 2016-03-01 0:10 Srinivas Pandruvada 2016-03-01 0:10 ` [PATCH 1/2] cpufreq: acpi_cpufreq: base frequency attribute support Srinivas Pandruvada ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Srinivas Pandruvada @ 2016-03-01 0:10 UTC (permalink / raw) To: rjw, viresh.kumar; +Cc: linux-pm, Srinivas Pandruvada This patchset introduces base_frequency attribute to cpufreq sysfs only for acpi-cpufreq. No change but sending code and document patch together. Srinivas Pandruvada (2): cpufreq: acpi_cpufreq: base frequency attribute support Documentation: cpufreq: Additional interface for acpi-cpufreq Documentation/cpu-freq/acpi-cpufreq-addition.txt | 20 +++++++++++++ drivers/cpufreq/acpi-cpufreq.c | 36 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/cpu-freq/acpi-cpufreq-addition.txt -- 2.5.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] cpufreq: acpi_cpufreq: base frequency attribute support 2016-03-01 0:10 [PATCH 0/2] acpi-cpufreq: introduce base_frequency Srinivas Pandruvada @ 2016-03-01 0:10 ` Srinivas Pandruvada 2016-03-01 0:10 ` [PATCH 2/2] Documentation: cpufreq: Additional interface for acpi-cpufreq Srinivas Pandruvada 2016-03-01 2:33 ` [PATCH 0/2] acpi-cpufreq: introduce base_frequency Viresh Kumar 2 siblings, 0 replies; 5+ messages in thread From: Srinivas Pandruvada @ 2016-03-01 0:10 UTC (permalink / raw) To: rjw, viresh.kumar; +Cc: linux-pm, Srinivas Pandruvada Currently scaling_available_frequencies displays list of available frequencies which can be used to set max/min or current scaling frequency. >cat scaling_available_frequencies 2301000 2300000 2200000 2000000 1900000 1800000 1700000 1500000 1400000 1300000 1100000 1000000 900000 800000 600000 500000 Here traditionally it is assumed that only 2301000 is a turbo frequency, which is purely opportunistic, anything else user can request and may get it. But because of configurable thermal design power implementation in several Intel CPUs, the opportunistic frequency start can be any frequency in this range. For example it can be 2300000 or any lower value. This change adds an optional new attribute called "base_frequency", which displays the max non-turbo frequency (base frequency). For example: >cat base_frequency 2200000 This will allow user to choose a certain frequency which is not opportunistic. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> --- drivers/cpufreq/acpi-cpufreq.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 51eef87..76edd28 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -646,6 +646,21 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c) } #endif +static ssize_t show_base_frequency(struct cpufreq_policy *policy, char *buf) +{ + u64 tar; + int err; + + err = rdmsrl_safe_on_cpu(policy->cpu, MSR_TURBO_ACTIVATION_RATIO, &tar); + if (!err) + /* Refer to IA64, IA32 SDM table 35-20, unit = 100 MHz */ + return sprintf(buf, "%llu\n", tar * 100000); + + return err; +} + +cpufreq_freq_attr_ro(base_frequency); + static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) { unsigned int i; @@ -889,6 +904,7 @@ static struct freq_attr *acpi_cpufreq_attr[] = { &cpb, #endif NULL, + NULL, }; static struct cpufreq_driver acpi_cpufreq_driver = { @@ -971,6 +987,26 @@ static int __init acpi_cpufreq_init(void) } } #endif + + if (boot_cpu_has(X86_FEATURE_IDA)) { + u64 plat_info, tar; + int err; + + err = rdmsrl_safe_on_cpu(0, MSR_PLATFORM_INFO, &plat_info); + /* Check number of config TDP levels > 0 */ + if (!err && ((plat_info >> 33) & 0x03) > 0) { + err = rdmsrl_safe_on_cpu(0, MSR_TURBO_ACTIVATION_RATIO, + &tar); + if (!err) { + struct freq_attr **attr; + + for (attr = acpi_cpufreq_attr; *attr; attr++) + ; + *attr = &base_frequency; + } + } + } + acpi_cpufreq_boost_init(); ret = cpufreq_register_driver(&acpi_cpufreq_driver); -- 2.5.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] Documentation: cpufreq: Additional interface for acpi-cpufreq 2016-03-01 0:10 [PATCH 0/2] acpi-cpufreq: introduce base_frequency Srinivas Pandruvada 2016-03-01 0:10 ` [PATCH 1/2] cpufreq: acpi_cpufreq: base frequency attribute support Srinivas Pandruvada @ 2016-03-01 0:10 ` Srinivas Pandruvada 2016-03-01 2:39 ` Viresh Kumar 2016-03-01 2:33 ` [PATCH 0/2] acpi-cpufreq: introduce base_frequency Viresh Kumar 2 siblings, 1 reply; 5+ messages in thread From: Srinivas Pandruvada @ 2016-03-01 0:10 UTC (permalink / raw) To: rjw, viresh.kumar; +Cc: linux-pm, Srinivas Pandruvada Added new file for acpi-cpufreq driver, with explanation for base_frequency. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> --- Documentation/cpu-freq/acpi-cpufreq-addition.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Documentation/cpu-freq/acpi-cpufreq-addition.txt diff --git a/Documentation/cpu-freq/acpi-cpufreq-addition.txt b/Documentation/cpu-freq/acpi-cpufreq-addition.txt new file mode 100644 index 0000000..40efb22 --- /dev/null +++ b/Documentation/cpu-freq/acpi-cpufreq-addition.txt @@ -0,0 +1,20 @@ +Additional sysfs attribute for acpi-cpufreq + +In addition to the standard sysfs interface as defined in the +user-guide.txt under section "Preferred Interface: sysfs", +acpi-cpufreq can have following additional sysfs attribute: + +base_frequency: Max non-turbo frequency +For example: +scaling_available_frequencies displays list of available frequencies which +can be used to set max/min or current scaling frequency. +>cat scaling_available_frequencies +2301000 2300000 2200000 2000000 1900000 1800000 1700000 1500000 1400000 +1300000 1100000 1000000 900000 800000 600000 500000 +If the base_frequency attribute is present, then any frequency above is +purely opportunistic or turbo frequency. For example +>cat base_frequency +2200000 +Then in the above displayed list of scaling_available_frequencies, any +frequency 2300000 or 2301000 is opportunistic or turbo frequency. + -- 2.5.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] Documentation: cpufreq: Additional interface for acpi-cpufreq 2016-03-01 0:10 ` [PATCH 2/2] Documentation: cpufreq: Additional interface for acpi-cpufreq Srinivas Pandruvada @ 2016-03-01 2:39 ` Viresh Kumar 0 siblings, 0 replies; 5+ messages in thread From: Viresh Kumar @ 2016-03-01 2:39 UTC (permalink / raw) To: Srinivas Pandruvada; +Cc: rjw, linux-pm On 29-02-16, 16:10, Srinivas Pandruvada wrote: > Added new file for acpi-cpufreq driver, with explanation for > base_frequency. > > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> > --- > Documentation/cpu-freq/acpi-cpufreq-addition.txt | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > create mode 100644 Documentation/cpu-freq/acpi-cpufreq-addition.txt > > diff --git a/Documentation/cpu-freq/acpi-cpufreq-addition.txt b/Documentation/cpu-freq/acpi-cpufreq-addition.txt s/-addition// > new file mode 100644 > index 0000000..40efb22 > --- /dev/null > +++ b/Documentation/cpu-freq/acpi-cpufreq-addition.txt > @@ -0,0 +1,20 @@ > +Additional sysfs attribute for acpi-cpufreq You should be adding a description of freqdomain_cpus in this file, which was never documented (yes, in a separate patch). > +In addition to the standard sysfs interface as defined in the > +user-guide.txt under section "Preferred Interface: sysfs", > +acpi-cpufreq can have following additional sysfs attribute: Maybe rewrite as: acpi-cpufreq have following sysfs attributes in addition to standard cpufreq attributes: > + > +base_frequency: Max non-turbo frequency > +For example: Please keep the formatting similar to user-guide.txt > +scaling_available_frequencies displays list of available frequencies > which can be used to set max/min or current scaling frequency. Just drop above line. > +>cat scaling_available_frequencies > +2301000 2300000 2200000 2000000 1900000 1800000 1700000 1500000 1400000 > +1300000 1100000 1000000 900000 800000 600000 500000 A blank line here.. This is documentation and should be really readable. > +If the base_frequency attribute is present, *is present* isn't sufficient, right? It should be readable as well? > then any frequency above is s/above/above base_frequency/ > +purely opportunistic or turbo frequency. For example s/purely opportunistic or / a/ > +>cat base_frequency > +2200000 Blank line here as well: > +Then in the above displayed list of scaling_available_frequencies, any > +frequency 2300000 or 2301000 is opportunistic or turbo frequency. Maybe just: i.e. 2300000 and 2301000 are turbo frequencies now.. > + > -- > 2.5.0 -- viresh ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] acpi-cpufreq: introduce base_frequency 2016-03-01 0:10 [PATCH 0/2] acpi-cpufreq: introduce base_frequency Srinivas Pandruvada 2016-03-01 0:10 ` [PATCH 1/2] cpufreq: acpi_cpufreq: base frequency attribute support Srinivas Pandruvada 2016-03-01 0:10 ` [PATCH 2/2] Documentation: cpufreq: Additional interface for acpi-cpufreq Srinivas Pandruvada @ 2016-03-01 2:33 ` Viresh Kumar 2 siblings, 0 replies; 5+ messages in thread From: Viresh Kumar @ 2016-03-01 2:33 UTC (permalink / raw) To: Srinivas Pandruvada; +Cc: rjw, linux-pm On 29-02-16, 16:10, Srinivas Pandruvada wrote: > This patchset introduces base_frequency attribute to cpufreq sysfs > only for acpi-cpufreq. > > No change but sending code and document patch together. Perhaps Rafael asked you to fold it into the first patch, which meant that we should have had a single patch for both of these things. But its still okay, as these are part of the same set at least. But, you again failed to convey version information, etc. > Srinivas Pandruvada (2): > cpufreq: acpi_cpufreq: base frequency attribute support > Documentation: cpufreq: Additional interface for acpi-cpufreq > > Documentation/cpu-freq/acpi-cpufreq-addition.txt | 20 +++++++++++++ > drivers/cpufreq/acpi-cpufreq.c | 36 ++++++++++++++++++++++++ > 2 files changed, 56 insertions(+) > create mode 100644 Documentation/cpu-freq/acpi-cpufreq-addition.txt > > -- > 2.5.0 -- viresh ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-01 2:39 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-01 0:10 [PATCH 0/2] acpi-cpufreq: introduce base_frequency Srinivas Pandruvada 2016-03-01 0:10 ` [PATCH 1/2] cpufreq: acpi_cpufreq: base frequency attribute support Srinivas Pandruvada 2016-03-01 0:10 ` [PATCH 2/2] Documentation: cpufreq: Additional interface for acpi-cpufreq Srinivas Pandruvada 2016-03-01 2:39 ` Viresh Kumar 2016-03-01 2:33 ` [PATCH 0/2] acpi-cpufreq: introduce base_frequency Viresh Kumar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).