Re: Q: Kconfig option VIRT_TO_BUS

Bjorn Helgaas
2012-11-12T18:41:13Z

On Mon, Nov 12, 2012 at 9:18 AM, H Hartley Sweeten
<hartleys@visionengravers.com> wrote:
> Hello all,
>
> Does anyone know what the Kconfig option VIRT_TO_BUS does?
> There are a number of "depends on" that option but it does not
> seem to directly enable any code in the kernel.

virt_to_bus() is a deprecated interface for converting a kernel
virtual address to a bus address. It's deprecated because it's
impossible to implement correctly when there are multiple bus address
spaces, because you don't know which bus address space the caller has
in mind.

See Documentation/DMA-API-HOWTO.txt and
Documentation/bus-virt-phys-mapping.txt for more details about
virt_to_bus() and its replacements (dma_map_*()).

It looks like f057eac0d7ad967138390a9dd7fd8267e1e39d19 added
CONFIG_VIRT_TO_BUS as a way to prevent drivers that use virt_to_bus()
from being built on architectures that can't support virt_to_bus().

Architectures that can't implement virt_to_bus() set
CONFIG_ARCH_NO_VIRT_TO_BUS. It looks like powerpc, sh, and sparc
currently set it, but ia64, x86, and probably other arches should also
set it.

Bjorn