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

2021-07-16 Thread Christoph Hellwig
On Thu, Jul 15, 2021 at 10:45:29AM -0600, Logan Gunthorpe wrote: > + * dma_map_sgtable() will return the error code returned and convert > + * a zero return (for legacy implementations) into -EINVAL. > + * > + * dma_map_sg() will always return zero on any negative or zero > +

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

2021-07-15 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