forked from Minki/linux
PCI: remove PCI_DMA_BUS_IS_PHYS
This was used by the ide, scsi and networking code in the past to determine if they should bounce payloads. Now that the dma mapping always have to support dma to all physical memory (thanks to swiotlb for non-iommu systems) there is no need to this crude hack any more. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Palmer Dabbelt <palmer@sifive.com> (for riscv) Reviewed-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
ab74cfebaf
commit
325ef1857f
@ -56,11 +56,6 @@ struct pci_controller {
|
||||
|
||||
/* IOMMU controls. */
|
||||
|
||||
/* The PCI address space does not equal the physical memory address space.
|
||||
The networking and block device layers use this boolean for bounce buffer
|
||||
decisions. */
|
||||
#define PCI_DMA_BUS_IS_PHYS 0
|
||||
|
||||
/* TODO: integrate with include/asm-generic/pci.h ? */
|
||||
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
|
||||
{
|
||||
|
@ -16,12 +16,6 @@
|
||||
#define PCIBIOS_MIN_MEM 0x100000
|
||||
|
||||
#define pcibios_assign_all_busses() 1
|
||||
/*
|
||||
* The PCI address space does equal the physical memory address space.
|
||||
* The networking and block device layers use this boolean for bounce
|
||||
* buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS 1
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
@ -19,13 +19,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
|
||||
}
|
||||
#endif /* CONFIG_PCI_DOMAINS */
|
||||
|
||||
/*
|
||||
* The PCI address space does equal the physical memory address space.
|
||||
* The networking and block device layers use this boolean for bounce
|
||||
* buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
#define HAVE_PCI_MMAP
|
||||
#define ARCH_GENERIC_PCI_MMAP_RESOURCE
|
||||
|
||||
|
@ -18,11 +18,6 @@
|
||||
#define pcibios_assign_all_busses() \
|
||||
(pci_has_flag(PCI_REASSIGN_ALL_BUS))
|
||||
|
||||
/*
|
||||
* PCI address space differs from physical memory address space
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (0)
|
||||
|
||||
#define ARCH_GENERIC_PCI_MMAP_RESOURCE 1
|
||||
|
||||
extern int isa_dma_bridge_buggy;
|
||||
|
@ -15,6 +15,4 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
|
||||
/* We don't do dynamic PCI IRQ allocation */
|
||||
}
|
||||
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
#endif /* _ASM_H8300_PCI_H */
|
||||
|
@ -208,7 +208,6 @@ const struct dma_map_ops hexagon_dma_ops = {
|
||||
.sync_single_for_cpu = hexagon_sync_single_for_cpu,
|
||||
.sync_single_for_device = hexagon_sync_single_for_device,
|
||||
.mapping_error = hexagon_mapping_error,
|
||||
.is_phys = 1,
|
||||
};
|
||||
|
||||
void __init hexagon_dma_init(void)
|
||||
|
@ -1845,9 +1845,6 @@ static void ioc_init(unsigned long hpa, struct ioc *ioc)
|
||||
ioc_resource_init(ioc);
|
||||
ioc_sac_init(ioc);
|
||||
|
||||
if ((long) ~iovp_mask > (long) ia64_max_iommu_merge_mask)
|
||||
ia64_max_iommu_merge_mask = ~iovp_mask;
|
||||
|
||||
printk(KERN_INFO PFX
|
||||
"%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n",
|
||||
ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF,
|
||||
|
@ -30,23 +30,6 @@ struct pci_vector_struct {
|
||||
#define PCIBIOS_MIN_IO 0x1000
|
||||
#define PCIBIOS_MIN_MEM 0x10000000
|
||||
|
||||
/*
|
||||
* PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct
|
||||
* correspondence between device bus addresses and CPU physical addresses.
|
||||
* Platforms with a hardware I/O MMU _must_ turn this off to suppress the
|
||||
* bounce buffer handling code in the block and network device layers.
|
||||
* Platforms with separate bus address spaces _must_ turn this off and provide
|
||||
* a device DMA mapping implementation that takes care of the necessary
|
||||
* address translation.
|
||||
*
|
||||
* For now, the ia64 platforms which may have separate/multiple bus address
|
||||
* spaces all have I/O MMUs which support the merging of physically
|
||||
* discontiguous buffers, so we can use that as the sole factor to determine
|
||||
* the setting of PCI_DMA_BUS_IS_PHYS.
|
||||
*/
|
||||
extern unsigned long ia64_max_iommu_merge_mask;
|
||||
#define PCI_DMA_BUS_IS_PHYS (ia64_max_iommu_merge_mask == ~0UL)
|
||||
|
||||
#define HAVE_PCI_MMAP
|
||||
#define ARCH_GENERIC_PCI_MMAP_RESOURCE
|
||||
#define arch_can_pci_mmap_wc() 1
|
||||
|
@ -123,18 +123,6 @@ unsigned long ia64_i_cache_stride_shift = ~0;
|
||||
#define CACHE_STRIDE_SHIFT 5
|
||||
unsigned long ia64_cache_stride_shift = ~0;
|
||||
|
||||
/*
|
||||
* The merge_mask variable needs to be set to (max(iommu_page_size(iommu)) - 1). This
|
||||
* mask specifies a mask of address bits that must be 0 in order for two buffers to be
|
||||
* mergeable by the I/O MMU (i.e., the end address of the first buffer and the start
|
||||
* address of the second buffer must be aligned to (merge_mask+1) in order to be
|
||||
* mergeable). By default, we assume there is no I/O MMU which can merge physically
|
||||
* discontiguous buffers, so we set the merge_mask to ~0UL, which corresponds to a iommu
|
||||
* page-size of 2^64.
|
||||
*/
|
||||
unsigned long ia64_max_iommu_merge_mask = ~0UL;
|
||||
EXPORT_SYMBOL(ia64_max_iommu_merge_mask);
|
||||
|
||||
/*
|
||||
* We use a special marker for the end of memory and it uses the extra (+1) slot
|
||||
*/
|
||||
|
@ -480,11 +480,6 @@ sn_io_early_init(void)
|
||||
tioca_init_provider();
|
||||
tioce_init_provider();
|
||||
|
||||
/*
|
||||
* This is needed to avoid bounce limit checks in the blk layer
|
||||
*/
|
||||
ia64_max_iommu_merge_mask = ~PAGE_MASK;
|
||||
|
||||
sn_irq_lh_init();
|
||||
INIT_LIST_HEAD(&sn_sysdata_list);
|
||||
sn_init_cpei_timer();
|
||||
|
@ -4,12 +4,6 @@
|
||||
|
||||
#include <asm-generic/pci.h>
|
||||
|
||||
/* The PCI address space does equal the physical memory
|
||||
* address space. The networking and block device layers use
|
||||
* this boolean for bounce buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
#define pcibios_assign_all_busses() 1
|
||||
|
||||
#define PCIBIOS_MIN_IO 0x00000100
|
||||
|
@ -62,12 +62,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
|
||||
|
||||
#define HAVE_PCI_LEGACY 1
|
||||
|
||||
/* The PCI address space does equal the physical memory
|
||||
* address space (no IOMMU). The IDE and SCSI device layers use
|
||||
* this boolean for bounce buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
extern void pcibios_claim_one_bus(struct pci_bus *b);
|
||||
|
||||
extern void pcibios_finish_adding_to_bus(struct pci_bus *bus);
|
||||
|
@ -121,13 +121,6 @@ extern unsigned long PCIBIOS_MIN_MEM;
|
||||
#include <linux/string.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
/*
|
||||
* The PCI address space does equal the physical memory address space.
|
||||
* The networking and block device layers use this boolean for bounce
|
||||
* buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
#ifdef CONFIG_PCI_DOMAINS_GENERIC
|
||||
static inline int pci_proc_domain(struct pci_bus *bus)
|
||||
{
|
||||
|
@ -87,29 +87,6 @@ struct pci_hba_data {
|
||||
#define PCI_F_EXTEND 0UL
|
||||
#endif /* !CONFIG_64BIT */
|
||||
|
||||
/*
|
||||
* If the PCI device's view of memory is the same as the CPU's view of memory,
|
||||
* PCI_DMA_BUS_IS_PHYS is true. The networking and block device layers use
|
||||
* this boolean for bounce buffer decisions.
|
||||
*/
|
||||
#ifdef CONFIG_PA20
|
||||
/* All PA-2.0 machines have an IOMMU. */
|
||||
#define PCI_DMA_BUS_IS_PHYS 0
|
||||
#define parisc_has_iommu() do { } while (0)
|
||||
#else
|
||||
|
||||
#if defined(CONFIG_IOMMU_CCIO) || defined(CONFIG_IOMMU_SBA)
|
||||
extern int parisc_bus_is_phys; /* in arch/parisc/kernel/setup.c */
|
||||
#define PCI_DMA_BUS_IS_PHYS parisc_bus_is_phys
|
||||
#define parisc_has_iommu() do { parisc_bus_is_phys = 0; } while (0)
|
||||
#else
|
||||
#define PCI_DMA_BUS_IS_PHYS 1
|
||||
#define parisc_has_iommu() do { } while (0)
|
||||
#endif
|
||||
|
||||
#endif /* !CONFIG_PA20 */
|
||||
|
||||
|
||||
/*
|
||||
** Most PCI devices (eg Tulip, NCR720) also export the same registers
|
||||
** to both MMIO and I/O port space. Due to poor performance of I/O Port
|
||||
|
@ -58,11 +58,6 @@ struct proc_dir_entry * proc_runway_root __read_mostly = NULL;
|
||||
struct proc_dir_entry * proc_gsc_root __read_mostly = NULL;
|
||||
struct proc_dir_entry * proc_mckinley_root __read_mostly = NULL;
|
||||
|
||||
#if !defined(CONFIG_PA20) && (defined(CONFIG_IOMMU_CCIO) || defined(CONFIG_IOMMU_SBA))
|
||||
int parisc_bus_is_phys __read_mostly = 1; /* Assume no IOMMU is present */
|
||||
EXPORT_SYMBOL(parisc_bus_is_phys);
|
||||
#endif
|
||||
|
||||
void __init setup_cmdline(char **cmdline_p)
|
||||
{
|
||||
extern unsigned int boot_args[];
|
||||
|
@ -92,24 +92,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
|
||||
|
||||
#define HAVE_PCI_LEGACY 1
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
|
||||
/* The PCI address space does not equal the physical memory address
|
||||
* space (we have an IOMMU). The IDE and SCSI device layers use
|
||||
* this boolean for bounce buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (0)
|
||||
|
||||
#else /* 32-bit */
|
||||
|
||||
/* The PCI address space does equal the physical memory
|
||||
* address space (no IOMMU). The IDE and SCSI device layers use
|
||||
* this boolean for bounce buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
#endif /* CONFIG_PPC64 */
|
||||
|
||||
extern void pcibios_claim_one_bus(struct pci_bus *b);
|
||||
|
||||
extern void pcibios_finish_adding_to_bus(struct pci_bus *bus);
|
||||
|
@ -26,9 +26,6 @@
|
||||
/* RISC-V shim does not initialize PCI bus */
|
||||
#define pcibios_assign_all_busses() 1
|
||||
|
||||
/* We do not have an IOMMU */
|
||||
#define PCI_DMA_BUS_IS_PHYS 1
|
||||
|
||||
extern int isa_dma_bridge_buggy;
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
|
@ -2,8 +2,6 @@
|
||||
#ifndef __ASM_S390_PCI_H
|
||||
#define __ASM_S390_PCI_H
|
||||
|
||||
/* must be set before including asm-generic/pci.h */
|
||||
#define PCI_DMA_BUS_IS_PHYS (0)
|
||||
/* must be set before including pci_clp.h */
|
||||
#define PCI_BAR_COUNT 6
|
||||
|
||||
|
@ -685,8 +685,6 @@ const struct dma_map_ops s390_pci_dma_ops = {
|
||||
.map_page = s390_dma_map_pages,
|
||||
.unmap_page = s390_dma_unmap_pages,
|
||||
.mapping_error = s390_mapping_error,
|
||||
/* if we support direct DMA this must be conditional */
|
||||
.is_phys = 0,
|
||||
/* dma_supported is unconditionally true without a callback */
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(s390_pci_dma_ops);
|
||||
|
@ -71,12 +71,6 @@ extern unsigned long PCIBIOS_MIN_IO, PCIBIOS_MIN_MEM;
|
||||
* SuperH has everything mapped statically like x86.
|
||||
*/
|
||||
|
||||
/* The PCI address space does equal the physical memory
|
||||
* address space. The networking and block device layers use
|
||||
* this boolean for bounce buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
/*
|
||||
* None of the SH PCI controllers support MWI, it is always treated as a
|
||||
|
@ -78,7 +78,6 @@ const struct dma_map_ops nommu_dma_ops = {
|
||||
.sync_single_for_device = nommu_sync_single_for_device,
|
||||
.sync_sg_for_device = nommu_sync_sg_for_device,
|
||||
#endif
|
||||
.is_phys = 1,
|
||||
};
|
||||
|
||||
void __init no_iommu_init(void)
|
||||
|
@ -17,10 +17,6 @@
|
||||
|
||||
#define PCI_IRQ_NONE 0xffffffff
|
||||
|
||||
/* Dynamic DMA mapping stuff.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (0)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#ifndef CONFIG_LEON_PCI
|
||||
|
@ -17,12 +17,6 @@
|
||||
|
||||
#define PCI_IRQ_NONE 0xffffffff
|
||||
|
||||
/* The PCI address space does not equal the physical memory
|
||||
* address space. The networking and block device layers use
|
||||
* this boolean for bounce buffer decisions.
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (0)
|
||||
|
||||
/* PCI IOMMU mapping bypass support. */
|
||||
|
||||
/* PCI 64-bit addressing works for all slots on all controller
|
||||
|
@ -117,9 +117,6 @@ void native_restore_msi_irqs(struct pci_dev *dev);
|
||||
#define native_setup_msi_irqs NULL
|
||||
#define native_teardown_msi_irq NULL
|
||||
#endif
|
||||
|
||||
#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
|
@ -42,8 +42,6 @@ extern struct pci_controller* pcibios_alloc_controller(void);
|
||||
* decisions.
|
||||
*/
|
||||
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
/* Tell PCI code what kind of PCI resource mappings we support */
|
||||
#define HAVE_PCI_MMAP 1
|
||||
#define ARCH_GENERIC_PCI_MMAP_RESOURCE 1
|
||||
|
@ -1596,8 +1596,6 @@ static int __init ccio_probe(struct parisc_device *dev)
|
||||
}
|
||||
#endif
|
||||
ioc_count++;
|
||||
|
||||
parisc_has_iommu();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2017,8 +2017,6 @@ static int __init sba_driver_callback(struct parisc_device *dev)
|
||||
proc_create("sba_iommu", 0, root, &sba_proc_fops);
|
||||
proc_create("sba_iommu-bitmap", 0, root, &sba_proc_bitmap_fops);
|
||||
#endif
|
||||
|
||||
parisc_has_iommu();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -14,12 +14,4 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
|
||||
}
|
||||
#endif /* HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ */
|
||||
|
||||
/*
|
||||
* By default, assume that no iommu is in use and that the PCI
|
||||
* space is mapped to address physical 0.
|
||||
*/
|
||||
#ifndef PCI_DMA_BUS_IS_PHYS
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_GENERIC_PCI_H */
|
||||
|
@ -133,7 +133,6 @@ struct dma_map_ops {
|
||||
#ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
|
||||
u64 (*get_required_mask)(struct device *dev);
|
||||
#endif
|
||||
int is_phys;
|
||||
};
|
||||
|
||||
extern const struct dma_map_ops dma_direct_ops;
|
||||
|
@ -187,6 +187,5 @@ const struct dma_map_ops dma_direct_ops = {
|
||||
.map_sg = dma_direct_map_sg,
|
||||
.dma_supported = dma_direct_supported,
|
||||
.mapping_error = dma_direct_mapping_error,
|
||||
.is_phys = 1,
|
||||
};
|
||||
EXPORT_SYMBOL(dma_direct_ops);
|
||||
|
@ -6,8 +6,6 @@
|
||||
# error Virtio userspace code does not support CONFIG_HAS_DMA
|
||||
#endif
|
||||
|
||||
#define PCI_DMA_BUS_IS_PHYS 1
|
||||
|
||||
enum dma_data_direction {
|
||||
DMA_BIDIRECTIONAL = 0,
|
||||
DMA_TO_DEVICE = 1,
|
||||
|
Loading…
Reference in New Issue
Block a user