Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751767AbdG1ChH (ORCPT ); Thu, 27 Jul 2017 22:37:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40544 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751667AbdG1ChG (ORCPT ); Thu, 27 Jul 2017 22:37:06 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 03006AE46D Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=bhe@redhat.com Date: Fri, 28 Jul 2017 10:36:57 +0800 From: Baoquan He To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 02/13] iommu/amd: add several helper functions Message-ID: <20170728023657.GG24304@x1> References: <1500627551-12930-1-git-send-email-bhe@redhat.com> <1500627551-12930-3-git-send-email-bhe@redhat.com> <20170727150612.GK3610@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170727150612.GK3610@suse.de> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 28 Jul 2017 02:37:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1792 Lines: 56 On 07/27/17 at 05:06pm, Joerg Roedel wrote: > On Fri, Jul 21, 2017 at 04:59:00PM +0800, Baoquan He wrote: > > Move single iommu enabling codes into a wrapper function early_enable_iommu(). > > This can make later kdump change easier. > > > > And also add iommu_disable_command_buffer and iommu_disable_event_buffer > > for later usage. > > > > Signed-off-by: Baoquan He > > --- > > drivers/iommu/amd_iommu_init.c | 42 +++++++++++++++++++++++++++++++----------- > > 1 file changed, 31 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c > > index e39857ce6481..4ca6e3257d92 100644 > > --- a/drivers/iommu/amd_iommu_init.c > > +++ b/drivers/iommu/amd_iommu_init.c > > @@ -634,6 +634,14 @@ static void iommu_enable_command_buffer(struct amd_iommu *iommu) > > amd_iommu_reset_cmd_buffer(iommu); > > } > > > > +/* > > + * This function disables the command buffer > > + */ > > +static void iommu_disable_command_buffer(struct amd_iommu *iommu) > > +{ > > + iommu_feature_disable(iommu, CONTROL_CMDBUF_EN); > > +} > > + > > static void __init free_command_buffer(struct amd_iommu *iommu) > > { > > free_pages((unsigned long)iommu->cmd_buf, get_order(CMD_BUFFER_SIZE)); > > @@ -666,6 +674,14 @@ static void iommu_enable_event_buffer(struct amd_iommu *iommu) > > iommu_feature_enable(iommu, CONTROL_EVT_LOG_EN); > > } > > > > +/* > > + * This function disables the command buffer > > s/command buffer/event log/ Forgot changing it after copying from command buffer code. > > > + */ > > +static void iommu_disable_event_buffer(struct amd_iommu *iommu) > > Please also use event_log here. Sure, will change. Thanks. > > > +{ > > + iommu_feature_disable(iommu, CONTROL_EVT_LOG_EN); > > +} > > +