• Russell King's avatar
    [ARM] Fix consistent_alloc() · 9804476c
    Russell King authored
    The old consistent memory allocator, which sat behind
    dma_coherent_alloc() and pci_consistent_alloc() was completely unable
    to handle allocations from interrupt context because we traditionally
    used ioremap, which in turn:
      - allocates memory using GFP_KERNEL for the vm_struct
        and the page tables themselves.
      - calls get_vm_area, which uses write_lock, and therefore
        is unsafe to call from interrupt context.
    
    In order to address this issue, a new consistent_alloc() which avoids
    the above issues has been implemented.  Essentially, we set aside
    a section of the kernel VM space, and pre-allocate page tables to
    cover this area.  We allocate "consistent" memory within this region.
    
    The handling of the allocation is designed to be generic; it should
    be possible to replace the vmalloc(), ioremap() and module_alloc()
    without too much hastle, but that would clearly be a 2.7 thing at
    this stage.
    9804476c
consistent.c 7.85 KB