From 713dd5cb9efaab852026f6856771ae68eb653c29 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 3 Aug 2017 09:14:43 +0000 Subject: [PATCH] Resolve locking issue for non-sleepable context in the mlx5core. Code inspection reveals the busdma unload and free functions do not write to the belonging dma tag and does not need to be serialized. This allows mlx5_fwp_free() to be called from software interrupt context. MFC after: 3 days Sponsored by: Mellanox Technologies --- sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c index 3f74ace3d778..ffd22655fa6b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c @@ -190,13 +190,10 @@ mlx5_fwp_free(struct mlx5_fw_page *fwp) num = fwp->numpages; dev = fwp->dev; - /* serialize unloading the DMA maps */ - sx_xlock(&dev->cmd.dma_sx); while (num--) { bus_dmamap_unload(dev->cmd.dma_tag, fwp[num].dma_map); bus_dmamem_free(dev->cmd.dma_tag, fwp[num].virt_addr, fwp[num].dma_map); } - sx_xunlock(&dev->cmd.dma_sx); kfree(fwp); }