From: Vasant Hegde <vasant.hegde@amd.com>
To: <iommu@lists.linux.dev>, <joro@8bytes.org>
Cc: <will@kernel.org>, <robin.murphy@arm.com>,
<suravee.suthikulpanit@amd.com>,
Vasant Hegde <vasant.hegde@amd.com>
Subject: [PATCH 7/7] iommu/amd: Make protection_domain as static
Date: Tue, 25 Feb 2025 10:53:45 +0000 [thread overview]
Message-ID: <20250225105345.52143-8-vasant.hegde@amd.com> (raw)
In-Reply-To: <20250225105345.52143-1-vasant.hegde@amd.com>
And update amd_iommu_domain_alloc_sva() error path to call
amd_iommu_domain_free() directly.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
---
drivers/iommu/amd/amd_iommu.h | 1 -
drivers/iommu/amd/iommu.c | 2 +-
drivers/iommu/amd/pasid.c | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h
index e3bf27da1339..220c598b7e14 100644
--- a/drivers/iommu/amd/amd_iommu.h
+++ b/drivers/iommu/amd/amd_iommu.h
@@ -47,7 +47,6 @@ extern unsigned long amd_iommu_pgsize_bitmap;
/* Protection domain ops */
void amd_iommu_init_identity_domain(void);
struct protection_domain *protection_domain_alloc(void);
-void protection_domain_free(struct protection_domain *domain);
struct iommu_domain *amd_iommu_domain_alloc_sva(struct device *dev,
struct mm_struct *mm);
void amd_iommu_domain_free(struct iommu_domain *dom);
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 797c8612966a..f4c12dd10adf 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -2434,7 +2434,7 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
*
*****************************************************************************/
-void protection_domain_free(struct protection_domain *domain)
+static void protection_domain_free(struct protection_domain *domain)
{
WARN_ON(!list_empty(&domain->dev_list));
if (domain->domain.type & __IOMMU_DOMAIN_PAGING)
diff --git a/drivers/iommu/amd/pasid.c b/drivers/iommu/amd/pasid.c
index 11150cfd6718..77c8e9a91cbc 100644
--- a/drivers/iommu/amd/pasid.c
+++ b/drivers/iommu/amd/pasid.c
@@ -195,7 +195,7 @@ struct iommu_domain *amd_iommu_domain_alloc_sva(struct device *dev,
ret = mmu_notifier_register(&pdom->mn, mm);
if (ret) {
- protection_domain_free(pdom);
+ amd_iommu_domain_free(&pdom->domain);
return ERR_PTR(ret);
}
--
2.31.1
next prev parent reply other threads:[~2025-02-25 10:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 10:53 [PATCH 0/7] iommu/amd: Trivial fixes Vasant Hegde
2025-02-25 10:53 ` [PATCH 1/7] iommu/amd: Log IOMMU control register in event log path Vasant Hegde
2025-02-25 14:26 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 2/7] iommu/amd: Remove unused variable Vasant Hegde
2025-02-25 14:26 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 3/7] iommu/amd/pgtbl_v2: Improve error handling Vasant Hegde
2025-02-25 14:27 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 4/7] iommu/amd: Remove outdated comment Vasant Hegde
2025-02-25 14:27 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 5/7] iommu/amd: Fix header file Vasant Hegde
2025-02-25 14:28 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 6/7] iommu/amd: Remove unused forward declaration Vasant Hegde
2025-02-25 14:28 ` Jason Gunthorpe
2025-02-25 10:53 ` Vasant Hegde [this message]
2025-02-25 14:29 ` [PATCH 7/7] iommu/amd: Make protection_domain as static Jason Gunthorpe
2025-02-25 14:40 ` Vasant Hegde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250225105345.52143-8-vasant.hegde@amd.com \
--to=vasant.hegde@amd.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox