thermal: intel: hfi: Handle CPU hotplug events
authorRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Thu, 27 Jan 2022 19:34:51 +0000 (11:34 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Feb 2022 18:50:49 +0000 (19:50 +0100)
commit2d74e6319abe278981e79166b6c2d0c3ed39b1ae
tree477be27e11e8a21b49fb66ac1642b3052886f256
parent1cb19cabeb0e187b6c244d0da73d27f7432c40dc
thermal: intel: hfi: Handle CPU hotplug events

All CPUs in a package are represented in an HFI table. There exists an
HFI table per package. Thus, CPUs in a package need to coordinate to
initialize and access the table. Do such coordination during CPU hotplug.
Use the first CPU to come online in a package to initialize the HFI
instance and the data structure representing it. Other CPUs in the same
package need only to register or unregister themselves in that data
structure.

The HFI depends on both the package-level thermal management and the local
APIC thermal local vector. Thus, to ensure that a CPU coming online has an
associated HFI instance when the hardware issues an HFI event, enable the
HFI only after having enabled the local APIC thermal vector. The thermal
throttle driver takes care of the needed package-level initialization.

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/intel/intel_hfi.c
drivers/thermal/intel/intel_hfi.h
drivers/thermal/intel/therm_throt.c