svn commit: r321984 - head/sys/dev/mlx5/mlx5_core

Hans Petter Selasky hselasky at FreeBSD.org
Thu Aug 3 09:14:44 UTC 2017


Author: hselasky
Date: Thu Aug  3 09:14:43 2017
New Revision: 321984
URL: https://svnweb.freebsd.org/changeset/base/321984

Log:
  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

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c	Thu Aug  3 09:11:51 2017	(r321983)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c	Thu Aug  3 09:14:43 2017	(r321984)
@@ -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);
 }


More information about the svn-src-head mailing list