Skip to content

Commit 1554240

Browse files
committed
Merge branches 'for-joerg/arm-smmu/smmu-v2' and 'for-joerg/arm-smmu/smmu-v3' into for-joerg/arm-smmu/updates
* for-joerg/arm-smmu/smmu-v2: Refactoring to allow for implementation-specific hooks in 'arm-smmu-impl.c' * for-joerg/arm-smmu/smmu-v3: Support for deferred TLB invalidation and batching of commands Rework ATC invalidation for ATS-enabled PCIe masters
2 parents d720e64 + a91bcc2 commit 1554240

25 files changed

+1182
-437
lines changed

drivers/gpu/drm/panfrost/panfrost_mmu.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void panfrost_mmu_unmap(struct panfrost_gem_object *bo)
222222
size_t unmapped_page;
223223
size_t pgsize = get_pgsize(iova, len - unmapped_len);
224224

225-
unmapped_page = ops->unmap(ops, iova, pgsize);
225+
unmapped_page = ops->unmap(ops, iova, pgsize, NULL);
226226
if (!unmapped_page)
227227
break;
228228

@@ -247,20 +247,28 @@ static void mmu_tlb_inv_context_s1(void *cookie)
247247
mmu_hw_do_operation(pfdev, 0, 0, ~0UL, AS_COMMAND_FLUSH_MEM);
248248
}
249249

250-
static void mmu_tlb_inv_range_nosync(unsigned long iova, size_t size,
251-
size_t granule, bool leaf, void *cookie)
252-
{}
253-
254250
static void mmu_tlb_sync_context(void *cookie)
255251
{
256252
//struct panfrost_device *pfdev = cookie;
257253
// TODO: Wait 1000 GPU cycles for HW_ISSUE_6367/T60X
258254
}
259255

260-
static const struct iommu_gather_ops mmu_tlb_ops = {
256+
static void mmu_tlb_flush_walk(unsigned long iova, size_t size, size_t granule,
257+
void *cookie)
258+
{
259+
mmu_tlb_sync_context(cookie);
260+
}
261+
262+
static void mmu_tlb_flush_leaf(unsigned long iova, size_t size, size_t granule,
263+
void *cookie)
264+
{
265+
mmu_tlb_sync_context(cookie);
266+
}
267+
268+
static const struct iommu_flush_ops mmu_tlb_ops = {
261269
.tlb_flush_all = mmu_tlb_inv_context_s1,
262-
.tlb_add_flush = mmu_tlb_inv_range_nosync,
263-
.tlb_sync = mmu_tlb_sync_context,
270+
.tlb_flush_walk = mmu_tlb_flush_walk,
271+
.tlb_flush_leaf = mmu_tlb_flush_leaf,
264272
};
265273

266274
static const char *access_type_name(struct panfrost_device *pfdev,

drivers/iommu/amd_iommu.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,7 +3055,8 @@ static int amd_iommu_map(struct iommu_domain *dom, unsigned long iova,
30553055
}
30563056

30573057
static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova,
3058-
size_t page_size)
3058+
size_t page_size,
3059+
struct iommu_iotlb_gather *gather)
30593060
{
30603061
struct protection_domain *domain = to_pdomain(dom);
30613062
size_t unmap_size;
@@ -3196,9 +3197,10 @@ static void amd_iommu_flush_iotlb_all(struct iommu_domain *domain)
31963197
domain_flush_complete(dom);
31973198
}
31983199

3199-
static void amd_iommu_iotlb_range_add(struct iommu_domain *domain,
3200-
unsigned long iova, size_t size)
3200+
static void amd_iommu_iotlb_sync(struct iommu_domain *domain,
3201+
struct iommu_iotlb_gather *gather)
32013202
{
3203+
amd_iommu_flush_iotlb_all(domain);
32023204
}
32033205

32043206
const struct iommu_ops amd_iommu_ops = {
@@ -3219,8 +3221,7 @@ const struct iommu_ops amd_iommu_ops = {
32193221
.is_attach_deferred = amd_iommu_is_attach_deferred,
32203222
.pgsize_bitmap = AMD_IOMMU_PGSIZES,
32213223
.flush_iotlb_all = amd_iommu_flush_iotlb_all,
3222-
.iotlb_range_add = amd_iommu_iotlb_range_add,
3223-
.iotlb_sync = amd_iommu_flush_iotlb_all,
3224+
.iotlb_sync = amd_iommu_iotlb_sync,
32243225
};
32253226

32263227
/*****************************************************************************

0 commit comments

Comments
 (0)