On Sun, Jul 18, 2021 at 06:24:26PM +0000, Chesnokov Gleb wrote: > Hi Leon, Please don't use top-posting format. Thanks > > > isert_cma_handler() is called from cma_work_handler(), which holds id_priv->handler_mutex. > The call of rdma_destroy_id() from isert_cma_handler() will cause recursive acquisition of the mutex, leading to a deadlock. > > -- cma_work_handler() > ---- mutex_lock(&id_priv->handler_mutex) > ---- isert_cma_handler() > ------ rmda_destroy_id() > -------- mutex_lock(&id_priv->handler_mutex) This answers why you needed workqueue. > > Therefore, you cannot directly call isert_np_reinit_id(). I would expect rdma-cm to be changed to support such flow. However it is probably overkill. Thanks, Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>