Commit 35dbba31 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'iommu-fixes-v4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:

 - A comment fix for 'struct iommu_ops'

 - Format string fixes for AMD IOMMU, unfortunatly I missed that during
   review.

 - Limit mediatek physical addresses to 32 bit for v7s to fix a warning
   triggered in io-page-table code.

 - Fix dma-sync in io-pgtable-arm-v7s code

* tag 'iommu-fixes-v4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu: Fix comment for iommu_ops.map_sg
  iommu/amd: pr_err() strings should end with newlines
  iommu/mediatek: Limit the physical address in 32bit for v7s
  iommu/io-pgtable-arm-v7s: Need dma-sync while there is no QUIRK_NO_DMA
parents 06482600 50ce6312
...@@ -874,7 +874,7 @@ static bool copy_device_table(void) ...@@ -874,7 +874,7 @@ static bool copy_device_table(void)
hi = readl(iommu->mmio_base + MMIO_DEV_TABLE_OFFSET + 4); hi = readl(iommu->mmio_base + MMIO_DEV_TABLE_OFFSET + 4);
entry = (((u64) hi) << 32) + lo; entry = (((u64) hi) << 32) + lo;
if (last_entry && last_entry != entry) { if (last_entry && last_entry != entry) {
pr_err("IOMMU:%d should use the same dev table as others!/n", pr_err("IOMMU:%d should use the same dev table as others!\n",
iommu->index); iommu->index);
return false; return false;
} }
...@@ -882,7 +882,7 @@ static bool copy_device_table(void) ...@@ -882,7 +882,7 @@ static bool copy_device_table(void)
old_devtb_size = ((entry & ~PAGE_MASK) + 1) << 12; old_devtb_size = ((entry & ~PAGE_MASK) + 1) << 12;
if (old_devtb_size != dev_table_size) { if (old_devtb_size != dev_table_size) {
pr_err("The device table size of IOMMU:%d is not expected!/n", pr_err("The device table size of IOMMU:%d is not expected!\n",
iommu->index); iommu->index);
return false; return false;
} }
...@@ -890,7 +890,7 @@ static bool copy_device_table(void) ...@@ -890,7 +890,7 @@ static bool copy_device_table(void)
old_devtb_phys = entry & PAGE_MASK; old_devtb_phys = entry & PAGE_MASK;
if (old_devtb_phys >= 0x100000000ULL) { if (old_devtb_phys >= 0x100000000ULL) {
pr_err("The address of old device table is above 4G, not trustworthy!/n"); pr_err("The address of old device table is above 4G, not trustworthy!\n");
return false; return false;
} }
old_devtb = memremap(old_devtb_phys, dev_table_size, MEMREMAP_WB); old_devtb = memremap(old_devtb_phys, dev_table_size, MEMREMAP_WB);
...@@ -901,7 +901,7 @@ static bool copy_device_table(void) ...@@ -901,7 +901,7 @@ static bool copy_device_table(void)
old_dev_tbl_cpy = (void *)__get_free_pages(gfp_flag, old_dev_tbl_cpy = (void *)__get_free_pages(gfp_flag,
get_order(dev_table_size)); get_order(dev_table_size));
if (old_dev_tbl_cpy == NULL) { if (old_dev_tbl_cpy == NULL) {
pr_err("Failed to allocate memory for copying old device table!/n"); pr_err("Failed to allocate memory for copying old device table!\n");
return false; return false;
} }
......
...@@ -245,7 +245,7 @@ static void __arm_v7s_free_table(void *table, int lvl, ...@@ -245,7 +245,7 @@ static void __arm_v7s_free_table(void *table, int lvl,
static void __arm_v7s_pte_sync(arm_v7s_iopte *ptep, int num_entries, static void __arm_v7s_pte_sync(arm_v7s_iopte *ptep, int num_entries,
struct io_pgtable_cfg *cfg) struct io_pgtable_cfg *cfg)
{ {
if (!(cfg->quirks & IO_PGTABLE_QUIRK_NO_DMA)) if (cfg->quirks & IO_PGTABLE_QUIRK_NO_DMA)
return; return;
dma_sync_single_for_device(cfg->iommu_dev, __arm_v7s_dma_addr(ptep), dma_sync_single_for_device(cfg->iommu_dev, __arm_v7s_dma_addr(ptep),
......
...@@ -371,7 +371,8 @@ static int mtk_iommu_map(struct iommu_domain *domain, unsigned long iova, ...@@ -371,7 +371,8 @@ static int mtk_iommu_map(struct iommu_domain *domain, unsigned long iova,
int ret; int ret;
spin_lock_irqsave(&dom->pgtlock, flags); spin_lock_irqsave(&dom->pgtlock, flags);
ret = dom->iop->map(dom->iop, iova, paddr, size, prot); ret = dom->iop->map(dom->iop, iova, paddr & DMA_BIT_MASK(32),
size, prot);
spin_unlock_irqrestore(&dom->pgtlock, flags); spin_unlock_irqrestore(&dom->pgtlock, flags);
return ret; return ret;
......
...@@ -167,11 +167,11 @@ struct iommu_resv_region { ...@@ -167,11 +167,11 @@ struct iommu_resv_region {
* @map: map a physically contiguous memory region to an iommu domain * @map: map a physically contiguous memory region to an iommu domain
* @unmap: unmap a physically contiguous memory region from an iommu domain * @unmap: unmap a physically contiguous memory region from an iommu domain
* @map_sg: map a scatter-gather list of physically contiguous memory chunks * @map_sg: map a scatter-gather list of physically contiguous memory chunks
* to an iommu domain
* @flush_tlb_all: Synchronously flush all hardware TLBs for this domain * @flush_tlb_all: Synchronously flush all hardware TLBs for this domain
* @tlb_range_add: Add a given iova range to the flush queue for this domain * @tlb_range_add: Add a given iova range to the flush queue for this domain
* @tlb_sync: Flush all queued ranges from the hardware TLBs and empty flush * @tlb_sync: Flush all queued ranges from the hardware TLBs and empty flush
* queue * queue
* to an iommu domain
* @iova_to_phys: translate iova to physical address * @iova_to_phys: translate iova to physical address
* @add_device: add device to iommu grouping * @add_device: add device to iommu grouping
* @remove_device: remove device from iommu grouping * @remove_device: remove device from iommu grouping
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment