summaryrefslogtreecommitdiff
path: root/mm/secretmem.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2021-07-29 14:15:19 -0600
committerChristoph Hellwig <hch@lst.de>2021-08-09 17:13:02 +0200
commitfffe3cc8c2194f60c4af4fac7f27d25e8828f001 (patch)
tree355e3659644e50766165690c2d549fd154d684ed /mm/secretmem.c
parent173735c346c412d9f084825ecb04f24ada0e2986 (diff)
dma-mapping: allow map_sg() ops to return negative error codes
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 dma_map_sg_attrs() wrapper to convert any negative errors to zero to satisfy the existing calling convention. dma_map_sgtable() defines three error codes that .map_sg implementations are allowed to return: -EINVAL, -ENOMEM and -EIO. The latter of which is a generic return for cases that are passing DMA_MAPPING_ERROR through. dma_map_sgtable() will convert a zero error return for old map_sg() ops into a -EIO return and return any negative errors as reported. This allows map_sg implementations to start returning multiple negative error codes. Legacy map_sg implementations can continue to return zero until they are all converted. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'mm/secretmem.c')
0 files changed, 0 insertions, 0 deletions