[PATCH 1/2] drm/ttm: fix locking in vmap/vunmap TTM GEM helpers

Christian König christian.koenig at amd.com
Fri Jul 15 11:33:44 UTC 2022


Am 15.07.22 um 13:31 schrieb Dmitry Osipenko:
> On 7/15/22 14:15, Christian König wrote:
>> I've stumbled over this while reviewing patches for DMA-buf and it looks
>> like we completely messed the locking up here.
>>
>> In general most TTM function should only be called while holding the
>> appropriate BO resv lock. Without this we could break the internal
>> buffer object state here.
> Could you please clarify which part of the TTM state is affected?

The ttm_bo_vmap() function calls ttm_mem_io_reserve() with bo->resource 
as parameter.

Since bo->resource is protected by the lock we must make sure that we 
are holding the lock while doing this.

Regards,
Christian.


More information about the dri-devel mailing list