• Oded Gabbay's avatar
    habanalabs: fix bug in checking huge page optimization · e787555f
    Oded Gabbay authored
    [ Upstream commit d7241701 ]
    
    This patch fix a bug in the mmu code that checks whether we can use huge
    page mappings for host pages.
    
    The code is supposed to enable huge page mappings only if ALL DMA
    addresses are aligned to 2MB AND the number of pages in each DMA chunk is
    a modulo of the number of pages in 2MB. However, the code ignored the
    first requirement for the first DMA chunk.
    
    This patch fix that issue by making sure the requirement of address
    alignment is validated against all DMA chunks.
    Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    e787555f
memory.c 44 KB