• Furquan Shaikh's avatar
    firmware: gsmi: Drop the use of dma_pool_* API functions · 17adb469
    Furquan Shaikh authored
    
    
    GSMI driver uses dma_pool_* API functions for buffer allocation
    because it requires that the SMI buffers are allocated within 32-bit
    physical address space. However, this does not work well with IOMMU
    since there is no real device and hence no domain associated with the
    device.
    
    Since this is not a real device, it does not require any device
    address(IOVA) for the buffer allocations. The only requirement is to
    ensure that the physical address allocated to the buffer is within
    32-bit physical address space. This is because the buffers have
    nothing to do with DMA at all. It is required for communication with
    firmware executing in SMI mode which has access only to the bottom
    4GiB of memory. Hence, this change switches to using a SLAB cache
    created with SLAB_CACHE_DMA32 that guarantees that the allocation
    happens from the DMA32 memory zone. All calls to dma_pool_* are
    replaced with kmem_cache_*.
    
    In addition to that, all the code for managing the dma_pool for GSMI
    platform device is dropped.
    Signed-off-by: default avatarFurquan Shaikh <furquan@google.com>
    Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Link: https://lore.kernel.org/r/20201022071550.1192947-1-furquan@google.com
    
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    17adb469
gsmi.c 27.8 KB