lkml.org 
[lkml]   [2009]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] swiotlb: make swiotlb phys<->bus translations architecture-specific
From
On Thu, 21 May 2009 17:15:27 +0100
Ian Campbell <ian.campbell@citrix.com> wrote:

> This moves swiotlb_bus_to_phys() and swiotlb_phys_to_bus() from
> lib/swiotlb.c to arch/*/include/asm/dma-mapping.h. On x86 gart_to_phys
> and phys_to_gart translations need an exported function for use from
> drivers so introduce common x86_ variants to implement the interface
> required by both.
>
> The __weak swiotlb_bus_to_virt is not currently overriden by any
> architecture therefore it can be made static again. I imagine the
> ability to override phys<->bus translations will be sufficient for any
> potential users anyhow, otherwise we can revisit this aspect.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: Becky Bruce <beckyb@kernel.crashing.org>
> Cc: Olaf Kirch <okir@suse.de>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Greg KH <gregkh@suse.de>
> Cc: xen-devel <xendevel@lists.xensource.com>
> Cc: x86 maintainers <x86@kernel.org>
> Cc: lkml <linux-kernel@vger.kernel.org>
> ---
> arch/ia64/include/asm/dma-mapping.h | 13 +++++++++++++
> arch/x86/include/asm/agp.h | 4 ++--
> arch/x86/include/asm/dma-mapping.h | 15 +++++++++++++++
> arch/x86/kernel/pci-swiotlb.c | 18 ++++++++++++++++++
> arch/x86/xen/pci-swiotlb.c | 15 ---------------
> include/linux/swiotlb.h | 5 -----
> lib/swiotlb.c | 14 +-------------
> 7 files changed, 49 insertions(+), 35 deletions(-)
>
> diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
> index 9f9994d..667d04e 100644
> --- a/arch/ia64/include/asm/dma-mapping.h
> +++ b/arch/ia64/include/asm/dma-mapping.h
> @@ -190,4 +190,17 @@ static inline int swiotlb_force_mapping(phys_addr_t paddr, size_t size)
> extern void *swiotlb_alloc_boot(size_t size, unsigned long nslabs);
> extern void *swiotlb_alloc(unsigned order, unsigned long nslabs);
>
> +static inline dma_addr_t swiotlb_phys_to_bus(struct device *hwdev,
> + phys_addr_t paddr)
> +{
> + return paddr;
> +}
> +
> +static inline phys_addr_t swiotlb_bus_to_phys(struct device *hwdev,
> + dma_addr_t baddr)
> +{
> + return baddr;
> +}
> +
> +

As I wrote in another mail, adding swiotlb specific code in
dma-mapping.h is wrong.


\
 
 \ /
  Last update: 2009-05-22 13:17    [W:0.483 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site