diff mbox

[RFC,2/5] ACPI / processor: always compile perflib if CONFIG_ACPI_PROCESSOR

Message ID 1430922690-6966-3-git-send-email-sudeep.holla@arm.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Sudeep Holla May 6, 2015, 2:31 p.m. UTC
Similar to the  idle, thermal and throttling libraries, always compile
the perflib if CONFIG_ACPI_PROCESSOR is enabled. This not only makes
perflib alligned with other libraries but also helps in some sanity
testing of these ACPI methods even when a particular feature is not
enabled in the kernel configuration.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/acpi/Makefile    |  2 +-
 include/acpi/processor.h | 29 -----------------------------
 include/linux/cpufreq.h  |  4 ++++
 3 files changed, 5 insertions(+), 30 deletions(-)

Comments

Ashwin Chaugule May 6, 2015, 6:36 p.m. UTC | #1
Hello,

On 6 May 2015 at 10:31, Sudeep Holla <sudeep.holla@arm.com> wrote:
> Similar to the  idle, thermal and throttling libraries, always compile
> the perflib if CONFIG_ACPI_PROCESSOR is enabled. This not only makes
> perflib alligned with other libraries but also helps in some sanity
> testing of these ACPI methods even when a particular feature is not
> enabled in the kernel configuration.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/acpi/Makefile    |  2 +-
>  include/acpi/processor.h | 29 -----------------------------
>  include/linux/cpufreq.h  |  4 ++++
>  3 files changed, 5 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
> index 8a063e276530..33aef9d8b260 100644
> --- a/drivers/acpi/Makefile
> +++ b/drivers/acpi/Makefile
> @@ -84,7 +84,7 @@ obj-$(CONFIG_ACPI_BGRT)               += bgrt.o
>  # processor has its own "processor." module_param namespace
>  processor-y                    := processor_driver.o processor_throttling.o
>  processor-y                    += processor_idle.o processor_thermal.o
> -processor-$(CONFIG_CPU_FREQ)   += processor_perflib.o
> +processor-y                    += processor_perflib.o

I'd prefer that we create a separate kconfig option for this. (perhaps
even default it to 'y'). This library is quite specific to a certain
type of CPU performance management methods (includes _PSS and friends)
which are superseded by CPPC. The OS is not expected to support both
at runtime, so by keeping this a config option, we can then disable it
at compile time when CPPC is enabled. We could couple
processor_throttling, thermal and perflib under this config option
(CONFIG_PSS ?) since they're all under the same CPU performance
management umbrella. Thoughts?

Regards,
Ashwin.
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hanjun Guo May 8, 2015, 8:52 a.m. UTC | #2
On 2015?05?07? 02:36, Ashwin Chaugule wrote:
> Hello,
>
> On 6 May 2015 at 10:31, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> Similar to the  idle, thermal and throttling libraries, always compile
>> the perflib if CONFIG_ACPI_PROCESSOR is enabled. This not only makes
>> perflib alligned with other libraries but also helps in some sanity
>> testing of these ACPI methods even when a particular feature is not
>> enabled in the kernel configuration.
>>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
>>   drivers/acpi/Makefile    |  2 +-
>>   include/acpi/processor.h | 29 -----------------------------
>>   include/linux/cpufreq.h  |  4 ++++
>>   3 files changed, 5 insertions(+), 30 deletions(-)
>>
>> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
>> index 8a063e276530..33aef9d8b260 100644
>> --- a/drivers/acpi/Makefile
>> +++ b/drivers/acpi/Makefile
>> @@ -84,7 +84,7 @@ obj-$(CONFIG_ACPI_BGRT)               += bgrt.o
>>   # processor has its own "processor." module_param namespace
>>   processor-y                    := processor_driver.o processor_throttling.o
>>   processor-y                    += processor_idle.o processor_thermal.o
>> -processor-$(CONFIG_CPU_FREQ)   += processor_perflib.o
>> +processor-y                    += processor_perflib.o
>
> I'd prefer that we create a separate kconfig option for this. (perhaps
> even default it to 'y'). This library is quite specific to a certain
> type of CPU performance management methods (includes _PSS and friends)
> which are superseded by CPPC. The OS is not expected to support both
> at runtime, so by keeping this a config option, we can then disable it
> at compile time when CPPC is enabled. We could couple

I agree. CPPC and _PSS are different way of controlling CPU freq,
and I think _PSS may not be used on ARM.

Thanks
Hanjun
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sudeep Holla May 8, 2015, 10:06 a.m. UTC | #3
On 08/05/15 09:52, Hanjun Guo wrote:
> On 2015?05?07? 02:36, Ashwin Chaugule wrote:
>> Hello,
>>
>> On 6 May 2015 at 10:31, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>> Similar to the  idle, thermal and throttling libraries, always compile
>>> the perflib if CONFIG_ACPI_PROCESSOR is enabled. This not only makes
>>> perflib alligned with other libraries but also helps in some sanity
>>> testing of these ACPI methods even when a particular feature is not
>>> enabled in the kernel configuration.
>>>
>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>> ---
>>>    drivers/acpi/Makefile    |  2 +-
>>>    include/acpi/processor.h | 29 -----------------------------
>>>    include/linux/cpufreq.h  |  4 ++++
>>>    3 files changed, 5 insertions(+), 30 deletions(-)
>>>
>>> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
>>> index 8a063e276530..33aef9d8b260 100644
>>> --- a/drivers/acpi/Makefile
>>> +++ b/drivers/acpi/Makefile
>>> @@ -84,7 +84,7 @@ obj-$(CONFIG_ACPI_BGRT)               += bgrt.o
>>>    # processor has its own "processor." module_param namespace
>>>    processor-y                    := processor_driver.o processor_throttling.o
>>>    processor-y                    += processor_idle.o processor_thermal.o
>>> -processor-$(CONFIG_CPU_FREQ)   += processor_perflib.o
>>> +processor-y                    += processor_perflib.o
>>
>> I'd prefer that we create a separate kconfig option for this. (perhaps
>> even default it to 'y'). This library is quite specific to a certain
>> type of CPU performance management methods (includes _PSS and friends)
>> which are superseded by CPPC. The OS is not expected to support both
>> at runtime, so by keeping this a config option, we can then disable it
>> at compile time when CPPC is enabled. We could couple
>
> I agree. CPPC and _PSS are different way of controlling CPU freq,
> and I think _PSS may not be used on ARM.
>

While I agree having a separate config option is good, but I won't
assume _PSS might not be used on ARM as I have seen patches posted on
the list in past to use _PSS on ARM platform[1].

Regards,
Sudeep

[1] http://marc.info/?l=linaro-acpi&m=139745485418399&w=2
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 8a063e276530..33aef9d8b260 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -84,7 +84,7 @@  obj-$(CONFIG_ACPI_BGRT)		+= bgrt.o
 # processor has its own "processor." module_param namespace
 processor-y			:= processor_driver.o processor_throttling.o
 processor-y			+= processor_idle.o processor_thermal.o
-processor-$(CONFIG_CPU_FREQ)	+= processor_perflib.o
+processor-y			+= processor_perflib.o
 
 obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
 
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 4188a4d3b597..42a7ca744ff1 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -275,39 +275,10 @@  static inline void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx
 
 /* in processor_perflib.c */
 
-#ifdef CONFIG_CPU_FREQ
 void acpi_processor_ppc_init(void);
 void acpi_processor_ppc_exit(void);
 int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag);
 extern int acpi_processor_get_bios_limit(int cpu, unsigned int *limit);
-#else
-static inline void acpi_processor_ppc_init(void)
-{
-	return;
-}
-static inline void acpi_processor_ppc_exit(void)
-{
-	return;
-}
-static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr,
-								int event_flag)
-{
-	static unsigned int printout = 1;
-	if (printout) {
-		printk(KERN_WARNING
-		       "Warning: Processor Platform Limit event detected, but not handled.\n");
-		printk(KERN_WARNING
-		       "Consider compiling CPUfreq support into your kernel.\n");
-		printout = 0;
-	}
-	return 0;
-}
-static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
-{
-	return -ENODEV;
-}
-
-#endif				/* CONFIG_CPU_FREQ */
 
 /* in processor_core.c */
 phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 2ee4888c1f47..ee91b295350b 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -171,6 +171,10 @@  static inline unsigned int cpufreq_quick_get_max(unsigned int cpu)
 {
 	return 0;
 }
+static inline int cpufreq_update_policy(unsigned int cpu)
+{
+	return -ENODEV;
+}
 static inline void disable_cpufreq(void) { }
 #endif