Re: [RFC 1/2] reboot: Make restart_handler_list a blocking notifier chain.

2018-10-05 Thread Russell King - ARM Linux
On Fri, Oct 05, 2018 at 10:27:48AM +0200, Nicolas Cavallari wrote: > On 04/10/2018 18:49, Russell King - ARM Linux wrote: > > This isn't going to work. > > > > For example, sysrq processing (which can happen in IRQ context) calls > > emergency_restart() for the reboot sysrq. That calls through

Re: [RFC 1/2] reboot: Make restart_handler_list a blocking notifier chain.

2018-10-05 Thread Russell King - ARM Linux
On Fri, Oct 05, 2018 at 10:27:48AM +0200, Nicolas Cavallari wrote: > On 04/10/2018 18:49, Russell King - ARM Linux wrote: > > This isn't going to work. > > > > For example, sysrq processing (which can happen in IRQ context) calls > > emergency_restart() for the reboot sysrq. That calls through

Re: [RFC 1/2] reboot: Make restart_handler_list a blocking notifier chain.

2018-10-05 Thread Nicolas Cavallari
On 04/10/2018 18:49, Russell King - ARM Linux wrote: > This isn't going to work. > > For example, sysrq processing (which can happen in IRQ context) calls > emergency_restart() for the reboot sysrq. That calls through to > machine_restart(), which then calls do_kernel_restart(). > > If

Re: [RFC 1/2] reboot: Make restart_handler_list a blocking notifier chain.

2018-10-05 Thread Nicolas Cavallari
On 04/10/2018 18:49, Russell King - ARM Linux wrote: > This isn't going to work. > > For example, sysrq processing (which can happen in IRQ context) calls > emergency_restart() for the reboot sysrq. That calls through to > machine_restart(), which then calls do_kernel_restart(). > > If

Re: [RFC 1/2] reboot: Make restart_handler_list a blocking notifier chain.

2018-10-04 Thread Russell King - ARM Linux
On Thu, Oct 04, 2018 at 06:23:38PM +0200, Nicolas Cavallari wrote: > Many users of restart_handlers are sleeping in their callbacks. Some > are doing infinite loops or calling driver code that may sleep or > perform operation on slow busses, like i2c. > > This is not allowed in an atomic

Re: [RFC 1/2] reboot: Make restart_handler_list a blocking notifier chain.

2018-10-04 Thread Russell King - ARM Linux
On Thu, Oct 04, 2018 at 06:23:38PM +0200, Nicolas Cavallari wrote: > Many users of restart_handlers are sleeping in their callbacks. Some > are doing infinite loops or calling driver code that may sleep or > perform operation on slow busses, like i2c. > > This is not allowed in an atomic

[RFC 1/2] reboot: Make restart_handler_list a blocking notifier chain.

2018-10-04 Thread Nicolas Cavallari
Many users of restart_handlers are sleeping in their callbacks. Some are doing infinite loops or calling driver code that may sleep or perform operation on slow busses, like i2c. This is not allowed in an atomic notifier chain, which is what restart_handler_list currently is, so use a blocking

[RFC 1/2] reboot: Make restart_handler_list a blocking notifier chain.

2018-10-04 Thread Nicolas Cavallari
Many users of restart_handlers are sleeping in their callbacks. Some are doing infinite loops or calling driver code that may sleep or perform operation on slow busses, like i2c. This is not allowed in an atomic notifier chain, which is what restart_handler_list currently is, so use a blocking