Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion drivers/iommu/io-pgtable-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,11 @@ static size_t __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
/* Clear the remaining entries */
__arm_lpae_clear_pte(ptep, &iop->cfg, i);

if (gather && !iommu_iotlb_gather_queued(gather))
if (gather && !iommu_iotlb_gather_queued(gather)) {
iommu_iotlb_gather_add_range(gather, iova, i * size);
for (int j = 0; j < i; j++)
io_pgtable_tlb_add_page(iop, gather, iova + j * size, size);
}

return i * size;
} else if (iopte_leaf(pte, lvl, iop->fmt)) {
Expand Down
3 changes: 3 additions & 0 deletions drivers/iommu/io-pgtable-dart.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ static size_t dart_unmap_pages(struct io_pgtable_ops *ops, unsigned long iova,
i++;
}

if (i && !iommu_iotlb_gather_queued(gather))
iommu_iotlb_gather_add_range(gather, iova, i * pgsize);

return i * pgsize;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/iommu/mtk_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,6 @@ static size_t mtk_iommu_unmap(struct iommu_domain *domain,
{
struct mtk_iommu_domain *dom = to_mtk_domain(domain);

iommu_iotlb_gather_add_range(gather, iova, pgsize * pgcount);
return dom->iop->unmap_pages(dom->iop, iova, pgsize, pgcount, gather);
}

Expand Down
1 change: 1 addition & 0 deletions drivers/iommu/sprd-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ static size_t sprd_iommu_unmap(struct iommu_domain *domain, unsigned long iova,
spin_lock_irqsave(&dom->pgtlock, flags);
memset(pgt_base_iova, 0, pgcount * sizeof(u32));
spin_unlock_irqrestore(&dom->pgtlock, flags);
iommu_iotlb_gather_add_range(iotlb_gather, iova, size);

return size;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/iommu/sun50i-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova

memset(pte_addr, 0, sizeof(*pte_addr));
sun50i_table_flush(sun50i_domain, pte_addr, 1);
iommu_iotlb_gather_add_range(gather, iova, SZ_4K);

return SZ_4K;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/iommu/virtio-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,8 @@ static size_t viommu_unmap_pages(struct iommu_domain *domain, unsigned long iova
if (unmapped < size)
return 0;

iommu_iotlb_gather_add_range(gather, iova, unmapped);

/* Device already removed all mappings after detach. */
if (!vdomain->nr_endpoints)
return unmapped;
Expand Down
Loading