summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-02 03:05:22 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-03 03:57:50 +0100
commited757a2c7bf7aa99d219b78349b4a0334851dc38 (patch)
treefd0b8c92d3ad63bd968ad2f81b979c25a1435ba0 /drivers/cpufreq/cpufreq.c
parentcpufreq: powernv: Fix bugs in powernv_cpufreq_{init/exit} (diff)
downloadlinux-ed757a2c7bf7aa99d219b78349b4a0334851dc38.tar.xz
linux-ed757a2c7bf7aa99d219b78349b4a0334851dc38.zip
cpufreq: acpi-cpufreq: Make read and write operations more efficient
Setting a new CPU frequency and reading the current request value in the ACPI cpufreq driver involves each at least two switch instructions (there's more if the policy is shared). One of them is present in drv_read/write() that prepares a command structure and the other happens in subsequent do_drv_read/write() when that structure is interpreted. However, all of those switches may be avoided by using function pointers. To that end, add two function pointers to struct acpi_cpufreq_data to represent read and write operations on the frequency register and set them up during policy intitialization to point to the pair of routines suitable for the given processor (Intel/AMD MSR access or I/O port access). Then, use those pointers in do_drv_read/write() and modify drv_read/write() to prepare the command structure for them without any checks. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
0 files changed, 0 insertions, 0 deletions