From: Gary R Hook Subject: Re: [PATCH 3/3] iommu/amd: Do not flush when device is busy Date: Fri, 4 May 2018 11:52:45 -0500 Message-ID: <0e5269ee-093f-9bb2-0a18-ee0e56fcf8f7@amd.com> References: <20180504162233.11283-1-bigeasy@linutronix.de> <20180504162233.11283-4-bigeasy@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180504162233.11283-4-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> Content-Language: en-US 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: Sebastian Andrzej Siewior , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Cc: tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org, Anna-Maria Gleixner List-Id: iommu@lists.linux-foundation.org On 05/04/2018 11:22 AM, Sebastian Andrzej Siewior wrote: > From: Anna-Maria Gleixner > > When device is already attached to a domain, there is no need to execute > the domain_flush_tlb_pde(). Therefore move the check if the domain is set > into attach_device(). > > Signed-off-by: Anna-Maria Gleixner > Signed-off-by: Sebastian Andrzej Siewior > --- > drivers/iommu/amd_iommu.c | 32 ++++++++++---------------------- > 1 file changed, 10 insertions(+), 22 deletions(-) > > diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c > index f66a5d0b7c62..a801678ae1b4 100644 > --- a/drivers/iommu/amd_iommu.c > +++ b/drivers/iommu/amd_iommu.c > @@ -1878,8 +1878,11 @@ static void clear_dte_entry(u16 devid) > amd_iommu_apply_erratum_63(devid); > } > > -static void do_attach(struct iommu_dev_data *dev_data, > - struct protection_domain *domain) > +/* > + * This function does assigns the device visible for the hardware > + */ The prior version of this comment appears 3 times in the file, and is grammatically problematic every time. Can we simplify it to say * This function makes the device visible in the domain Or some such? I.e. tidy up the two remaining comments?