CPPC: Probe for CPPC tables for each ACPI Processor object
authorAshwin Chaugule <ashwin.chaugule@linaro.org>
Wed, 9 Sep 2015 20:27:07 +0000 (16:27 -0400)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 12 Oct 2015 21:08:04 +0000 (23:08 +0200)
For each detected ACPI Processor object (ACPI0007), search its
device handle for CPPC specific tables (i.e. _CPC) and extract
CPU specific performance capabilities.

Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Reviewed-by: Al Stone <al.stone@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/processor_driver.c
include/acpi/processor.h

index 51e658f21e956fd66895d431971bb56449c74e56..f4e02ae93f585fbb8de42c09d4d0fb32d2751887 100644 (file)
@@ -242,6 +242,10 @@ static int __acpi_processor_start(struct acpi_device *device)
        if (pr->flags.need_hotplug_init)
                return 0;
 
+       result = acpi_cppc_processor_probe(pr);
+       if (result)
+               return -ENODEV;
+
        if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
                acpi_processor_power_init(pr);
 
@@ -287,6 +291,8 @@ static int acpi_processor_stop(struct device *dev)
 
        acpi_pss_perf_exit(pr, device);
 
+       acpi_cppc_processor_exit(pr);
+
        return 0;
 }
 
index ff5f135f16b139e5fb04096a8a28d8103d72d2c5..07fb100bcc688ddc1835b958ac430182ee699128 100644 (file)
@@ -311,6 +311,20 @@ phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id);
 int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id);
 int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id);
 
+#ifdef CONFIG_ACPI_CPPC_LIB
+extern int acpi_cppc_processor_probe(struct acpi_processor *pr);
+extern void acpi_cppc_processor_exit(struct acpi_processor *pr);
+#else
+static inline int acpi_cppc_processor_probe(struct acpi_processor *pr)
+{
+       return 0;
+}
+static inline void acpi_cppc_processor_exit(struct acpi_processor *pr)
+{
+       return;
+}
+#endif /* CONFIG_ACPI_CPPC_LIB */
+
 /* in processor_pdc.c */
 void acpi_processor_set_pdc(acpi_handle handle);