Re: [PATCH net-next] devlink: Execute devlink health recover as a work

From: Jiri Pirko
Date: Fri Apr 26 2019 - 00:41:10 EST

Thu, Apr 25, 2019 at 11:38:47PM CEST, jakub.kicinski@xxxxxxxxxxxxx wrote:
>On Thu, 25 Apr 2019 13:57:03 +0300, Moshe Shemesh wrote:
>> Different reporters have different rules in the driver and are being
>> created/destroyed during different stages of driver load/unload/running.
>> So during execution of a reporter recover the flow can go through
>> another reporter's destroy and create. Such flow leads to deadlock
>> trying to lock a mutex already held if the flow was triggered by devlink
>> recover command.
>> To avoid such deadlock, we execute the recover flow from a workqueue.
>> Once the recover work is done successfully the reporter health state and
>> recover counter are being updated.
>Naive question, why not just run the doit unlocked? Why the async?

Hmm, you have a point here. That would be probably doable.