cpufreq: intel_pstate: Add ->offline and ->online callbacks
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 1 Sep 2020 16:33:21 +0000 (18:33 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 1 Sep 2020 19:14:45 +0000 (21:14 +0200)
commit4adcf2e5829f83cbab581ba376abb7cb6404eeb3
tree3eedf6aaf0b1d36954d852cfc019c2e54c4d9f81
parentb388eb58ce47484a330681f09d1d058fe122c744
cpufreq: intel_pstate: Add ->offline and ->online callbacks

Add ->offline and ->online driver callbacks to prepare for taking a
CPU offline and to restore its working configuration when it goes
back online, respectively, to avoid invoking the ->init callback on
every CPU online which is quite a bit of unnecessary overhead.

Define ->offline and ->online so that they can be used in the
passive mode as well as in the active mode and because ->offline
will do the majority of ->stop_cpu work, the passive mode does
not need that callback any more, so drop it from there.

Also modify the active mode ->suspend and ->resume callbacks to
prevent them from interfering with the new ->offline and ->online
ones in case the latter are invoked withing the system-wide suspend
and resume code flow and make the passive mode use them too.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
drivers/cpufreq/intel_pstate.c