diff options
author | Christoph Hellwig <hch@lst.de> | 2019-08-13 09:25:06 +0200 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2019-08-16 11:33:57 -0700 |
commit | df43acac8e32e2ee51a1e9376993c5ac18598d92 (patch) | |
tree | fd86e0604c0485dd2116e38575806f93189bddb3 /arch/ia64/hp | |
parent | 2e0f2b1659ddd7bb005ca0bf9f92915904974676 (diff) |
ia64: remove the zx1 swiotlb machvec
The aim of this machvec is to support devices with < 32-bit dma
masks. But given that ia64 only has a ZONE_DMA32 and not a ZONE_DMA
that isn't supported by swiotlb either.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lkml.kernel.org/r/20190813072514.23299-21-hch@lst.de
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/hp')
-rw-r--r-- | arch/ia64/hp/common/Makefile | 2 | ||||
-rw-r--r-- | arch/ia64/hp/common/hwsw_iommu.c | 60 | ||||
-rw-r--r-- | arch/ia64/hp/common/sba_iommu.c | 15 | ||||
-rw-r--r-- | arch/ia64/hp/zx1/Makefile | 2 | ||||
-rw-r--r-- | arch/ia64/hp/zx1/hpzx1_swiotlb_machvec.c | 3 |
5 files changed, 2 insertions, 80 deletions
diff --git a/arch/ia64/hp/common/Makefile b/arch/ia64/hp/common/Makefile index 6026308f9a62..47c8f6ecb6f4 100644 --- a/arch/ia64/hp/common/Makefile +++ b/arch/ia64/hp/common/Makefile @@ -7,6 +7,4 @@ # obj-y := sba_iommu.o -obj-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += hwsw_iommu.o -obj-$(CONFIG_IA64_GENERIC) += hwsw_iommu.o obj-$(CONFIG_IA64_HP_AML_NFW) += aml_nfw.o diff --git a/arch/ia64/hp/common/hwsw_iommu.c b/arch/ia64/hp/common/hwsw_iommu.c deleted file mode 100644 index 8840ed97712f..000000000000 --- a/arch/ia64/hp/common/hwsw_iommu.c +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (c) 2004 Hewlett-Packard Development Company, L.P. - * Contributed by David Mosberger-Tang <davidm@hpl.hp.com> - * - * This is a pseudo I/O MMU which dispatches to the hardware I/O MMU - * whenever possible. We assume that the hardware I/O MMU requires - * full 32-bit addressability, as is the case, e.g., for HP zx1-based - * systems (there, the I/O MMU window is mapped at 3-4GB). If a - * device doesn't provide full 32-bit addressability, we fall back on - * the sw I/O TLB. This is good enough to let us support broken - * hardware such as soundcards which have a DMA engine that can - * address only 28 bits. - */ - -#include <linux/device.h> -#include <linux/dma-mapping.h> -#include <linux/swiotlb.h> -#include <linux/export.h> -#include <asm/machvec.h> - -extern const struct dma_map_ops sba_dma_ops; - -/* swiotlb declarations & definitions: */ -extern int swiotlb_late_init_with_default_size (size_t size); - -/* - * Note: we need to make the determination of whether or not to use - * the sw I/O TLB based purely on the device structure. Anything else - * would be unreliable or would be too intrusive. - */ -static inline int use_swiotlb(struct device *dev) -{ - return dev && dev->dma_mask && - !sba_dma_ops.dma_supported(dev, *dev->dma_mask); -} - -const struct dma_map_ops *hwsw_dma_get_ops(struct device *dev) -{ - if (use_swiotlb(dev)) - return NULL; - return &sba_dma_ops; -} -EXPORT_SYMBOL(hwsw_dma_get_ops); - -void __init -hwsw_init (void) -{ - /* default to a smallish 2MB sw I/O TLB */ - if (swiotlb_late_init_with_default_size (2 * (1<<20)) != 0) { -#ifdef CONFIG_IA64_GENERIC - /* Better to have normal DMA than panic */ - printk(KERN_WARNING "%s: Failed to initialize software I/O TLB," - " reverting to hpzx1 platform vector\n", __func__); - machvec_init("hpzx1"); -#else - panic("Unable to initialize software I/O TLB services"); -#endif - } -} diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index 18321ce8bfa0..215fa688b729 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c @@ -2059,7 +2059,7 @@ arch_initcall(acpi_sba_ioc_init_acpi); static int __init sba_init(void) { - if (!ia64_platform_is("hpzx1") && !ia64_platform_is("hpzx1_swiotlb")) + if (!ia64_platform_is("hpzx1")) return 0; #if defined(CONFIG_IA64_GENERIC) @@ -2102,19 +2102,6 @@ sba_init(void) return 0; } -#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_HP_ZX1_SWIOTLB) - /* - * hpzx1_swiotlb needs to have a fairly small swiotlb bounce - * buffer setup to support devices with smaller DMA masks than - * sba_iommu can handle. - */ - if (ia64_platform_is("hpzx1_swiotlb")) { - extern void hwsw_init(void); - - hwsw_init(); - } -#endif - { struct pci_bus *b = NULL; while ((b = pci_find_next_bus(b)) != NULL) diff --git a/arch/ia64/hp/zx1/Makefile b/arch/ia64/hp/zx1/Makefile index 46b37d820b59..bea44b4ed173 100644 --- a/arch/ia64/hp/zx1/Makefile +++ b/arch/ia64/hp/zx1/Makefile @@ -6,4 +6,4 @@ # Copyright (C) Alex Williamson (alex_williamson@hp.com) # -obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o hpzx1_swiotlb_machvec.o +obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o diff --git a/arch/ia64/hp/zx1/hpzx1_swiotlb_machvec.c b/arch/ia64/hp/zx1/hpzx1_swiotlb_machvec.c deleted file mode 100644 index 4392a96b3c58..000000000000 --- a/arch/ia64/hp/zx1/hpzx1_swiotlb_machvec.c +++ /dev/null @@ -1,3 +0,0 @@ -#define MACHVEC_PLATFORM_NAME hpzx1_swiotlb -#define MACHVEC_PLATFORM_HEADER <asm/machvec_hpzx1_swiotlb.h> -#include <asm/machvec_init.h> |