Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd6ff13c authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Patrick Daly
Browse files

iommu: io-pgtable: add .map_sg op to io_pgtable_ops



The default implementation of map_sg (provided by default_iommu_map_sg
from the IOMMU API layer) actually just calls iommu_map repeatedly.
Often times there are locks or other initial setup in the implementation
of iommu_map, so there's opportunity to drastically improve performance
by factoring that out of the loop.  For this reason, io-pgtable
providers might want to implement .map_sg.  Add the declaration to the
io_pgtable_ops structure.

Change-Id: I5aa5e4e24a68e303ce2c005dc1dd0b33d5635ab3
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 76e77fb0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
#define __IO_PGTABLE_H
#include <linux/bitops.h>

#include <linux/scatterlist.h>

/*
 * Public API for use by IOMMU drivers
 */
@@ -112,6 +114,8 @@ struct io_pgtable_cfg {
struct io_pgtable_ops {
	int (*map)(struct io_pgtable_ops *ops, unsigned long iova,
		   phys_addr_t paddr, size_t size, int prot);
	int (*map_sg)(struct io_pgtable_ops *ops, unsigned long iova,
		      struct scatterlist *sg, unsigned int nents, int prot);
	int (*unmap)(struct io_pgtable_ops *ops, unsigned long iova,
		     size_t size);
	phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops,