Skip to content
Snippets Groups Projects
  • Lin.Cao's avatar
    ac17884e
    drm/buddy: fix issue that force_merge cannot free all roots · ac17884e
    Lin.Cao authored
    
    If buddy manager have more than one roots and each root have sub-block
    need to be free. When drm_buddy_fini called, the first loop of
    force_merge will merge and free all of the sub block of first root,
    which offset is 0x0 and size is biggest(more than have of the mm size).
    In subsequent force_merge rounds, if we use 0 as start and use remaining
    mm size as end, the block of other roots will be skipped in
    __force_merge function. It will cause the other roots can not be freed.
    
    Solution: use roots' offset as the start could fix this issue.
    
    Signed-off-by: default avatarLin.Cao <lincao12@amd.com>
    Reviewed-by: default avatarArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
    ac17884e
    History
    drm/buddy: fix issue that force_merge cannot free all roots
    Lin.Cao authored
    
    If buddy manager have more than one roots and each root have sub-block
    need to be free. When drm_buddy_fini called, the first loop of
    force_merge will merge and free all of the sub block of first root,
    which offset is 0x0 and size is biggest(more than have of the mm size).
    In subsequent force_merge rounds, if we use 0 as start and use remaining
    mm size as end, the block of other roots will be skipped in
    __force_merge function. It will cause the other roots can not be freed.
    
    Solution: use roots' offset as the start could fix this issue.
    
    Signed-off-by: default avatarLin.Cao <lincao12@amd.com>
    Reviewed-by: default avatarArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>