From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932930AbbIXGim (ORCPT ); Thu, 24 Sep 2015 02:38:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32807 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932553AbbIXGiQ (ORCPT ); Thu, 24 Sep 2015 02:38:16 -0400 From: Baoquan He To: joro@8bytes.org, iommu@lists.linux-foundation.org Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Baoquan He Subject: [PATCH 08/10] iommu/amd: Do not update the information of domain to devtables before device driver init Date: Thu, 24 Sep 2015 14:37:34 +0800 Message-Id: <1443076656-31776-9-git-send-email-bhe@redhat.com> In-Reply-To: <1443076656-31776-1-git-send-email-bhe@redhat.com> References: <1443076656-31776-1-git-send-email-bhe@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org update_domain() is the only place where domain->pt_root will be got and set into dev entry. So before the device driver initialization we do nothing if it's in previously enabled translation status. Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 0d59f79..aee1ae4 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2350,7 +2350,7 @@ static void update_device_table(struct protection_domain *domain) static void update_domain(struct protection_domain *domain) { - if (!domain->updated) + if (!domain->updated || translation_pre_enabled()) return; update_device_table(domain); -- 2.4.0