From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.4 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 970C4C4338F for ; Thu, 5 Aug 2021 09:38:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6562560E96 for ; Thu, 5 Aug 2021 09:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238895AbhHEJiW (ORCPT ); Thu, 5 Aug 2021 05:38:22 -0400 Received: from foss.arm.com ([217.140.110.172]:41792 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238146AbhHEJiT (ORCPT ); Thu, 5 Aug 2021 05:38:19 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 168B16D; Thu, 5 Aug 2021 02:38:05 -0700 (PDT) Received: from [10.57.36.146] (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DFEED3F719; Thu, 5 Aug 2021 02:38:03 -0700 (PDT) Subject: Re: [PATCH v3 02/25] iommu/amd: Drop IOVA cookie management From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: linux-kernel@vger.kernel.org, dianders@chromium.org, iommu@lists.linux-foundation.org, rajatja@google.com, linux-arm-kernel@lists.infradead.org References: Message-ID: <44f5c699-1177-7f1d-479e-59a8a42efab6@arm.com> Date: Thu, 5 Aug 2021 10:37:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-08-04 18:15, Robin Murphy wrote: > The core code bakes its own cookies now. > > Signed-off-by: Robin Murphy > > --- > > v3: Also remove unneeded include > --- > drivers/iommu/amd/iommu.c | 13 ------------- > 1 file changed, 13 deletions(-) > > diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c > index 52fe2326042a..92f7cbe3d14a 100644 > --- a/drivers/iommu/amd/iommu.c > +++ b/drivers/iommu/amd/iommu.c > @@ -20,7 +20,6 @@ > #include > #include > #include > -#include Oh dear, how embarrassing... I went through all the drivers making that decision based on iommu_dma* references but totally forgot about iommu_setup_dma_ops() here. And then of course fell into the trap of "such a minor change I don't need to re-rest it" hubris... sigh, roll back to v2 for this one. Apologies, Robin. > #include > #include > #include > @@ -1918,16 +1917,7 @@ static struct iommu_domain *amd_iommu_domain_alloc(unsigned type) > domain->domain.geometry.aperture_end = ~0ULL; > domain->domain.geometry.force_aperture = true; > > - if (type == IOMMU_DOMAIN_DMA && > - iommu_get_dma_cookie(&domain->domain) == -ENOMEM) > - goto free_domain; > - > return &domain->domain; > - > -free_domain: > - protection_domain_free(domain); > - > - return NULL; > } > > static void amd_iommu_domain_free(struct iommu_domain *dom) > @@ -1944,9 +1934,6 @@ static void amd_iommu_domain_free(struct iommu_domain *dom) > if (!dom) > return; > > - if (dom->type == IOMMU_DOMAIN_DMA) > - iommu_put_dma_cookie(&domain->domain); > - > if (domain->flags & PD_IOMMUV2_MASK) > free_gcr3_table(domain); > >