|
@@ -17,6 +17,7 @@
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+#include <linux/cpu.h>
|
|
#include <linux/cpu_pm.h>
|
|
#include <linux/cpu_pm.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
@@ -296,6 +297,35 @@ static void fpsimd_pm_init(void)
|
|
static inline void fpsimd_pm_init(void) { }
|
|
static inline void fpsimd_pm_init(void) { }
|
|
#endif /* CONFIG_CPU_PM */
|
|
#endif /* CONFIG_CPU_PM */
|
|
|
|
|
|
|
|
+#ifdef CONFIG_HOTPLUG_CPU
|
|
|
|
+static int fpsimd_cpu_hotplug_notifier(struct notifier_block *nfb,
|
|
|
|
+ unsigned long action,
|
|
|
|
+ void *hcpu)
|
|
|
|
+{
|
|
|
|
+ unsigned int cpu = (long)hcpu;
|
|
|
|
+
|
|
|
|
+ switch (action) {
|
|
|
|
+ case CPU_DEAD:
|
|
|
|
+ case CPU_DEAD_FROZEN:
|
|
|
|
+ per_cpu(fpsimd_last_state, cpu) = NULL;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ return NOTIFY_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static struct notifier_block fpsimd_cpu_hotplug_notifier_block = {
|
|
|
|
+ .notifier_call = fpsimd_cpu_hotplug_notifier,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static inline void fpsimd_hotplug_init(void)
|
|
|
|
+{
|
|
|
|
+ register_cpu_notifier(&fpsimd_cpu_hotplug_notifier_block);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#else
|
|
|
|
+static inline void fpsimd_hotplug_init(void) { }
|
|
|
|
+#endif
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* FP/SIMD support code initialisation.
|
|
* FP/SIMD support code initialisation.
|
|
*/
|
|
*/
|
|
@@ -315,6 +345,7 @@ static int __init fpsimd_init(void)
|
|
elf_hwcap |= HWCAP_ASIMD;
|
|
elf_hwcap |= HWCAP_ASIMD;
|
|
|
|
|
|
fpsimd_pm_init();
|
|
fpsimd_pm_init();
|
|
|
|
+ fpsimd_hotplug_init();
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|