Re: [PATCH v2 01/21] dma-mapping: Allow map_sg() ops to return negative error codes

2021-07-25 Thread Christoph Hellwig
> +int dma_map_sgtable(struct device *dev, struct sg_table *sgt, > + enum dma_data_direction dir, unsigned long attrs) > +{ > + int nents; > + > + nents = __dma_map_sg_attrs(dev, sgt->sgl, sgt->orig_nents, dir, attrs); > + if (nents == 0) > + return -EIO; >

[PATCH v2 01/21] dma-mapping: Allow map_sg() ops to return negative error codes

2021-07-23 Thread Logan Gunthorpe
Allow dma_map_sgtable() to pass errors from the map_sg() ops. This will be required for returning appropriate error codes when mapping P2PDMA memory. Introduce __dma_map_sg_attrs() which will return the raw error code from the map_sg operation (whether it be negative or zero). Then add a