@@ -752,6 +752,7 @@ struct device_dma_parameters {
*/
unsigned int max_segment_size;
unsigned long segment_boundary_mask;
+ bool iova_contiguous;
};
/**
@@ -729,6 +729,22 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
return -EIO;
}
+static inline int dma_get_iova_contiguous(struct device *dev)
+{
+ if (dev->dma_parms)
+ return dev->dma_parms->iova_contiguous;
+ return false;
+}
+
+static inline int dma_set_iova_contiguous(struct device *dev, bool contiguous)
+{
+ if (dev->dma_parms) {
+ dev->dma_parms->iova_contiguous = contiguous;
+ return 0;
+ }
+ return -EIO;
+}
+
#ifndef dma_max_pfn
static inline unsigned long dma_max_pfn(struct device *dev)
{
This API can set a flag whether a device requires iova contiguous strictly. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> --- include/linux/device.h | 1 + include/linux/dma-mapping.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+)