From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoquan He Subject: [Patch v4 8/9] iommu/amd: Do not initialize dev tables again in kdump Date: Wed, 25 May 2016 14:28:54 +0800 Message-ID: <1464157735-8865-9-git-send-email-bhe@redhat.com> References: <1464157735-8865-1-git-send-email-bhe@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1464157735-8865-1-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, vincent.wan-5C7GfCeVMHo@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org List-Id: iommu@lists.linux-foundation.org From: Baoquan HE The init should have been done in normal kernel, skip it in kdump kernel. And clean up the function comments. Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu_init.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 66a1fa5..47e5972 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -1432,7 +1432,11 @@ static int __init amd_iommu_init_pci(void) break; } - init_device_table_dma(); + for_each_iommu(iommu) { + if ( !translation_pre_enabled(iommu) ) + init_device_table_dma(); + break; + } for_each_iommu(iommu) iommu_flush_all_caches(iommu); @@ -1612,8 +1616,7 @@ static int __init init_memory_definitions(struct acpi_table_header *table) } /* - * Init the device table to not allow DMA access for devices and - * suppress all page faults + * Init the device table to not allow DMA access for devices. */ static void init_device_table_dma(void) { -- 2.5.5