[ofa-general] [RFC 0/1] libmthca: CQ/DMA race on Altix

Muli Ben-Yehuda muli at il.ibm.com
Mon Jul 16 00:34:35 PDT 2007


On Sun, Jul 15, 2007 at 02:21:46PM -0700, akepner at sgi.com wrote:

> diff --git a/include/asm-generic/dma-mapping.h b/include/asm-generic/dma-mapping.h
> index 783ab99..34e8357 100644
> --- a/include/asm-generic/dma-mapping.h
> +++ b/include/asm-generic/dma-mapping.h
> @@ -89,7 +89,7 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
>  
>  static inline int
>  dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
> -	   enum dma_data_direction direction)
> +	   enum dma_data_direction direction, int coherent)
>  {
>  	BUG_ON(dev->bus != &pci_bus_type);
>  
> @@ -213,7 +213,7 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
>  
>  static inline int
>  dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
> -	   enum dma_data_direction direction)
> +	   enum dma_data_direction direction, int coherent)
>  {
>  	BUG();
>  	return 0;

This will be very painful and frankly I don't think the pain is
justified. Can't you confine the changes to the IB layerr so that the
mapping happens through dma_alloc_coherent if you need
coherent/consistent memory rather than through dma_map_sg?

Also, this kind of thing should definitely be CC'd to lkml.

Cheers,
Muli



More information about the general mailing list