From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753614AbcIOPES (ORCPT ); Thu, 15 Sep 2016 11:04:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39404 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753454AbcIOPED (ORCPT ); Thu, 15 Sep 2016 11:04:03 -0400 From: Baoquan He To: joro@8bytes.org Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, dyoung@redhat.com, xlpang@redhat.com, Vincent.Wan@amd.com, Baoquan He Subject: [PATCH v5 6/8] iommu/amd: Do not re-enable dev table entries in kdump Date: Thu, 15 Sep 2016 23:03:24 +0800 Message-Id: <1473951806-25511-7-git-send-email-bhe@redhat.com> In-Reply-To: <1473951806-25511-1-git-send-email-bhe@redhat.com> References: <1473951806-25511-1-git-send-email-bhe@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 15 Sep 2016 15:03:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This enabling should have been done in normal kernel. It's unnecessary to enable it again in kdump kernel. And clean up the function comments of init_device_table_dma. Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 47a8fc9..8d5db2e 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -1651,7 +1651,12 @@ static int __init amd_iommu_init_pci(void) */ ret = amd_iommu_init_api(); - 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); @@ -1829,8 +1834,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