History

cpufreq: Allow light-weight tear down and bring up of CPUs

The cpufreq core doesn't remove the cpufreq policy anymore on CPU offline operation, rather that happens when the CPU device gets unregistered from the kernel. This allows faster recovery when the CPU comes back online. This is also very useful during system wide suspend/resume where we offline all non-boot CPUs during suspend and then bring them back on resume. This commit takes the same idea a step ahead to allow drivers to do light weight tear-down and bring-up during CPU offline and online operations. A new set of callbacks is introduced, online/offline(). online() gets called when the first CPU of an inactive policy is brought up and offline() gets called when all the CPUs of a policy are offlined. The existing init/exit() callback get called on policy creation/destruction. They also get called instead of online/offline() callbacks if the online/offline() callbacks aren't provided. This also moves around some code to get executed only for the new-policy case going forward.

Viresh Kumar committed 7 years ago

Commit 91a12e91 parent 97956072 files · +40 −20Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/cpufreq.h+2−0
@@ -325,6 +325,8 @@ struct cpufreq_driver { · 324 unmodified lines
325325 /* optional */
326326 int (*bios_limit)(int cpu, unsigned int *limit);
327327
328+ int (*online)(struct cpufreq_policy *policy);
329+ int (*offline)(struct cpufreq_policy *policy);
328330 int (*exit)(struct cpufreq_policy *policy);
329331 void (*stop_cpu)(struct cpufreq_policy *policy);
330332 int (*suspend)(struct cpufreq_policy *policy);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t