Skip to content

Commit 4313a24

Browse files
committed
arch/*/: remove CONFIG_VIRT_TO_BUS
All architecture-independent users of virt_to_bus() and bus_to_virt() have been fixed to use the dma mapping interfaces or have been removed now. This means the definitions on most architectures, and the CONFIG_VIRT_TO_BUS symbol are now obsolete and can be removed. The only exceptions to this are a few network and scsi drivers for m68k Amiga and VME machines and ppc32 Macintosh. These drivers work correctly with the old interfaces and are probably not worth changing. On alpha and parisc, virt_to_bus() were still used in asm/floppy.h. alpha can use isa_virt_to_bus() like x86 does, and parisc can just open-code the virt_to_phys() here, as this is architecture specific code. I tried updating the bus-virt-phys-mapping.rst documentation, which started as an email from Linus to explain some details of the Linux-2.0 driver interfaces. The bits about virt_to_bus() were declared obsolete backin 2000, and the rest is not all that relevant any more, so in the end I just decided to remove the file completely. Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Acked-by: Helge Deller <deller@gmx.de> # parisc Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 93929fb commit 4313a24

File tree

27 files changed

+10
-311
lines changed

27 files changed

+10
-311
lines changed

Documentation/core-api/bus-virt-phys-mapping.rst

Lines changed: 0 additions & 220 deletions
This file was deleted.

Documentation/core-api/dma-api-howto.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -707,20 +707,6 @@ to use the dma_sync_*() interfaces::
707707
}
708708
}
709709

710-
Drivers converted fully to this interface should not use virt_to_bus() any
711-
longer, nor should they use bus_to_virt(). Some drivers have to be changed a
712-
little bit, because there is no longer an equivalent to bus_to_virt() in the
713-
dynamic DMA mapping scheme - you have to always store the DMA addresses
714-
returned by the dma_alloc_coherent(), dma_pool_alloc(), and dma_map_single()
715-
calls (dma_map_sg() stores them in the scatterlist itself if the platform
716-
supports dynamic DMA mapping in hardware) in your driver structures and/or
717-
in the card registers.
718-
719-
All drivers should be using these interfaces with no exceptions. It
720-
is planned to completely remove virt_to_bus() and bus_to_virt() as
721-
they are entirely deprecated. Some ports already do not provide these
722-
as it is impossible to correctly support them.
723-
724710
Handling Errors
725711
===============
726712

Documentation/core-api/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Library functionality that is used throughout the kernel.
4141
rbtree
4242
generic-radix-tree
4343
packing
44-
bus-virt-phys-mapping
4544
this_cpu_ops
4645
timekeeping
4746
errseq

Documentation/translations/zh_CN/core-api/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Todolist:
5252
circular-buffers
5353
generic-radix-tree
5454
packing
55-
bus-virt-phys-mapping
5655
this_cpu_ops
5756
timekeeping
5857
errseq

arch/alpha/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ config ALPHA
1717
select HAVE_PERF_EVENTS
1818
select NEED_DMA_MAP_STATE
1919
select NEED_SG_DMA_LENGTH
20-
select VIRT_TO_BUS
2120
select GENERIC_IRQ_PROBE
2221
select GENERIC_PCI_IOMAP
2322
select AUTO_IRQ_AFFINITY if SMP

arch/alpha/include/asm/floppy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#define fd_free_dma() free_dma(FLOPPY_DMA)
2121
#define fd_clear_dma_ff() clear_dma_ff(FLOPPY_DMA)
2222
#define fd_set_dma_mode(mode) set_dma_mode(FLOPPY_DMA,mode)
23-
#define fd_set_dma_addr(addr) set_dma_addr(FLOPPY_DMA,virt_to_bus(addr))
23+
#define fd_set_dma_addr(addr) set_dma_addr(FLOPPY_DMA,isa_virt_to_bus(addr))
2424
#define fd_set_dma_count(count) set_dma_count(FLOPPY_DMA,count)
2525
#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
2626
#define fd_disable_irq() disable_irq(FLOPPY_IRQ)

arch/alpha/include/asm/io.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ static inline void * phys_to_virt(unsigned long address)
106106
extern unsigned long __direct_map_base;
107107
extern unsigned long __direct_map_size;
108108

109-
static inline unsigned long __deprecated virt_to_bus(volatile void *address)
109+
static inline unsigned long __deprecated isa_virt_to_bus(volatile void *address)
110110
{
111111
unsigned long phys = virt_to_phys(address);
112112
unsigned long bus = phys + __direct_map_base;
113113
return phys <= __direct_map_size ? bus : 0;
114114
}
115-
#define isa_virt_to_bus virt_to_bus
115+
#define isa_virt_to_bus isa_virt_to_bus
116116

117-
static inline void * __deprecated bus_to_virt(unsigned long address)
117+
static inline void * __deprecated isa_bus_to_virt(unsigned long address)
118118
{
119119
void *virt;
120120

@@ -125,7 +125,7 @@ static inline void * __deprecated bus_to_virt(unsigned long address)
125125
virt = phys_to_virt(address);
126126
return (long)address <= 0 ? NULL : virt;
127127
}
128-
#define isa_bus_to_virt bus_to_virt
128+
#define isa_bus_to_virt isa_bus_to_virt
129129

130130
/*
131131
* There are different chipsets to interface the Alpha CPUs to the world.

arch/ia64/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ config IA64
3939
select HAVE_FUNCTION_DESCRIPTORS
4040
select HAVE_VIRT_CPU_ACCOUNTING
4141
select HUGETLB_PAGE_SIZE_VARIABLE if HUGETLB_PAGE
42-
select VIRT_TO_BUS
4342
select GENERIC_IRQ_PROBE
4443
select GENERIC_PENDING_IRQ if SMP
4544
select GENERIC_IRQ_SHOW

arch/ia64/include/asm/io.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size);
9696
extern int valid_phys_addr_range (phys_addr_t addr, size_t count); /* efi.c */
9797
extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count);
9898

99-
/*
100-
* The following two macros are deprecated and scheduled for removal.
101-
* Please use the PCI-DMA interface defined in <asm/pci.h> instead.
102-
*/
103-
#define bus_to_virt phys_to_virt
104-
#define virt_to_bus virt_to_phys
105-
#define page_to_bus page_to_phys
106-
10799
# endif /* KERNEL */
108100

109101
/*

arch/m68k/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ config M68K
3030
select OLD_SIGACTION
3131
select OLD_SIGSUSPEND3
3232
select UACCESS_MEMCPY if !MMU
33-
select VIRT_TO_BUS
3433
select ZONE_DMA
3534

3635
config CPU_BIG_ENDIAN

0 commit comments

Comments
 (0)