On Thu, Jul 18, 2024 at 11:22 AM Zack Rusin <zack.rusin@xxxxxxxxxxxx> wrote: > +bool vmw_user_object_is_mapped(struct vmw_user_object *uo) > +{ > + struct vmw_bo *bo; > + > + if (!uo || vmw_user_object_is_null(uo)) > + return false; > + > + bo = vmw_user_object_buffer(uo); > + WARN_ON(!bo); > + > + return (bo && bo->map.bo); > +} map.bo is set in ttm_bo_kmap but is not reset to NULL in ttm_bo_kunmap. We only reset it in our vmw_bo_unmap. So we have to ensure all unmaps go through our vmw_bo_unmap or use map.virtual instead of map.bo to indicate the presence of a mapping. I prefer the latter.