FUJITA Tomonori wrote:On Wed, 08 Apr 2009 16:16:17 -0700
Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
FUJITA Tomonori wrote:
In general those interfaces are deprecated. Are we un-deprecating them? Or do you mean adding virt<->bus to dma_ops?Becky's patches of last week also added __weak annotations to swiotlb_bus_to_virt, virt_to_bus and bus_to_phys; added the hwdev parameter to swiotlb_bus_to_phys; and added a weak swiotlb_arch_address_needs_mapping. I assume that was needed because powerpc needs non-trivial implementations for those functions.Hmm, what she added are wrappers of virt_to_bus and bus_to_virt. We
can remove these and directly use virt_to_bus and bus_to_virt.
Hmm, these interfaces are wrong for drivers surely because they can't
handle dma mapping properly. However, they are exactly what swiotlb
needs (swiotlb doesn't need to care about dma mapping).
It needs to care about the mapping from phys to bus. On x86 they're identical, but on powerpc there can be at least an offset between them.
Until 2.6.28,
swiotlb has used them. They are with IA64, X86_64 and PPC_32, I think.
Well, Becky's patches also added the hwdev argument to them, so presumably the powerpc implementation needs that (different devices/ buses have differing views of physical memory, I guess).