Hi, On Thu, Oct 28, 2021 at 12:16:57AM +0300, Dmitry Osipenko wrote: > Use devm_register_power_handler() that replaces global pm_power_off > variable and allows to register multiple power-off handlers. It also > provides restart-handler support, i.e. all in one API. > > Signed-off-by: Dmitry Osipenko > --- When I boot with (most of) this patchset applied, I get the warning at kernel/reboot.c:187: /* * Handler must have unique priority. Otherwise call order is * determined by registration order, which is unreliable. */ WARN_ON(!atomic_notifier_has_unique_priority(&restart_handler_list, nb)); As the NTXEC driver doesn't specify a priority, I think this is an issue to be fixed elsewhere. Other than that, it works and looks good, as far as I can tell. For this patch: Reviewed-by: Jonathan Neuschäfer Tested-by: Jonathan Neuschäfer Best regards, Jonathan --- Full Oops log: [ 3.523294] ------------[ cut here ]------------ [ 3.528193] WARNING: CPU: 0 PID: 1 at kernel/reboot.c:187 register_restart_handler+0x4c/0x58 [ 3.536975] Modules linked in: [ 3.540312] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.0-00021-gcb24c628b307 #622 [ 3.548214] Hardware name: Freescale i.MX50 (Device Tree Support) [ 3.554357] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 3.562183] [] (show_stack) from [] (dump_stack_lvl+0x58/0x70) [ 3.569824] [] (dump_stack_lvl) from [] (__warn+0xd4/0x154) [ 3.577191] [] (__warn) from [] (warn_slowpath_fmt+0x74/0xa8) [ 3.584727] [] (warn_slowpath_fmt) from [] (register_restart_handler+0x4c/0x58) [ 3.593823] [] (register_restart_handler) from [] (__watchdog_register_device+0x13c/0x27c) [ 3.603889] [] (__watchdog_register_device) from [] (watchdog_register_device+0x60/0xb4) [ 3.613764] [] (watchdog_register_device) from [] (devm_watchdog_register_device+0x3c/0x84) [ 3.623898] [] (devm_watchdog_register_device) from [] (imx2_wdt_probe+0x254/0x2ac) [ 3.633346] [] (imx2_wdt_probe) from [] (platform_probe+0x58/0xb8) [ 3.641314] [] (platform_probe) from [] (call_driver_probe+0x24/0x108) [ 3.649636] [] (call_driver_probe) from [] (really_probe.part.0+0xa8/0x358) [ 3.658384] [] (really_probe.part.0) from [] (__driver_probe_device+0x94/0x208) [ 3.667470] [] (__driver_probe_device) from [] (driver_probe_device+0x30/0xc8) [ 3.676468] [] (driver_probe_device) from [] (__driver_attach+0xe0/0x1c4) [ 3.685032] [] (__driver_attach) from [] (bus_for_each_dev+0x74/0xc0) [ 3.693253] [] (bus_for_each_dev) from [] (bus_add_driver+0x100/0x208) [ 3.701563] [] (bus_add_driver) from [] (driver_register+0x88/0x118) [ 3.709696] [] (driver_register) from [] (__platform_driver_probe+0x44/0xdc) [ 3.718522] [] (__platform_driver_probe) from [] (do_one_initcall+0x78/0x388) [ 3.727444] [] (do_one_initcall) from [] (do_initcalls+0xcc/0x110) [ 3.735413] [] (do_initcalls) from [] (kernel_init_freeable+0x1ec/0x250) [ 3.743896] [] (kernel_init_freeable) from [] (kernel_init+0x10/0x128) [ 3.752224] [] (kernel_init) from [] (ret_from_fork+0x14/0x38) [ 3.759844] Exception stack(0xc40adfb0 to 0xc40adff8) [ 3.764933] dfa0: 00000000 00000000 00000000 00000000 [ 3.773143] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 3.781351] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 3.788347] irq event stamp: 143613 [ 3.792102] hardirqs last enabled at (143623): [] __up_console_sem+0x50/0x60 [ 3.800397] hardirqs last disabled at (143632): [] __up_console_sem+0x3c/0x60 [ 3.808491] softirqs last enabled at (143612): [] __do_softirq+0x2f8/0x5b0 [ 3.816591] softirqs last disabled at (143603): [] __irq_exit_rcu+0x160/0x1d8 [ 3.825014] ---[ end trace 7f6709d2c89774b4 ]---