diff options
-rw-r--r-- | drivers/iommu/amd_iommu_init.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index f8a222b0ac3f..8a7f1971d633 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -1381,7 +1381,7 @@ static int __init init_memory_definitions(struct acpi_table_header *table) | |||
1381 | * Init the device table to not allow DMA access for devices and | 1381 | * Init the device table to not allow DMA access for devices and |
1382 | * suppress all page faults | 1382 | * suppress all page faults |
1383 | */ | 1383 | */ |
1384 | static void init_device_table(void) | 1384 | static void init_device_table_dma(void) |
1385 | { | 1385 | { |
1386 | u32 devid; | 1386 | u32 devid; |
1387 | 1387 | ||
@@ -1391,6 +1391,17 @@ static void init_device_table(void) | |||
1391 | } | 1391 | } |
1392 | } | 1392 | } |
1393 | 1393 | ||
1394 | static void init_device_table(void) | ||
1395 | { | ||
1396 | u32 devid; | ||
1397 | |||
1398 | if (!amd_iommu_irq_remap) | ||
1399 | return; | ||
1400 | |||
1401 | for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) | ||
1402 | set_dev_entry_bit(devid, DEV_ENTRY_IRQ_TBL_EN); | ||
1403 | } | ||
1404 | |||
1394 | static void iommu_init_flags(struct amd_iommu *iommu) | 1405 | static void iommu_init_flags(struct amd_iommu *iommu) |
1395 | { | 1406 | { |
1396 | iommu->acpi_flags & IVHD_FLAG_HT_TUN_EN_MASK ? | 1407 | iommu->acpi_flags & IVHD_FLAG_HT_TUN_EN_MASK ? |
@@ -1781,8 +1792,14 @@ static bool detect_ivrs(void) | |||
1781 | 1792 | ||
1782 | static int amd_iommu_init_dma(void) | 1793 | static int amd_iommu_init_dma(void) |
1783 | { | 1794 | { |
1795 | struct amd_iommu *iommu; | ||
1784 | int ret; | 1796 | int ret; |
1785 | 1797 | ||
1798 | init_device_table_dma(); | ||
1799 | |||
1800 | for_each_iommu(iommu) | ||
1801 | iommu_flush_all_caches(iommu); | ||
1802 | |||
1786 | if (iommu_pass_through) | 1803 | if (iommu_pass_through) |
1787 | ret = amd_iommu_init_passthrough(); | 1804 | ret = amd_iommu_init_passthrough(); |
1788 | else | 1805 | else |