All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Lu Baolu <baolu.lu@linux.intel.com>,
	David Woodhouse <dwmw2@infradead.org>
Cc: jroedel@suse.de, iommu@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] iommu/vt-d: Remove deferred_attach_domain()
Date: Mon, 17 Feb 2020 20:38:57 +0100	[thread overview]
Message-ID: <20200217193858.26990-5-joro@8bytes.org> (raw)
In-Reply-To: <20200217193858.26990-1-joro@8bytes.org>

From: Joerg Roedel <jroedel@suse.de>

The function is now only a wrapper around find_domain(). Remove the
function and call find_domain() directly at the call-sites.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/intel-iommu.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 32f43695a22b..16e47ca505eb 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2539,11 +2539,6 @@ static void do_deferred_attach(struct device *dev)
 		intel_iommu_attach_device(domain, dev);
 }
 
-static struct dmar_domain *deferred_attach_domain(struct device *dev)
-{
-	return find_domain(dev);
-}
-
 static inline struct device_domain_info *
 dmar_search_domain_by_dev_info(int segment, int bus, int devfn)
 {
@@ -3643,7 +3638,7 @@ static dma_addr_t __intel_map_single(struct device *dev, phys_addr_t paddr,
 
 	BUG_ON(dir == DMA_NONE);
 
-	domain = deferred_attach_domain(dev);
+	domain = find_domain(dev);
 	if (!domain)
 		return DMA_MAPPING_ERROR;
 
@@ -3863,7 +3858,7 @@ static int intel_map_sg(struct device *dev, struct scatterlist *sglist, int nele
 	if (!iommu_need_mapping(dev))
 		return dma_direct_map_sg(dev, sglist, nelems, dir, attrs);
 
-	domain = deferred_attach_domain(dev);
+	domain = find_domain(dev);
 	if (!domain)
 		return 0;
 
@@ -3958,7 +3953,7 @@ bounce_map_single(struct device *dev, phys_addr_t paddr, size_t size,
 	int prot = 0;
 	int ret;
 
-	domain = deferred_attach_domain(dev);
+	domain = find_domain(dev);
 	if (WARN_ON(dir == DMA_NONE || !domain))
 		return DMA_MAPPING_ERROR;
 
-- 
2.17.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: Lu Baolu <baolu.lu@linux.intel.com>,
	David Woodhouse <dwmw2@infradead.org>
Cc: Joerg Roedel <joro@8bytes.org>,
	jroedel@suse.de, iommu@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] iommu/vt-d: Remove deferred_attach_domain()
Date: Mon, 17 Feb 2020 20:38:57 +0100	[thread overview]
Message-ID: <20200217193858.26990-5-joro@8bytes.org> (raw)
In-Reply-To: <20200217193858.26990-1-joro@8bytes.org>

From: Joerg Roedel <jroedel@suse.de>

The function is now only a wrapper around find_domain(). Remove the
function and call find_domain() directly at the call-sites.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/intel-iommu.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 32f43695a22b..16e47ca505eb 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2539,11 +2539,6 @@ static void do_deferred_attach(struct device *dev)
 		intel_iommu_attach_device(domain, dev);
 }
 
-static struct dmar_domain *deferred_attach_domain(struct device *dev)
-{
-	return find_domain(dev);
-}
-
 static inline struct device_domain_info *
 dmar_search_domain_by_dev_info(int segment, int bus, int devfn)
 {
@@ -3643,7 +3638,7 @@ static dma_addr_t __intel_map_single(struct device *dev, phys_addr_t paddr,
 
 	BUG_ON(dir == DMA_NONE);
 
-	domain = deferred_attach_domain(dev);
+	domain = find_domain(dev);
 	if (!domain)
 		return DMA_MAPPING_ERROR;
 
@@ -3863,7 +3858,7 @@ static int intel_map_sg(struct device *dev, struct scatterlist *sglist, int nele
 	if (!iommu_need_mapping(dev))
 		return dma_direct_map_sg(dev, sglist, nelems, dir, attrs);
 
-	domain = deferred_attach_domain(dev);
+	domain = find_domain(dev);
 	if (!domain)
 		return 0;
 
@@ -3958,7 +3953,7 @@ bounce_map_single(struct device *dev, phys_addr_t paddr, size_t size,
 	int prot = 0;
 	int ret;
 
-	domain = deferred_attach_domain(dev);
+	domain = find_domain(dev);
 	if (WARN_ON(dir == DMA_NONE || !domain))
 		return DMA_MAPPING_ERROR;
 
-- 
2.17.1


  parent reply	other threads:[~2020-02-17 19:39 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 19:38 [PATCH 0/5] iommu/vt-d: Fix kdump boot with VT-d enabled Joerg Roedel
2020-02-17 19:38 ` Joerg Roedel
2020-02-17 19:38 ` [PATCH 1/5] iommu/vt-d: Add attach_deferred() helper Joerg Roedel
2020-02-17 19:38   ` Joerg Roedel
2020-02-17 19:50   ` Jerry Snitselaar
2020-02-17 19:50     ` Jerry Snitselaar
2020-02-18 17:14   ` Christoph Hellwig
2020-02-18 17:14     ` Christoph Hellwig
2020-02-19  9:29     ` Joerg Roedel
2020-02-19  9:29       ` Joerg Roedel
2020-02-17 19:38 ` [PATCH 2/5] iommu/vt-d: Move deferred device attachment into helper function Joerg Roedel
2020-02-17 19:38   ` Joerg Roedel
2020-02-17 19:50   ` Jerry Snitselaar
2020-02-17 19:50     ` Jerry Snitselaar
2020-02-18 17:16   ` Christoph Hellwig
2020-02-18 17:16     ` Christoph Hellwig
2020-02-17 19:38 ` [PATCH 3/5] iommu/vt-d: Do deferred attachment in iommu_need_mapping() Joerg Roedel
2020-02-17 19:38   ` Joerg Roedel
2020-02-17 19:51   ` Jerry Snitselaar
2020-02-17 19:51     ` Jerry Snitselaar
2020-02-18  2:38   ` Lu Baolu
2020-02-18  2:38     ` Lu Baolu
2020-02-18  9:28     ` [PATCH 3/5 v2] " Joerg Roedel
2020-02-18  9:28       ` Joerg Roedel
2020-02-18 11:54       ` Lu Baolu
2020-02-18 11:54         ` Lu Baolu
2020-02-18 16:22         ` Joerg Roedel
2020-02-18 16:22           ` Joerg Roedel
2020-02-18 15:53       ` Jerry Snitselaar
2020-02-18 15:53         ` Jerry Snitselaar
2020-02-17 19:38 ` Joerg Roedel [this message]
2020-02-17 19:38   ` [PATCH 4/5] iommu/vt-d: Remove deferred_attach_domain() Joerg Roedel
2020-02-17 19:51   ` Jerry Snitselaar
2020-02-17 19:51     ` Jerry Snitselaar
2020-02-17 19:38 ` [PATCH 5/5] iommu/vt-d: Simplify check in identity_mapping() Joerg Roedel
2020-02-17 19:38   ` Joerg Roedel
2020-02-17 19:54   ` Jerry Snitselaar
2020-02-17 19:54     ` Jerry Snitselaar

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=20200217193858.26990-5-joro@8bytes.org \
    --to=joro@8bytes.org \
    --cc=baolu.lu@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.