linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* misc ia64 cleanups (resend)
@ 2018-09-20  7:26 Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 1/9] ia64: remove the kern_mem_attribute export Christoph Hellwig
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

A couple random cleanups I stumbled upon when doing dma related work.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/9] ia64: remove the kern_mem_attribute export
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
@ 2018-09-20  7:26 ` Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 2/9] ia64: remove the dead iommu_sac_force variable Christoph Hellwig
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

No actually used anywhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/kernel/efi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 9c09bf390cce..f77d80edddfe 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -842,7 +842,6 @@ kern_mem_attribute (unsigned long phys_addr, unsigned long size)
 	} while (md);
 	return 0;	/* never reached */
 }
-EXPORT_SYMBOL(kern_mem_attribute);
 
 int
 valid_phys_addr_range (phys_addr_t phys_addr, unsigned long size)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/9] ia64: remove the dead iommu_sac_force variable
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 1/9] ia64: remove the kern_mem_attribute export Christoph Hellwig
@ 2018-09-20  7:26 ` Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 3/9] ia64: remove iommu_dma_supported Christoph Hellwig
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

Looks like copy and paste from x86 that never actually got used.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/kernel/pci-dma.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index b5df084c0af4..50b6ad282a90 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -18,8 +18,6 @@
 dma_addr_t bad_dma_address __read_mostly;
 EXPORT_SYMBOL(bad_dma_address);
 
-static int iommu_sac_force __read_mostly;
-
 int no_iommu __read_mostly;
 #ifdef CONFIG_IOMMU_DEBUG
 int force_iommu __read_mostly = 1;
@@ -61,23 +59,6 @@ int iommu_dma_supported(struct device *dev, u64 mask)
 	if (mask < DMA_BIT_MASK(24))
 		return 0;
 
-	/* Tell the device to use SAC when IOMMU force is on.  This
-	   allows the driver to use cheaper accesses in some cases.
-
-	   Problem with this is that if we overflow the IOMMU area and
-	   return DAC as fallback address the device may not handle it
-	   correctly.
-
-	   As a special case some controllers have a 39bit address
-	   mode that is as efficient as 32bit (aic79xx). Don't force
-	   SAC for these.  Assume all masks <= 40 bits are of this
-	   type. Normally this doesn't make any difference, but gives
-	   more gentle handling of IOMMU overflow. */
-	if (iommu_sac_force && (mask >= DMA_BIT_MASK(40))) {
-		dev_info(dev, "Force SAC with mask %llx\n", mask);
-		return 0;
-	}
-
 	return 1;
 }
 EXPORT_SYMBOL(iommu_dma_supported);
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/9] ia64: remove iommu_dma_supported
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 1/9] ia64: remove the kern_mem_attribute export Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 2/9] ia64: remove the dead iommu_sac_force variable Christoph Hellwig
@ 2018-09-20  7:26 ` Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 4/9] ia64: remove the unused bad_dma_address symbol Christoph Hellwig
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

The generic dma_direct_supported helper already used by intel-iommu on
x86 does a better job than the ia64 reimplementation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/kernel/pci-dma.c  | 13 -------------
 drivers/iommu/intel-iommu.c |  2 --
 2 files changed, 15 deletions(-)

diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index 50b6ad282a90..3c2884bef3d4 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -51,18 +51,6 @@ iommu_dma_init(void)
 	return;
 }
 
-int iommu_dma_supported(struct device *dev, u64 mask)
-{
-	/* Copied from i386. Doesn't make much sense, because it will
-	   only work for pci_alloc_coherent.
-	   The caller just has to use GFP_DMA in this case. */
-	if (mask < DMA_BIT_MASK(24))
-		return 0;
-
-	return 1;
-}
-EXPORT_SYMBOL(iommu_dma_supported);
-
 void __init pci_iommu_alloc(void)
 {
 	dma_ops = &intel_dma_ops;
@@ -71,7 +59,6 @@ void __init pci_iommu_alloc(void)
 	intel_dma_ops.sync_sg_for_cpu = machvec_dma_sync_sg;
 	intel_dma_ops.sync_single_for_device = machvec_dma_sync_single;
 	intel_dma_ops.sync_sg_for_device = machvec_dma_sync_sg;
-	intel_dma_ops.dma_supported = iommu_dma_supported;
 
 	/*
 	 * The order of these functions is important for
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 5f3f10cf9d9d..e72efef97924 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3903,9 +3903,7 @@ const struct dma_map_ops intel_dma_ops = {
 	.map_page = intel_map_page,
 	.unmap_page = intel_unmap_page,
 	.mapping_error = intel_mapping_error,
-#ifdef CONFIG_X86
 	.dma_supported = dma_direct_supported,
-#endif
 };
 
 static inline int iommu_domain_cache_init(void)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/9] ia64: remove the unused bad_dma_address symbol
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
                   ` (2 preceding siblings ...)
  2018-09-20  7:26 ` [PATCH 3/9] ia64: remove iommu_dma_supported Christoph Hellwig
@ 2018-09-20  7:26 ` Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 5/9] ia64: remove the unused pci_iommu_shutdown function Christoph Hellwig
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/kernel/pci-dma.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index 3c2884bef3d4..924966e5aa25 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -15,9 +15,6 @@
 #include <linux/kernel.h>
 #include <asm/page.h>
 
-dma_addr_t bad_dma_address __read_mostly;
-EXPORT_SYMBOL(bad_dma_address);
-
 int no_iommu __read_mostly;
 #ifdef CONFIG_IOMMU_DEBUG
 int force_iommu __read_mostly = 1;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/9] ia64: remove the unused pci_iommu_shutdown function
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
                   ` (3 preceding siblings ...)
  2018-09-20  7:26 ` [PATCH 4/9] ia64: remove the unused bad_dma_address symbol Christoph Hellwig
@ 2018-09-20  7:26 ` Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 6/9] ia64: remove the unused iommu_dma_init function Christoph Hellwig
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/include/asm/iommu.h | 1 -
 arch/ia64/kernel/pci-dma.c    | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/arch/ia64/include/asm/iommu.h b/arch/ia64/include/asm/iommu.h
index 156b9d8e1932..5397e5aa3704 100644
--- a/arch/ia64/include/asm/iommu.h
+++ b/arch/ia64/include/asm/iommu.h
@@ -5,7 +5,6 @@
 /* 10 seconds */
 #define DMAR_OPERATION_TIMEOUT (((cycles_t) local_cpu_data->itc_freq)*10)
 
-extern void pci_iommu_shutdown(void);
 extern void no_iommu_init(void);
 #ifdef	CONFIG_INTEL_IOMMU
 extern int force_iommu, no_iommu;
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index 924966e5aa25..936af0ec7f8f 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -37,11 +37,6 @@ static int __init pci_iommu_init(void)
 /* Must execute after PCI subsystem */
 fs_initcall(pci_iommu_init);
 
-void pci_iommu_shutdown(void)
-{
-	return;
-}
-
 void __init
 iommu_dma_init(void)
 {
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/9] ia64: remove the unused iommu_dma_init function
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
                   ` (4 preceding siblings ...)
  2018-09-20  7:26 ` [PATCH 5/9] ia64: remove the unused pci_iommu_shutdown function Christoph Hellwig
@ 2018-09-20  7:26 ` Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 7/9] ia64/sn2: remove no-ops dma sync methods Christoph Hellwig
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/include/asm/iommu.h | 1 -
 arch/ia64/kernel/pci-dma.c    | 6 ------
 2 files changed, 7 deletions(-)

diff --git a/arch/ia64/include/asm/iommu.h b/arch/ia64/include/asm/iommu.h
index 5397e5aa3704..7429a72f3f92 100644
--- a/arch/ia64/include/asm/iommu.h
+++ b/arch/ia64/include/asm/iommu.h
@@ -15,7 +15,6 @@ extern int iommu_detected;
 #define no_iommu		(1)
 #define iommu_detected		(0)
 #endif
-extern void iommu_dma_init(void);
 extern void machvec_init(const char *name);
 
 #endif
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index 936af0ec7f8f..afb43677f9ca 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -37,12 +37,6 @@ static int __init pci_iommu_init(void)
 /* Must execute after PCI subsystem */
 fs_initcall(pci_iommu_init);
 
-void __init
-iommu_dma_init(void)
-{
-	return;
-}
-
 void __init pci_iommu_alloc(void)
 {
 	dma_ops = &intel_dma_ops;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/9] ia64/sn2: remove no-ops dma sync methods
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
                   ` (5 preceding siblings ...)
  2018-09-20  7:26 ` [PATCH 6/9] ia64: remove the unused iommu_dma_init function Christoph Hellwig
@ 2018-09-20  7:26 ` Christoph Hellwig
  2018-09-20  7:26 ` [PATCH 8/9] ia64: remove machvec_dma_sync_{single,sg} Christoph Hellwig
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

These do nothing but duplicating an assert that would have triggered
earlier on setting the dma mask, so remove them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/sn/pci/pci_dma.c | 29 -----------------------------
 1 file changed, 29 deletions(-)

diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index 74c934a997bb..3b944fba0a3e 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -314,31 +314,6 @@ static int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl,
 	return nhwentries;
 }
 
-static void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
-				       size_t size, enum dma_data_direction dir)
-{
-	BUG_ON(!dev_is_pci(dev));
-}
-
-static void sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
-					  size_t size,
-					  enum dma_data_direction dir)
-{
-	BUG_ON(!dev_is_pci(dev));
-}
-
-static void sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
-				   int nelems, enum dma_data_direction dir)
-{
-	BUG_ON(!dev_is_pci(dev));
-}
-
-static void sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
-				      int nelems, enum dma_data_direction dir)
-{
-	BUG_ON(!dev_is_pci(dev));
-}
-
 static int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
 	return 0;
@@ -467,10 +442,6 @@ static struct dma_map_ops sn_dma_ops = {
 	.unmap_page		= sn_dma_unmap_page,
 	.map_sg			= sn_dma_map_sg,
 	.unmap_sg		= sn_dma_unmap_sg,
-	.sync_single_for_cpu 	= sn_dma_sync_single_for_cpu,
-	.sync_sg_for_cpu	= sn_dma_sync_sg_for_cpu,
-	.sync_single_for_device = sn_dma_sync_single_for_device,
-	.sync_sg_for_device	= sn_dma_sync_sg_for_device,
 	.mapping_error		= sn_dma_mapping_error,
 	.dma_supported		= sn_dma_supported,
 };
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 8/9] ia64: remove machvec_dma_sync_{single,sg}
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
                   ` (6 preceding siblings ...)
  2018-09-20  7:26 ` [PATCH 7/9] ia64/sn2: remove no-ops dma sync methods Christoph Hellwig
@ 2018-09-20  7:26 ` Christoph Hellwig
  2018-09-20  7:27 ` [PATCH 9/9] intel-iommu: mark intel_dma_ops static Christoph Hellwig
  2018-09-20 16:44 ` misc ia64 cleanups (resend) Luck, Tony
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:26 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

The original form of these was added (to the HP zx1 platform only) by
the following bitkeeper commit (by the way of the historic.git tree):

commit 66b99421d118a5ddd98a72913670b0fcf0a38d45
Author: Andrew Morton <akpm@osdl.org>
Date:   Sat Mar 13 17:05:37 2004 -0800

    [PATCH] DMA: Fill gaping hole in DMA API interfaces.

    From: "David S. Miller" <davem@redhat.com>

The commit does not explain why we'd need the memory barrier on ia64,
it never included the swiotlb or SGI IOMMU based platforms, and also
failed to address the map/unmap parts of the dma mapping interface,
which should provide the same ordering semantics and actually are
commonly used.  The conclusion of this is that they were added in
error and should be removed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/hp/common/sba_iommu.c     |  4 ----
 arch/ia64/include/asm/dma-mapping.h |  5 -----
 arch/ia64/kernel/machvec.c          | 16 ----------------
 arch/ia64/kernel/pci-dma.c          |  5 -----
 4 files changed, 30 deletions(-)

diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 671ce1e3f6f2..e8a93b07283e 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -2207,10 +2207,6 @@ const struct dma_map_ops sba_dma_ops = {
 	.unmap_page		= sba_unmap_page,
 	.map_sg			= sba_map_sg_attrs,
 	.unmap_sg		= sba_unmap_sg_attrs,
-	.sync_single_for_cpu	= machvec_dma_sync_single,
-	.sync_sg_for_cpu	= machvec_dma_sync_sg,
-	.sync_single_for_device	= machvec_dma_sync_single,
-	.sync_sg_for_device	= machvec_dma_sync_sg,
 	.dma_supported		= sba_dma_supported,
 	.mapping_error		= sba_dma_mapping_error,
 };
diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
index 76e4d6632d68..2b8cd4a6d958 100644
--- a/arch/ia64/include/asm/dma-mapping.h
+++ b/arch/ia64/include/asm/dma-mapping.h
@@ -16,11 +16,6 @@ extern const struct dma_map_ops *dma_ops;
 extern struct ia64_machine_vector ia64_mv;
 extern void set_iommu_machvec(void);
 
-extern void machvec_dma_sync_single(struct device *, dma_addr_t, size_t,
-				    enum dma_data_direction);
-extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int,
-				enum dma_data_direction);
-
 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
 {
 	return platform_dma_get_ops(NULL);
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index 7bfe98859911..1b604d02250b 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -73,19 +73,3 @@ machvec_timer_interrupt (int irq, void *dev_id)
 {
 }
 EXPORT_SYMBOL(machvec_timer_interrupt);
-
-void
-machvec_dma_sync_single(struct device *hwdev, dma_addr_t dma_handle, size_t size,
-			enum dma_data_direction dir)
-{
-	mb();
-}
-EXPORT_SYMBOL(machvec_dma_sync_single);
-
-void
-machvec_dma_sync_sg(struct device *hwdev, struct scatterlist *sg, int n,
-		    enum dma_data_direction dir)
-{
-	mb();
-}
-EXPORT_SYMBOL(machvec_dma_sync_sg);
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index afb43677f9ca..5a5bf5a82ac2 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -41,11 +41,6 @@ void __init pci_iommu_alloc(void)
 {
 	dma_ops = &intel_dma_ops;
 
-	intel_dma_ops.sync_single_for_cpu = machvec_dma_sync_single;
-	intel_dma_ops.sync_sg_for_cpu = machvec_dma_sync_sg;
-	intel_dma_ops.sync_single_for_device = machvec_dma_sync_single;
-	intel_dma_ops.sync_sg_for_device = machvec_dma_sync_sg;
-
 	/*
 	 * The order of these functions is important for
 	 * fall-back/fail-over reasons
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 9/9] intel-iommu: mark intel_dma_ops static
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
                   ` (7 preceding siblings ...)
  2018-09-20  7:26 ` [PATCH 8/9] ia64: remove machvec_dma_sync_{single,sg} Christoph Hellwig
@ 2018-09-20  7:27 ` Christoph Hellwig
  2018-09-20 16:44 ` misc ia64 cleanups (resend) Luck, Tony
  9 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-09-20  7:27 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, iommu, linux-kernel

ia64 currently explicitly assigns it to dma_ops, but that same work is
already done by intel_iommu_init a little later, so we can remove the
duplicate assignment and mark the variable static.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/kernel/pci-dma.c  | 4 ----
 drivers/iommu/intel-iommu.c | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index 5a5bf5a82ac2..fe988c49f01c 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -24,8 +24,6 @@ int force_iommu __read_mostly;
 
 int iommu_pass_through;
 
-extern struct dma_map_ops intel_dma_ops;
-
 static int __init pci_iommu_init(void)
 {
 	if (iommu_detected)
@@ -39,8 +37,6 @@ fs_initcall(pci_iommu_init);
 
 void __init pci_iommu_alloc(void)
 {
-	dma_ops = &intel_dma_ops;
-
 	/*
 	 * The order of these functions is important for
 	 * fall-back/fail-over reasons
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index e72efef97924..0ee6516de41a 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3895,7 +3895,7 @@ static int intel_mapping_error(struct device *dev, dma_addr_t dma_addr)
 	return !dma_addr;
 }
 
-const struct dma_map_ops intel_dma_ops = {
+static const struct dma_map_ops intel_dma_ops = {
 	.alloc = intel_alloc_coherent,
 	.free = intel_free_coherent,
 	.map_sg = intel_map_sg,
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: misc ia64 cleanups (resend)
  2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
                   ` (8 preceding siblings ...)
  2018-09-20  7:27 ` [PATCH 9/9] intel-iommu: mark intel_dma_ops static Christoph Hellwig
@ 2018-09-20 16:44 ` Luck, Tony
  9 siblings, 0 replies; 12+ messages in thread
From: Luck, Tony @ 2018-09-20 16:44 UTC (permalink / raw)
  To: Christoph Hellwig, Yu, Fenghua; +Cc: linux-ia64, iommu, linux-kernel

> A couple random cleanups I stumbled upon when doing dma related work.

Christoph,

Thanks.  Applied. Will send pull request for next merge window.

-Tony

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/9] ia64: remove iommu_dma_supported
  2018-08-01 16:02 DMA related cleanups for IA64 Christoph Hellwig
@ 2018-08-01 16:02 ` Christoph Hellwig
  0 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-08-01 16:02 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu
  Cc: David Woodhouse, linux-ia64, linux-arch, linux-kernel, iommu

The generic dma_direct_supported helper already used by intel-iommu on
x86 does a better job than the ia64 reimplementation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/ia64/kernel/pci-dma.c  | 13 -------------
 drivers/iommu/intel-iommu.c |  2 --
 2 files changed, 15 deletions(-)

diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index 50b6ad282a90..3c2884bef3d4 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -51,18 +51,6 @@ iommu_dma_init(void)
 	return;
 }
 
-int iommu_dma_supported(struct device *dev, u64 mask)
-{
-	/* Copied from i386. Doesn't make much sense, because it will
-	   only work for pci_alloc_coherent.
-	   The caller just has to use GFP_DMA in this case. */
-	if (mask < DMA_BIT_MASK(24))
-		return 0;
-
-	return 1;
-}
-EXPORT_SYMBOL(iommu_dma_supported);
-
 void __init pci_iommu_alloc(void)
 {
 	dma_ops = &intel_dma_ops;
@@ -71,7 +59,6 @@ void __init pci_iommu_alloc(void)
 	intel_dma_ops.sync_sg_for_cpu = machvec_dma_sync_sg;
 	intel_dma_ops.sync_single_for_device = machvec_dma_sync_single;
 	intel_dma_ops.sync_sg_for_device = machvec_dma_sync_sg;
-	intel_dma_ops.dma_supported = iommu_dma_supported;
 
 	/*
 	 * The order of these functions is important for
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 115ff26e9ced..1be2609bd094 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3897,9 +3897,7 @@ const struct dma_map_ops intel_dma_ops = {
 	.map_page = intel_map_page,
 	.unmap_page = intel_unmap_page,
 	.mapping_error = intel_mapping_error,
-#ifdef CONFIG_X86
 	.dma_supported = dma_direct_supported,
-#endif
 };
 
 static inline int iommu_domain_cache_init(void)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-09-20 16:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20  7:26 misc ia64 cleanups (resend) Christoph Hellwig
2018-09-20  7:26 ` [PATCH 1/9] ia64: remove the kern_mem_attribute export Christoph Hellwig
2018-09-20  7:26 ` [PATCH 2/9] ia64: remove the dead iommu_sac_force variable Christoph Hellwig
2018-09-20  7:26 ` [PATCH 3/9] ia64: remove iommu_dma_supported Christoph Hellwig
2018-09-20  7:26 ` [PATCH 4/9] ia64: remove the unused bad_dma_address symbol Christoph Hellwig
2018-09-20  7:26 ` [PATCH 5/9] ia64: remove the unused pci_iommu_shutdown function Christoph Hellwig
2018-09-20  7:26 ` [PATCH 6/9] ia64: remove the unused iommu_dma_init function Christoph Hellwig
2018-09-20  7:26 ` [PATCH 7/9] ia64/sn2: remove no-ops dma sync methods Christoph Hellwig
2018-09-20  7:26 ` [PATCH 8/9] ia64: remove machvec_dma_sync_{single,sg} Christoph Hellwig
2018-09-20  7:27 ` [PATCH 9/9] intel-iommu: mark intel_dma_ops static Christoph Hellwig
2018-09-20 16:44 ` misc ia64 cleanups (resend) Luck, Tony
  -- strict thread matches above, loose matches on Subject: below --
2018-08-01 16:02 DMA related cleanups for IA64 Christoph Hellwig
2018-08-01 16:02 ` [PATCH 3/9] ia64: remove iommu_dma_supported Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).