Re: [PATCH rdma-next] RDMA/mlx5: Add a umr recovery flow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 15, 2022 at 07:19:53AM +0300, Leon Romanovsky wrote:
> @@ -270,17 +296,49 @@ static int mlx5r_umr_post_send_wait(struct mlx5_ib_dev *dev, u32 mkey,
>  	mlx5r_umr_init_context(&umr_context);
>  
>  	down(&umrc->sem);
> +	while (true) {
> +		mutex_lock(&umrc->lock);

You need to test this with lockdep, nesing a mutex under a semaphor is
not allowed, AFAIK.

> +		err = mlx5r_umr_post_send(umrc->qp, mkey, &umr_context.cqe, wqe,
> +					  with_data);
> +		mutex_unlock(&umrc->lock);
> +		if (err) {
> +			mlx5_ib_warn(dev, "UMR post send failed, err %d\n",
> +				     err);
> +			break;
>  		}
> +
> +		wait_for_completion(&umr_context.done);

Nor is sleeping under a semaphore.

And, I'm pretty sure, this entire function is called under a spinlock
in some cases.

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux