|
@@ -894,29 +894,10 @@ static struct notifier_block hw_breakpoint_reset_nb = {
|
|
|
.notifier_call = hw_breakpoint_reset_notify,
|
|
.notifier_call = hw_breakpoint_reset_notify,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-#ifdef CONFIG_CPU_PM
|
|
|
|
|
-static int hw_breakpoint_cpu_pm_notify(struct notifier_block *self,
|
|
|
|
|
- unsigned long action,
|
|
|
|
|
- void *v)
|
|
|
|
|
-{
|
|
|
|
|
- if (action == CPU_PM_EXIT) {
|
|
|
|
|
- hw_breakpoint_reset(NULL);
|
|
|
|
|
- return NOTIFY_OK;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return NOTIFY_DONE;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-static struct notifier_block hw_breakpoint_cpu_pm_nb = {
|
|
|
|
|
- .notifier_call = hw_breakpoint_cpu_pm_notify,
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-static void __init hw_breakpoint_pm_init(void)
|
|
|
|
|
-{
|
|
|
|
|
- cpu_pm_register_notifier(&hw_breakpoint_cpu_pm_nb);
|
|
|
|
|
-}
|
|
|
|
|
|
|
+#ifdef CONFIG_ARM64_CPU_SUSPEND
|
|
|
|
|
+extern void cpu_suspend_set_dbg_restorer(void (*hw_bp_restore)(void *));
|
|
|
#else
|
|
#else
|
|
|
-static inline void hw_breakpoint_pm_init(void)
|
|
|
|
|
|
|
+static inline void cpu_suspend_set_dbg_restorer(void (*hw_bp_restore)(void *))
|
|
|
{
|
|
{
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
@@ -947,7 +928,8 @@ static int __init arch_hw_breakpoint_init(void)
|
|
|
|
|
|
|
|
/* Register hotplug notifier. */
|
|
/* Register hotplug notifier. */
|
|
|
register_cpu_notifier(&hw_breakpoint_reset_nb);
|
|
register_cpu_notifier(&hw_breakpoint_reset_nb);
|
|
|
- hw_breakpoint_pm_init();
|
|
|
|
|
|
|
+ /* Register cpu_suspend hw breakpoint restore hook */
|
|
|
|
|
+ cpu_suspend_set_dbg_restorer(hw_breakpoint_reset);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|