• Daniel Mentz's avatar
    dma-debug: Fix dma_debug_entry offset calculation · 0354aec1
    Daniel Mentz authored
    dma-debug uses struct dma_debug_entry to keep track of dma coherent
    memory allocation requests. The virtual address is converted into a pfn
    and an offset. Previously, the offset was calculated using an incorrect
    bit mask.  As a result, we saw incorrect error messages from dma-debug
    like the following:
    
    "DMA-API: exceeded 7 overlapping mappings of cacheline 0x03e00000"
    
    Cacheline 0x03e00000 does not exist on our platform.
    
    Cc: <stable@vger.kernel.org>
    Fixes: 0abdd7a8 ("dma-debug: introduce debug_dma_assert_idle()")
    Signed-off-by: default avatarDaniel Mentz <danielmentz@google.com>
    Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    0354aec1
dma-debug.c 42.2 KB