]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xen: swiotlb: return error code from xen_swiotlb_map_sg()
authorMartin Oliveira <martin.oliveira@eideticom.com>
Thu, 29 Jul 2021 20:15:35 +0000 (14:15 -0600)
committerChristoph Hellwig <hch@lst.de>
Mon, 9 Aug 2021 15:13:06 +0000 (17:13 +0200)
The .map_sg() op now expects an error code instead of zero on failure.

xen_swiotlb_map_sg() may only fail if xen_swiotlb_map_page() fails, but
xen_swiotlb_map_page() only supports returning errors as
DMA_MAPPING_ERROR. So coalesce all errors into EIO per the documentation
for dma_map_sgtable().

Signed-off-by: Martin Oliveira <martin.oliveira@eideticom.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/xen/swiotlb-xen.c

index 24d11861ac7d890e86c298cfb6aa277e5ab8a60d..85d58b720a2471e193b15fbeded1c7aa0c778979 100644 (file)
@@ -509,7 +509,7 @@ xen_swiotlb_map_sg(struct device *dev, struct scatterlist *sgl, int nelems,
 out_unmap:
        xen_swiotlb_unmap_sg(dev, sgl, i, dir, attrs | DMA_ATTR_SKIP_CPU_SYNC);
        sg_dma_len(sgl) = 0;
-       return 0;
+       return -EIO;
 }
 
 static void