aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/iommu/amd_iommu_init.c8
-rw-r--r--drivers/iommu/io-pgtable-arm-v7s.c2
-rw-r--r--drivers/iommu/mtk_iommu.c3
-rw-r--r--include/linux/iommu.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 382de42b8359..6fe2d0346073 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -874,7 +874,7 @@ static bool copy_device_table(void)
874 hi = readl(iommu->mmio_base + MMIO_DEV_TABLE_OFFSET + 4); 874 hi = readl(iommu->mmio_base + MMIO_DEV_TABLE_OFFSET + 4);
875 entry = (((u64) hi) << 32) + lo; 875 entry = (((u64) hi) << 32) + lo;
876 if (last_entry && last_entry != entry) { 876 if (last_entry && last_entry != entry) {
877 pr_err("IOMMU:%d should use the same dev table as others!/n", 877 pr_err("IOMMU:%d should use the same dev table as others!\n",
878 iommu->index); 878 iommu->index);
879 return false; 879 return false;
880 } 880 }
@@ -882,7 +882,7 @@ static bool copy_device_table(void)
882 882
883 old_devtb_size = ((entry & ~PAGE_MASK) + 1) << 12; 883 old_devtb_size = ((entry & ~PAGE_MASK) + 1) << 12;
884 if (old_devtb_size != dev_table_size) { 884 if (old_devtb_size != dev_table_size) {
885 pr_err("The device table size of IOMMU:%d is not expected!/n", 885 pr_err("The device table size of IOMMU:%d is not expected!\n",
886 iommu->index); 886 iommu->index);
887 return false; 887 return false;
888 } 888 }
@@ -890,7 +890,7 @@ static bool copy_device_table(void)
890 890
891 old_devtb_phys = entry & PAGE_MASK; 891 old_devtb_phys = entry & PAGE_MASK;
892 if (old_devtb_phys >= 0x100000000ULL) { 892 if (old_devtb_phys >= 0x100000000ULL) {
893 pr_err("The address of old device table is above 4G, not trustworthy!/n"); 893 pr_err("The address of old device table is above 4G, not trustworthy!\n");
894 return false; 894 return false;
895 } 895 }
896 old_devtb = memremap(old_devtb_phys, dev_table_size, MEMREMAP_WB); 896 old_devtb = memremap(old_devtb_phys, dev_table_size, MEMREMAP_WB);
@@ -901,7 +901,7 @@ static bool copy_device_table(void)
901 old_dev_tbl_cpy = (void *)__get_free_pages(gfp_flag, 901 old_dev_tbl_cpy = (void *)__get_free_pages(gfp_flag,
902 get_order(dev_table_size)); 902 get_order(dev_table_size));
903 if (old_dev_tbl_cpy == NULL) { 903 if (old_dev_tbl_cpy == NULL) {
904 pr_err("Failed to allocate memory for copying old device table!/n"); 904 pr_err("Failed to allocate memory for copying old device table!\n");
905 return false; 905 return false;
906 } 906 }
907 907
diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c
index d665d0dc16e8..6961fc393f0b 100644
--- a/drivers/iommu/io-pgtable-arm-v7s.c
+++ b/drivers/iommu/io-pgtable-arm-v7s.c
@@ -245,7 +245,7 @@ static void __arm_v7s_free_table(void *table, int lvl,
245static void __arm_v7s_pte_sync(arm_v7s_iopte *ptep, int num_entries, 245static void __arm_v7s_pte_sync(arm_v7s_iopte *ptep, int num_entries,
246 struct io_pgtable_cfg *cfg) 246 struct io_pgtable_cfg *cfg)
247{ 247{
248 if (!(cfg->quirks & IO_PGTABLE_QUIRK_NO_DMA)) 248 if (cfg->quirks & IO_PGTABLE_QUIRK_NO_DMA)
249 return; 249 return;
250 250
251 dma_sync_single_for_device(cfg->iommu_dev, __arm_v7s_dma_addr(ptep), 251 dma_sync_single_for_device(cfg->iommu_dev, __arm_v7s_dma_addr(ptep),
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index bd515be5b380..16d33ac19db0 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -371,7 +371,8 @@ static int mtk_iommu_map(struct iommu_domain *domain, unsigned long iova,
371 int ret; 371 int ret;
372 372
373 spin_lock_irqsave(&dom->pgtlock, flags); 373 spin_lock_irqsave(&dom->pgtlock, flags);
374 ret = dom->iop->map(dom->iop, iova, paddr, size, prot); 374 ret = dom->iop->map(dom->iop, iova, paddr & DMA_BIT_MASK(32),
375 size, prot);
375 spin_unlock_irqrestore(&dom->pgtlock, flags); 376 spin_unlock_irqrestore(&dom->pgtlock, flags);
376 377
377 return ret; 378 return ret;
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index a7f2ac689d29..41b8c5757859 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -167,11 +167,11 @@ struct iommu_resv_region {
167 * @map: map a physically contiguous memory region to an iommu domain 167 * @map: map a physically contiguous memory region to an iommu domain
168 * @unmap: unmap a physically contiguous memory region from an iommu domain 168 * @unmap: unmap a physically contiguous memory region from an iommu domain
169 * @map_sg: map a scatter-gather list of physically contiguous memory chunks 169 * @map_sg: map a scatter-gather list of physically contiguous memory chunks
170 * to an iommu domain
170 * @flush_tlb_all: Synchronously flush all hardware TLBs for this domain 171 * @flush_tlb_all: Synchronously flush all hardware TLBs for this domain
171 * @tlb_range_add: Add a given iova range to the flush queue for this domain 172 * @tlb_range_add: Add a given iova range to the flush queue for this domain
172 * @tlb_sync: Flush all queued ranges from the hardware TLBs and empty flush 173 * @tlb_sync: Flush all queued ranges from the hardware TLBs and empty flush
173 * queue 174 * queue
174 * to an iommu domain
175 * @iova_to_phys: translate iova to physical address 175 * @iova_to_phys: translate iova to physical address
176 * @add_device: add device to iommu grouping 176 * @add_device: add device to iommu grouping
177 * @remove_device: remove device from iommu grouping 177 * @remove_device: remove device from iommu grouping