@@ -178,18 +178,22 @@ struct io_pgtable {
static inline void io_pgtable_tlb_flush_all(struct io_pgtable *iop)
{
- iop->cfg.tlb->tlb_flush_all(iop->cookie);
+ if (iop->cfg.tlb)
+ iop->cfg.tlb->tlb_flush_all(iop->cookie);
}
static inline void io_pgtable_tlb_add_flush(struct io_pgtable *iop,
unsigned long iova, size_t size, size_t granule, bool leaf)
{
- iop->cfg.tlb->tlb_add_flush(iova, size, granule, leaf, iop->cookie);
+ if (iop->cfg.tlb)
+ iop->cfg.tlb->tlb_add_flush(iova, size, granule, leaf,
+ iop->cookie);
}
static inline void io_pgtable_tlb_sync(struct io_pgtable *iop)
{
- iop->cfg.tlb->tlb_sync(iop->cookie);
+ if (iop->cfg.tlb)
+ iop->cfg.tlb->tlb_sync(iop->cookie);
}
/**
An upcoming change to arm-smmu will add auxiliary domains that will allow a leaf driver to create and map additional pagetables for device specific uses. By definition aux arm-smmu domains will not be allowed to touch the hardware directly so allow for the TLB operations for a given pagetable configuration to be NULL just in case the caller accidentally calls for a flush with the wrong device. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> --- drivers/iommu/io-pgtable.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)