Writing the panic event to the pvpanic device is a self contained
upcall, and pvpanic_send_event() already takes pvpanic_lock with a
trylock, so the callback satisfies the contract as is.

The INT_MAX priority is kept so the host hears about the panic
before anything else on the list runs.

Signed-off-by: Bradley Morgan <[email protected]>
---
 drivers/misc/pvpanic/pvpanic.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c
index 17c0eb549463..c409968228e4 100644
--- a/drivers/misc/pvpanic/pvpanic.c
+++ b/drivers/misc/pvpanic/pvpanic.c
@@ -218,7 +218,7 @@ static int pvpanic_init(void)
        INIT_LIST_HEAD(&pvpanic_list);
        spin_lock_init(&pvpanic_lock);
 
-       atomic_notifier_chain_register(&panic_notifier_list, &pvpanic_panic_nb);
+       panic_notifier_register_pre_kdump(&pvpanic_panic_nb);
 
        return 0;
 }
@@ -226,7 +226,6 @@ module_init(pvpanic_init);
 
 static void pvpanic_exit(void)
 {
-       atomic_notifier_chain_unregister(&panic_notifier_list, 
&pvpanic_panic_nb);
-
+       panic_notifier_unregister_pre_kdump(&pvpanic_panic_nb);
 }
 module_exit(pvpanic_exit);
-- 
2.53.0


Reply via email to