• Roland Dreier's avatar
    [PATCH] IB/mthca: fix MTT allocation in mem-free mode · 44ea6687
    Roland Dreier authored
    Fix bug in MTT allocation in mem-free mode.
    
    I misunderstood the MTT size value returned by the firmware -- it is really
    the size of a single MTT entry, since mem-free mode does not segment the MTT
    as the original firmware did.  This meant that our MTT addresses ended up
    being off by a factor of 8.  This meant that our MTT allocations might
    overlap, and so we could overwrite and corrupt earlier memory regions when
    writing new MTT entries.
    
    We fix this by always using our 64-byte MTT segment size.  This allows some
    simplification of the code as well, since there's no reason to put the MTT
    segment size in a variable -- we can always use our enum value directly.
    Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    44ea6687
mthca_profile.c 8.31 KB