Merge tag 'please-pull-next' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 23 Oct 2018 10:06:43 +0000 (11:06 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 23 Oct 2018 10:06:43 +0000 (11:06 +0100)
Pull ia64 updates from Tony Luck:
 "Miscellaneous ia64 fixes from Christoph"

* tag 'please-pull-next' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
  intel-iommu: mark intel_dma_ops static
  ia64: remove machvec_dma_sync_{single,sg}
  ia64/sn2: remove no-ops dma sync methods
  ia64: remove the unused iommu_dma_init function
  ia64: remove the unused pci_iommu_shutdown function
  ia64: remove the unused bad_dma_address symbol
  ia64: remove iommu_dma_supported
  ia64: remove the dead iommu_sac_force variable
  ia64: remove the kern_mem_attribute export

arch/ia64/hp/common/sba_iommu.c
arch/ia64/include/asm/dma-mapping.h
arch/ia64/include/asm/iommu.h
arch/ia64/kernel/efi.c
arch/ia64/kernel/machvec.c
arch/ia64/kernel/pci-dma.c
arch/ia64/sn/pci/pci_dma.c
drivers/iommu/intel-iommu.c

index 671ce1e3f6f29f9966bdbca5ae3df15229aecfae..e8a93b07283e42fdfc64441db82deada29bddd7b 100644 (file)
@@ -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,
 };
index 522745ae67bb652858563e3175e97c49a0cb64c7..f7ec71e4001e7d6e0eef60abca31fcd1d8710483 100644 (file)
@@ -14,11 +14,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);
index 156b9d8e19327970a73e2f7ed102af6d26416809..7429a72f3f921996643c48d19dc206fe3034b7dd 100644 (file)
@@ -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;
@@ -16,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
index 9c09bf390ccea55fd1272d69e2445dcb44935327..f77d80edddfeb7d48dc85ffc9fad9454a60c5386 100644 (file)
@@ -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)
index 7bfe98859911a41b90cb5ddfc6e50014709e1c4c..1b604d02250bee2b8b0ea41d3236ac62ac17b6c6 100644 (file)
@@ -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);
index b5df084c0af40af307cc55690a1f95cb24bf092e..fe988c49f01ce6ae844355731ddc50f01fef3df1 100644 (file)
 #include <linux/kernel.h>
 #include <asm/page.h>
 
-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;
@@ -29,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)
@@ -42,56 +35,8 @@ 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)
-{
-       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;
-
-       /* 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);
-
 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;
-       intel_dma_ops.dma_supported = iommu_dma_supported;
-
        /*
         * The order of these functions is important for
         * fall-back/fail-over reasons
index 96eb2567718a29e71dbcf9e91bf01ed1e4ff80d8..4ce4ee4ef9f2c7b74b48fdc19c2d4706f6fab173 100644 (file)
@@ -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;
@@ -466,10 +441,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,
        .get_required_mask      = sn_dma_get_required_mask,
index bedc801b06a0bf2c6745511acbab08e769a54eb2..76f0a5d16ed3ba816490fc49a1296d9d83ed39b9 100644 (file)
@@ -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,
@@ -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)