Re: [PATCH][PPC32[NEWBIE] enhancement to virt_to_bus/bus_to_virt (try 2)

From: Eugene Surovegin (ebs_at_ebshome.net)
Date: 12/05/04

  • Next message: Uwe Storbeck: "kernel 2.6.9: Mouse lost synchronization"
    Date:	Sun, 5 Dec 2004 02:11:10 -0800
    To: Linh Dang <dang.linh@gmail.com>
    
    

    On Fri, Dec 03, 2004 at 09:46:00AM -0500, Linh Dang wrote:
    > On Fri, 3 Dec 2004 07:31:14 +1100, Paul Mackerras <paulus@samba.org> wrote:
    > > Linh Dang writes:
    > >
    > > > In 2.6.9 on non-APUS ppc32 platforms, virt_to_bus() will just subtract
    > > > KERNELBASE from the the virtual address. bus_to_virt() will perform
    > > > the reverse operation.
    > > >
    > > > This patch will make virt_to_bus():
    > > >
    > > > - perform the current operation if the virtual address is between
    > > > KERNELBASE and ioremap_bot.
    > >
    > > Why do you want to do this? The only code that should be using
    > > virt_to_bus or bus_to_virt is the DMA API code, and it's happy with
    > > them the way they are.
    >
    > I wrote a DMA engine (to used by other drivers) that (would like to) accept
    > all kind of buffers as input (vmalloced, dual-access shared RAM mapped
    > by BATs, etc). The DMA engine has to decode the virtual address of the
    > input buffer to (possibly multiple) physical address(es). virt_to_phys()
    > has the right name for the job except it only works for the kernel virtual
    > addresses initially mapped at KERNELBASE

    Unfortunately your patch doesn't achieve your goals. vmalloc space on
    PPC32 will be between KERNEL_BASE and ioremap_bot anyway, so
    additional check is mostly useless anyway (it will only call iopa()
    for ioremaps done early during the boot).

    Also, even assuming you got the range right and called iopa() for
    vmalloced space, tell me how are you gonna deal with non-physically
    continuous vmalloced buffers in your DMA library?

    --
    Eugene
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Uwe Storbeck: "kernel 2.6.9: Mouse lost synchronization"

    Relevant Pages

    • Re: 2.4.23aa2 (bugfixes and important VM improvements for the high end)
      ... >> gap page in vmalloc, and to reduce the vmalloc space, so that we can ... interesting since the pointers are still usable in raw mode, ... don't rate vma size as critical. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Fixes for prep_zero_page
      ... > Unable to handle kernel paging request at virtual address ec5d97f4 ... Is that in vmalloc space? ... > PREEMPT SMP DEBUG_PAGEALLOC ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Many groups patch.
      ... >> The vmalloc space is limited, and the code just gets uglier. ... I'd be ok with the simplest "kmalloc or too bad" version, but our customers ... My version uses a struct group_info which has an array of pages. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] tune vmalloc size
      ... >> a showstopper problem for them. ... >> doubles the size. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)