[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1551469117-3404-4-git-send-email-jcrouse@codeaurora.org>
Date: Fri, 1 Mar 2019 12:38:25 -0700
From: Jordan Crouse <jcrouse@...eaurora.org>
To: freedreno@...ts.freedesktop.org
Cc: jean-philippe.brucker@....com, linux-arm-msm@...r.kernel.org,
dianders@...omimum.org, hoegsberg@...gle.com,
baolu.lu@...ux.intel.com, iommu@...ts.linux-foundation.org,
Joerg Roedel <joro@...tes.org>, linux-kernel@...r.kernel.org
Subject: [RFC PATCH v1 03/15] iommu/io-pgtable: Allow TLB operations to be optional
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@...eaurora.org>
---
drivers/iommu/io-pgtable.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/io-pgtable.h b/drivers/iommu/io-pgtable.h
index 47d5ae5..fbfd3c9 100644
--- a/drivers/iommu/io-pgtable.h
+++ b/drivers/iommu/io-pgtable.h
@@ -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);
}
/**
--
2.7.4
Powered by blists - more mailing lists