Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

acpi-cpufreq: Add comment under ACPI_ADR_SPACE_SYSTEM_IO case

policy->cur is now set by cpufreq core when cpufreq_driver->get() is defined and
so drivers aren't required to set it. When space_id is ACPI_ADR_SPACE_SYSTEM_IO
for acpi cpufreq driver it doesn't set ->get to a valid function pointer and so
policy->cur is required to be set by driver.

This is already followed in acpi-cpufreq driver. This patch adds a comment
describing why we need to set policy->cur from driver.

Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Viresh Kumar and committed by
Rafael J. Wysocki
1bab64d5 076dec90

+6 -1
+6 -1
drivers/cpufreq/acpi-cpufreq.c
··· 837 837 838 838 switch (perf->control_register.space_id) { 839 839 case ACPI_ADR_SPACE_SYSTEM_IO: 840 - /* Current speed is unknown and not detectable by IO port */ 840 + /* 841 + * The core will not set policy->cur, because 842 + * cpufreq_driver->get is NULL, so we need to set it here. 843 + * However, we have to guess it, because the current speed is 844 + * unknown and not detectable via IO ports. 845 + */ 841 846 policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); 842 847 break; 843 848 case ACPI_ADR_SPACE_FIXED_HARDWARE: