From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751878AbbJJMak (ORCPT ); Sat, 10 Oct 2015 08:30:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57958 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbbJJMaj (ORCPT ); Sat, 10 Oct 2015 08:30:39 -0400 Date: Sat, 10 Oct 2015 20:30:36 +0800 From: Baoquan He To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/10] iommu/amd: Clear the iommu pre enabled setting Message-ID: <20151010123036.GC31787@dhcp-16-116.nay.redhat.com> References: <1443076656-31776-1-git-send-email-bhe@redhat.com> <1443076656-31776-10-git-send-email-bhe@redhat.com> <20150929160949.GP3036@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150929160949.GP3036@8bytes.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/29/15 at 06:09pm, Joerg Roedel wrote: > On Thu, Sep 24, 2015 at 02:37:35PM +0800, Baoquan He wrote: > > @@ -2469,6 +2469,8 @@ static dma_addr_t __map_single(struct device *dev, > > unsigned long align_mask = 0; > > int i; > > > > + if (translation_pre_enabled()) > > + clear_translation_pre_enabled(); > > There is probably a better place to do this somewhere in the > initialization state machine of the AMD IOMMU driver. Yeah, I put it in state_next(). static int __init state_next(void) { int ret = 0; switch (init_state) { case IOMMU_START_STATE: ...... case IOMMU_DMA_OPS: if (translation_pre_enabled()) clear_translation_pre_enabled(); init_state = IOMMU_INITIALIZED; break; ...... } > > > Joerg >