• Robert Jennings's avatar
    powerpc/pseries: Correct VIO bus accounting problem in CMO env. · 69b052e8
    Robert Jennings authored
    In the VIO bus code the wrappers for dma alloc_coherent and free_coherent
    calls are rounding to IOMMU_PAGE_SIZE.  Taking a look at the underlying
    calls, the actual mapping is promoted to PAGE_SIZE.  Changing the
    rounding in these two functions fixes under-reporting the entitlement
    used by the system.  Without this change, the system could run out of
    entitlement before it believes it has and incur mapping failures at the
    firmware level.
    
    Also in the VIO bus code, the wrapper for dma map_sg is not exiting in
    an error path where it should.  Rather than fall through to code for the
    success case, this patch adds the return that is needed in the error path.
    Signed-off-by: default avatarRobert Jennings <rcj@linux.vnet.ibm.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    69b052e8
vio.c 41.5 KB